This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Effective subsampling of BAMs

I was trying to subsample WES BAM files with samtools view -s on coverage 75. My samples had mean coverage in target regions 195 and 130 so I used fractions 100/195 =0.51 and 100/130=0.76, when I subsampled them with samtools and recalculated coverage it was around 65-68. What I did wrong? If you have any ideas of other tools how to effectively subsample BAMs on the same number of reads or on the same coverage, please let me know.

bam sampling

1 answer

I have some code here A: Subsampling Bam File With Samtools to use sambamba for the subsampling. You can specify a number of reads rather than a fraction, maybe that helps.

Log in to answer this question.