Question: Downsample BAM file according to coverage
0
gravatar for nalesh_jadhav
15 days ago by
kolkata
nalesh_jadhav10 wrote:

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 • 74 views
ADD COMMENTlink modified 15 days ago by ATpoint36k • written 15 days ago by nalesh_jadhav10
2
gravatar for ATpoint
15 days ago by
ATpoint36k
Germany
ATpoint36k wrote:
-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 COMMENTlink written 15 days ago by ATpoint36k
1

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

ADD REPLYlink modified 12 days ago • written 14 days ago by nalesh_jadhav10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1719 users visited in the last hour