Skip to main content
Docker Image: quay.io/biocontainers/bcftools:1.20 + samtools:1.20
BCFtools is the variant calling component of the SAMtools/HTSlib ecosystem, maintained by the Wellcome Sanger Institute. It uses a classic pileup-based approach: for each genomic position, it stacks up all the reads, computes genotype likelihoods from the base and mapping qualities, then applies a Bayesian caller to determine genotypes. BCFtools is fast, lightweight, and well-suited for straightforward variant calling. Its two-stage pipeline (mpileup → call) gives miners independent control over the data preparation (mpileup) and genotyping (call) stages.

How It Works

The pipeline runs three stages:

1. bcftools mpileup

Reads the BAM file and constructs a pileup at each genomic position. For each position, it computes:
  • Base Alignment Quality (BAQ): Probabilistic realignment that adjusts base qualities near indels to reduce false SNP calls caused by misalignment
  • Genotype likelihoods: Based on base qualities, mapping qualities, and an indel error model
  • Indel candidates: Using a gap-aware model with configurable open/extension penalties
The mpileup stage outputs genotype likelihoods in BCF format.

2. bcftools call

Takes genotype likelihoods from mpileup and applies a caller model:
  • Multiallelic caller (-m): Uses a constrained likelihood framework that considers all alleles simultaneously. Controlled by the prior parameter (mutation rate). The BCFtools documentation recommends this as the standard caller.
  • Consensus caller (-c): Uses a simple consensus approach controlled by pval_threshold.

3. bcftools norm

Normalizes variants: left-aligns indels, splits multi-allelic sites, and ensures VCF consistency.

Hyperparameters

Base/Mapping Quality (mpileup)

Depth Limits (mpileup)

BAQ — Base Alignment Quality (mpileup)

BAQ is a probabilistic realignment technique that adjusts base qualities near indels. It’s one of BCFtools’ key innovations for reducing false SNPs caused by indel-related misalignment.

Indel Calling (mpileup)

These parameters control the indel error model in mpileup and directly affect indel calling behavior.

Read Filtering (mpileup)

Caller Mode (call)

Genotyping (call)

The pval_threshold parameter only applies when using the consensus caller (-c). It has no effect when using the multiallelic caller (-m), which is the default and recommended mode.