Variant calling: from alignments to VCF
Variant calling converts aligned reads into hypotheses about differences from the reference. The hard part is not producing a VCF—it’s distinguishing true variants from artifacts (mapping bias, PCR, strand bias, low depth, contamination).
- QC & trim
- Align to reference
- Mark duplicates (if applicable)
- Call variants
- Filter (hard filters or VQSR)
- Annotate + interpret
Example commands (illustrative)
This is a classroom skeleton, not a clinical WGS recipe. Production germline work usually marks duplicates and uses a caller built for that design (GATK HaplotypeCaller, DeepVariant, or bcftools mpileup with an indel-aware model). Check whether DP is INFO or FORMAT before you filter.
# Classroom call (example)
bcftools mpileup -f reference.fa -Ou sample.bam \
| bcftools call -mv -Oz -o sample.vcf.gz
bcftools index sample.vcf.gz
# Filter only after you know which DP field you mean
bcftools filter -e 'INFO/DP<10 || QUAL<30' sample.vcf.gz -Oz -o sample.filtered.vcf.gz
Genotypes in diploid samples are commonly:
0/0homozygous reference0/1heterozygous1/1homozygous alternate./.missing
Key fields
| Field | Meaning |
|---|---|
DP | Total depth |
AD | Allelic depths (REF, ALT…) |
GQ | Genotype quality |
AF | Allele fraction (caller-defined) |
Ti/Tv is a quick plausibility metric (especially for exomes). Strange values can indicate calling issues or contamination.
VAF shapes differ across germline vs somatic experiments, purity, copy number, and filters.
- Low complexity regions, repeats, segmental duplications
- Strand bias (ALT supported mostly on one strand)
- Position bias (ALT mostly at read ends)
- Read-mapping ambiguity (low MAPQ)
- Sample contamination / swaps
- Unexpected ploidy / sex chromosomes
- Tumor purity and subclonality (somatic)
- Batch effects in capture/coverage
A VCF row is easier to judge if you can see the pileup. Open the same POS in a browser after you filter: Reading a genome browser.