Fast and reproducible method to downsample a count matrix to different sequencing depths?
0
0
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.

R • 3.0k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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)

ADD REPLY

Login before adding your answer.

Traffic: 2027 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6