Hi,
I'm analyzing a snRNA-seq dataset consisting of 43 integrated human brain samples across 2 brain regions. During the subtype annotation I noticed some clear signs of the presence of ambient RNA.
The DecontX ambient RNA removal tool seems to be the best fit for our data as I would like to keep my cell type annotations. Unfortunately I'm a bit stuck. Joining the counts of the samples does not seem to work (the matrix gets too big) and the memory usage is enormous. How would you propose to tackle this problem? Do I need to split the samples again, loop the code over every single one and then re-integrate everything?
Thanks in advance!
1 answer
Per-sample isn't a workaround here, it's the correct thing to do. The soup is a property of each individual emulsion, so sample A's ambient profile has nothing to do with sample B's - estimating one contamination distribution across 43 channels that were never mixed would be wrong even if it fitted in memory.
Two things worth knowing. decontX takes a batch argument and does that splitting internally, so you may not need to loop by hand. And it takes z for cell population labels - pass your existing integrated annotations in there. That gives you per-sample decontamination against a consistent global label set, which is exactly the "keep my annotations" behaviour you're after. Looping per sample with per-sample clustering instead would leave you with inconsistent cluster definitions between samples and therefore an inconsistent correction.
Then yes, re-normalise and re-integrate from the corrected counts. One caution: decontXcounts come out non-integer, so if you're doing DE downstream use the raw counts for that and treat the decontamination as affecting clustering and annotation only.
Log in to answer this question.