MarioniLab / DropletUtils

Clone of the Bioconductor repository for the DropletUtils package.
https://bioconductor.org/packages/devel/bioc/html/DropletUtils.html
56 stars 27 forks source link

umi.min.frac.median Parameter bugs #94

Closed Liripo closed 1 year ago

Liripo commented 1 year ago

https://github.com/MarioniLab/DropletUtils/blob/3eced74482c67fc372265c27e86addd5407d75e7/R/emptyDropsCellRanger.R#L135-L144 Hi developer,: In line 144 of the code above, you don't sort the totals variable, I think it is a bug? image Thanks!

LTLA commented 1 year ago

Tagging @DongzeHE. From a brief inspection, it seems that there may be an issue.

Fix should be simple, at the cost of a few extra lines:

ordered.totals <- totals[order(totals, decreasing = TRUE)]
n.umi.max <- ordered.totals[min(length(totals), max.ind)] # nUMImax 

# .... etc.

simple.totals <- head(ordered.totals, ncells.simple)
min.umi  <- max(umi.min, round(umi.min.frac.median * median(simple.totals)))
DongzeHE commented 1 year ago

Hi all,

This is totally my mistake! I have started a PR to resolve this issue.

Best, Dongze