To generate a consensus sequence iVar uses the output of samtools mpileup command. The mpileup output must be piped into ivar consensus
The command formed by this wrapper is :
samtools mpileup -A -a -d 0 -Q 0 sorted.bam | ivar consensus [options]
There are five parameters that can be set:
- Minimum quality: the minimum quality of a base to be considered in calculations of variant frequencies at a given position
- Minimum frequency threshold: the minimum frequency that the most likely base must surpass to be called as the consensus base at a position.
- Minimum indel frequency threshold: has the same meaning as the previous threshold, but gets applied to indels specifically. Setting this threshold higher than the threshold applied to SNVs helps reduce indel artefacts in the generated consensus.
- Minimum depth to call consensus: the minimum required depth to call a consensus base
- How to represent positions with coverage less than the minimum depth threshold: for positions for which the above minimum depth to call a consensus base is not reached, you can choose one of three different actions:
- Drop the position from the output entirely (-> the consensus sequence can become shorter than the reference used to produce the input BAM!)
- Use an N, or
- Use a - to represent the position