<p>No, samtools (and therefore bcftools) does not use soft-clipped bases. You can quickly confirm this by using either <code>samtools depth</code> or <code>samtools mpileup</code> to look at a region with a soft-clipped alignment. You'll note that the soft-clipped region isn't used in the depth/pileup (both tools use the same underlying code, so it doesn't matter which you use). If you're curious, samtools ignores soft-clipped bases because it's based on making a per-base stack of alignments covering each position. In the BAM format, alignments are sorted and assigned to bins according to their start/end positions, which won't include soft-clipping. Consequently, when samtools is making the pileup it won't even see the alignments that would overlap a given base if soft-clipped bases were included.</p>

<p>This then sort of begs the question of what GATK's HaplotypeCaller is doing differently. There, regions in the genome are essentially assembled in a small de Bruijn graph, which allows for soft-clipped bases around indels to then be resolved, given that the graph would start/end a little-way on past each side of indels. This is also why you don't need to do indel realignment with the HaplotypeCaller (this was needed in the old UnifiedGenotyper).</p>

<p><strong>Edit</strong>: For more details regarding the HaplotypeCaller, see <a href="https://software.broadinstitute.org/gatk/documentation/article.php?id=4146" rel="noreferrer">this nice page</a> on GATK's website, which goes into much more detail than I did here.</p>

CC BY-SA 3.0
2017-05-19T19:19:13.093Z
2017-05-19T20:15:11.303Z
2017-05-19T20:15:11.303Z
Devon Ryan
<p>If there are soft clipped base pairs specified in the CIGAR string for a read in a SAM/BAM file, will these be used for variant calling in a <a href="http://www.htslib.org/doc/samtools.html" rel="noreferrer">samtools</a> + <a href="http://www.htslib.org/doc/bcftools.html" rel="noreferrer">bcftools</a> workflow? </p>

<p>The <a href="https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_gatk_tools_walkers_haplotypecaller_HaplotypeCaller.php" rel="noreferrer">GATK HaplotypeCaller</a>, for example, has an explicit option <code>--dontUseSoftClippedBases</code> for whether to use soft clipped bases. The samtools documentation does not mention clipped bases. </p>

<sam><samtools>
Are soft-clipped bases used for variant calling in samtools + bcftools?
# Are soft-clipped bases used for variant calling in samtools + bcftools?

(Asked by: username_0 on 2017-05-19)

If there are soft clipped base pairs specified in the CIGAR string for a read in a SAM/BAM file, will these be used for variant calling in a [samtools](http://www.htslib.org/doc/samtools.html) + [bcftools](http://www.htslib.org/doc/bcftools.html) workflow?

The [GATK HaplotypeCaller](https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_gatk_tools_walkers_haplotypecaller_HaplotypeCaller.php), for example, has an explicit option `--dontUseSoftClippedBases` for whether to use soft clipped bases. The samtools documentation does not mention clipped bases.

**Tags:** sam, samtools

---

## 1 answers

### Answer by username_1 on 2017-05-19. Score: 15 | Accepted answer

No, samtools (and therefore bcftools) does not use soft-clipped bases. You can quickly confirm this by using either `samtools depth` or `samtools mpileup` to look at a region with a soft-clipped alignment. You'll note that the soft-clipped region isn't used in the depth/pileup (both tools use the same underlying code, so it doesn't matter which you use). If you're curious, samtools ignores soft-clipped bases because it's based on making a per-base stack of alignments covering each position. In the BAM format, alignments are sorted and assigned to bins according to their start/end positions, which won't include soft-clipping. Consequently, when samtools is making the pileup it won't even see the alignments that would overlap a given base if soft-clipped bases were included.

This then sort of begs the question of what GATK's HaplotypeCaller is doing differently. There, regions in the genome are essentially assembled in a small de Bruijn graph, which allows for soft-clipped bases around indels to then be resolved, given that the graph would start/end a little-way on past each side of indels. This is also why you don't need to do indel realignment with the HaplotypeCaller (this was needed in the old UnifiedGenotyper).

**Edit**: For more details regarding the HaplotypeCaller, see [this nice page](https://software.broadinstitute.org/gatk/documentation/article.php?id=4146) on GATK's website, which goes into much more detail than I did here.


---

