This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Does samtools depth know how to handle paired-end reads

I wish to test the depth of coverage using samtools depth.. yet I'm not sure if it can handle well paired-end reads.. (assuming that if a BP is read twice due to PE this should not be counted into the coverage)

Does anyone have a clue? or suggestion for another (fast) tool calculates the coverage?

samtools coverage

Just did a quick test with a file containing overlapping paired-end reads, and yes, samtools depth counts each mate separately, so a nucleotide spanned by one pair gets a depth of 2. There is an alternative implementation, sambamba depth, that offers the --fix-mate-overlaps option to avoid double-counting.

1 answer

Use mosdepth. Very fast, outputting a compressed bedGraph. Requires nothing more than an indexed bam file.

Log in to answer this question.