How to check coverage in bam file?
2
0
Entering edit mode
3 months ago
shinyjj ▴ 50

Hi all,

How do I check the coverage of bam files? These files are bam files derived from GTEx rna short reads. For fastq files, you can count the number of lines and divide by 4 to get the reads wc -l / 4. Is there anyway to get read coverage from bam files similarly?

SRR1092349.bam                     
SRR1366519.bam      
SRR1455653.bam              
SRR820448.bam
bam • 633 views
ADD COMMENT
1
Entering edit mode
3 months ago
GenoMax 147k

Read coverage can't be calculated by number of lines. You will need to use a program like pandepth (LINK) or modsepth (LINK) that can produce chromosome, specific interval or entire genome level estimates.

ADD COMMENT
0
Entering edit mode

Is there way to get the overall coverage of one bam file instead of per chrmosome? Also would samtools fit for this?

ADD REPLY
0
Entering edit mode

What have you tried? Please google "BAM coverage" and use one of the tools you find, or explore samtools depth and mosdepth. GenoMax has mentioned mosdepth for a reason - it is a lot faster than samtools.

ADD REPLY
0
Entering edit mode

pandepth provides coverage across the entire genome.

##RegionLength: NNNNNNNNNNN    CoveredSite: NNNNNNNNN  Coverage(%): 99.85      MeanDepth: 10.40
ADD REPLY
0
Entering edit mode

mosdepth also provides coverage across the whole genome in the ".mosdepth.summary.txt" file (xref How to calculate coverage of Nanopore long read data?)

ADD REPLY
0
Entering edit mode
3 months ago
$ samtools coverage -r chr11 in.bam
#rname  startpos  endpos  numreads  covbases  coverage  meandepth  meanbaseq  meanmapq
chr11    1         3302    358       3295      99.788    7.58237    17         60
ADD COMMENT

Login before adding your answer.

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