Entering edit mode
7.1 years ago
James Ashmore
★
3.4k
Maybe slightly off-topic, moderators please delete if inappropriate.
Could someone recommend a package or function to downsample a count matrix? I'd like to downsample the matrix multiple times so I can test various metrics at different sequencing depths. I'm currently using a downsampling function from the following walkthrough (http://hemberg-lab.github.io/scRNA.seq.course/normalization-for-library-size.html#downsampling), however it can take quite long to carry out and isn't reproducible.
What do you mean by "isn't reproducible"? That different runs will end up in different matrices? If this is the problem, use
set.seed()
before running the code.Edit: Sorry yes that's what I mean, so setting the seed should solve that issue.
No I mean if I downsample the matrix to say 1M reads per sample (column), and then I do it again, the downsampling will be slightly different across genes (rows)