brentp / mosdepth

fast BAM/CRAM depth calculation for WGS, exome, or targeted sequencing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Soft and hard clipped bases

ezherman opened this issue · comments

Hi, I just wanted to double-check that mosdepth does not include soft and hard clipped bases in calculating coverage depth. I.e., if bases are clipped in the alignment, they do not add to coverage depth. I noticed here that mosdepth is said to "consider" soft and hard-clipped bases, but I was unsure how to interpret that.

Thanks!

Hi, mosdepth does not count soft or hard clipped bases.

Great, thank you!

@brentp I guess related: when not running in fast mode, how are insertions handled? Are they also not counted?

in fast mode, cigar events such as insertions or deletions are not considered (but soft-clips and hard clips are still not counted).

Gotcha! But how about when not running fast mode? Am I right to think that if we have 50M4I50M:

  • In fast mode, 104 bases from the start position would be counted as covered.
  • Not in fast mode, 100 bases from the start position would be counted as covered.

no, in both cases, 100 bases of the reference are covered.
Insertions don't matter for coverage (I should have noted that above).

The difference would be for 50M4D50M. Fast mode would cover 104 bases, default would be 50 bases, then gap, then 50 bases covered.

Understood, thank you @brentp!