decontam icon indicating copy to clipboard operation
decontam copied to clipboard

NA value when using either or both method

Open llrs opened this issue 6 years ago • 1 comments

When using "either" or "both" method, the p is NA. https://github.com/benjjneb/decontam/blob/078090e9202bcabad484b655681c41aa1573a9cf/R/decontam.R#L189

Isn't any other way to combine them into a single numeric value?

One way would be to use pval <- pmin(p.freq, p.prev), this way if anyone use p column for further analysis it will be able to access the p-value that rejected the null hypothesis.

llrs avatar Nov 13 '18 15:11 llrs

The reason for that is that when using "either" or "both" the decision is not made on the basis of a single score, hence summarizing the scores into a single value isn't really valid. It would be if just the minimum score mattered, but the function accepts different thresholds for the frequency and prevalence scores, hence the higher score can cause the contaminant to be flagged if the threshold for that method is higher.

Note to self: rename that pval variable, as it is not a p-value for the frequency method. Should be renamed to score to follow the manuscript terminology.

benjjneb avatar Nov 13 '18 23:11 benjjneb