This is a test version of Biostars. For the public version, visit https://www.biostars.org.
calculation of coverage for a given region

I have a region and I want to calculate a coverage per base for each position of this region.

I tried samtools depth and samtools mpileup. They do not show depth == 0. I need it. bedtools coverageBed. Too slow even for one region. Check here. Rsamtools is also too slow to compute everything.

​Are there any another tools that will be fast and will output depth ==0?

sequencing

With samtools depth it is really easy to infer zero coverage regions.

1 answer

Will this bedtools | awk pipe work?

bedtools genomecov -ibam aln.bam -bga | awk '$4==0' | head -n 2 

chr1 0 554304 0 
chr1 554314 554315 0

Log in to answer this question.