This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Understand Bedtools coverage output

I had used bedtools to check coverage.

bedtools coverage -b interval_list.bed -abam fixed.bam -d > bedtools_cov.txt
head -n 2 bedtools_cov.txt 
10  77  112 E00591:309:H7L2KCCX2:6:2215:25712:46630/2   35  -   77  112 0,0,0   1   35, 0,  1   0
10  77  112 E00591:309:H7L2KCCX2:6:2215:25712:46630/2   35  -   77  112 0,0,0   1   35, 0,  2   0

I would like to know which column in the above is for coverage information?

I would like to check coverage for my dataset.

bedtools coverage

1 answer

With bedtools coverage -d, the coverage/depth value is the last column. The second-to-last column is the position (1-based) within the “A feature” (in this case, an alignment in -abam fixed.bam). Using the -d option means “[r]eport[ing] the depth at each position in each A feature” (for more details, see the bedtools coverage docs here); this means you’ll see positions 1, 2, 3, … up to the length of that A feature.

For example, let’s look at the first line:

10  77  112 E00591:309:H7L2KCCX2:6:2215:25712:46630/2   35  -   77  112 0,0,0   1   35, 0,  1   0
  • The second-to-last 1 is position 1 within the A interval (the alignment).
  • The last “0” is the depth/coverage at that position, which means how many B intervals (-b interval_list.bed) overlap that base.

More details here in the bedtools coverage docs.

Log in to answer this question.