Downsample BAM file according to coverage
1
0
Entering edit mode
3.9 years ago

I have a BAM file that has 170X whole exome coverage.

I would like to create a new BAM file from the original that has 100X genome coverage.

I know samtools view -s option will give me the result but what float digit I should give to get 100X coverage?

samtools alignment assembly • 1.7k views
ADD COMMENT
2
Entering edit mode
3.9 years ago
ATpoint 82k
-s FLOAT subsample reads (given INT.FRAC option value, 0.FRAC is the
           fraction of templates/read pairs to keep; INT part sets seed)

So 100/170 = 0.59 so you want to keep 59% of all reads, therefore use e.g. -s 1.59 where the .59 is the fraction to keep and the 1 is a random seed for reproducibility.

ADD COMMENT
1
Entering edit mode

Thank you for the quick reply. That was completely correct and I got the required result.

ADD REPLY

Login before adding your answer.

Traffic: 2235 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