Calculate Coverage From Bam File
2
3
Entering edit mode
9.6 years ago
meredith19 ▴ 50

Is there a way to calculate 5x, 10x, 20x, 30x coverage from a BAM file ?

EDIT: I have a BAM file and I want to calculate the percentage of region of interest with 5x, 10x, 20x coverage. I used Samtools and it gives me a list of coverage values. How is the % region of interest with 10x calculated from these values ? Also what should be the minimum and maximum depth value when using Samtools.

coverage bam • 22k views
0
Entering edit mode
0
Entering edit mode

Thanks Pierre. This page discusses the average coverage calculation. How can I calculate coverage for different depths ?

1
Entering edit mode

Hi Meredith. Coverage and depth of sequencing are often used interchangeably. I think it would be a very good idea if you refined your question to make it clearer. Try to be very specific about what EXACTLY you are trying to achieve, since for now there seems to be some confusion.

0
Entering edit mode

Hi Eric. Thanks for your response. I have a BAM file and I want to calculate the percentage of region of interest with 5x, 10x, 20x coverage. I used Samtools and it gives me a list of coverage values. How is the % region of interest with 10x calculated from these values ? Also what should be the minimum and maximum depth value when using Samtools. This is the first time that I have been exposed to sequencing. Please forgive me for my ignorance of this subject.

Thanks.

3
Entering edit mode
9.6 years ago

Hi Meredith,

First of all you should pull out your region of interest from the big bam file. That will make your analysis faster and you would be able to calculate coverage specific for that region. It should be sth like:

samtools view -bh your.sorted.bam chr1:100,000-20,000 (region of interest) > regionofinterest.bam

1
Entering edit mode

3
Entering edit mode
9.3 years ago
William ★ 5.1k

There is a nice plot in the qualimap output that show the percentage of the genome (or region) that is covered x (1 up to 50 with increases of 1 ) times.

Save yourself a lot of scripting and just run qualimap.

http://qualimap.bioinfo.cipf.es/