You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider an example output from samtools mpileup for the SARS-CoV2 mutation N501Y:
MN908947.3 23063 A 20 tttttttttttttttttttt EEEEEAAAEEEAEEEEEE/A
i.e. there are 20 reads covering this position with a T, and one of the bases only has a quality score of 14 (encoded by /).
When setting a minimum coverage threshold of 20 (option -m 20) and minimum q-score of 20 (option -q 20) in ivar consensus, the program outputs a T in the consensus sequence, while it should be a N, since only 19 of the bases are at least quality 20.
echo "MN908947.3\t23063\tN\t20\ttttttttttttttttttttt\tEEEEEAAAEEEAEEEEEE/A" | ivar consensus -t 0.9 -m 20 -q 20 -n N -p test.fa && cat test.fa
Minimum Quality: 20
Threshold: 0.9
Minimum depth: 20
Regions with depth less than minimum depth covered by: N
Reference length: 1
Positions with 0 depth: 0
Positions with depth below 20: 0
>Consensus_test_threshold_0.9_quality_20
T
On the other hand, ivar variants properly filters the lower quality base and does not call the variant unless reducing the value for option -q.
Hello @pmenzel , thank you for pointing this out! The way it's setup right now, the variants take the quality into account while setting the threshold for depth but consensus does not take the quality into count when looking at minimum depth. I agree this is confusing and I will work on changing this behavior.
disable overlap detection in samtools mpileup | ivar variants
this makes the variant calls more compatible to ivar consensus,
which does not care about the base qualities when reading the
samtools mpileup output
see also andersen-lab/ivar#97
Consider an example output from
samtools mpileup
for the SARS-CoV2 mutation N501Y:i.e. there are 20 reads covering this position with a
T
, and one of the bases only has a quality score of 14 (encoded by/
).When setting a minimum coverage threshold of 20 (option
-m 20
) and minimum q-score of 20 (option-q 20
) inivar consensus
, the program outputs aT
in the consensus sequence, while it should be aN
, since only 19 of the bases are at least quality 20.On the other hand,
ivar variants
properly filters the lower quality base and does not call the variant unless reducing the value for option-q
.ivar variants -q 20
:ivar variants -q 14
:The text was updated successfully, but these errors were encountered: