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

Cannot run ambientContribMaximum for y with multiple columns #74

Open mgrantpeters opened 3 years ago

mgrantpeters commented 3 years ago

Hello, Thank you for the very helpful package! I am having an error when I try to run ambientContribMaximum and am unsure whether I have misunderstood its application or if I could have come across an error. I have multiplexed data with single cells from n samples in a single raw matrix. I calculated the ambient contamination with ambientProfileEmpty(raw_matrix, good.turing = TRUE), generating a vector. I wanted to estimate the ambient contamination for all my multiplexed samples, and therefore tried running ambientContribMaximum(samples, ambient, mode="scale") where samples is a matrix of n samples. I assumed I could estimate the ambient contamination for multiple samples or clusters within a run given this line in the documentation of ambientContribMaximum: "Hence, the function works best when y contains aggregated counts for one or more groups of droplets with the same expected expression profile, e.g., clusters of related cells." However I receive the following error when I try to run this:

Error: BiocParallel errors element index: 1 first error: 'to' must be a finite number In addition: Warning message: In .maximum_ambience(y = y[, i], ambient = A, ...) : 'y' and 'ambient' do not have the same feature names

I can run it if I ensure ambient has the same number of columns as y (by copying ambient multiple times in a matrix), but I am wary about whether this is the most appropriate course of action. Have I misunderstood the application of ambientContribMaximum/is there anything I should do differently? Do you have any suggestions as to how to accomplish my goal?

Thank you in advance!

LTLA commented 3 years ago

Can you provide a minimum reproducible example? For example, example(ambientContribMaximum) works fine for me. What is different about your data that the same code doesn't work for you?