This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Fast and reproducible method to downsample a count matrix to different sequencing depths?

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.

r

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)

0 answers

No answers yet.

Log in to answer this question.