6.4.10Bioinformatics & Computational Biology

Describe variant calling pipelines

2,096 words10 min readdifficulty · medium

WHAT is variant calling?


HOW: the pipeline stages

Figure — Describe variant calling pipelines

The canonical DNA-seq pipeline flows: Raw reads → QC/trim → Align → Post-process → Call → Filter → Annotate.

1. Quality control & trimming

  • WHY: Sequencers append a per-base Phred quality score. Low-quality ends and adapter contamination create false variants downstream.
  • HOW: Assess quality with a QC-reporting tool (FastQC — it only produces reports, it does not trim). Then trim adapters and low-quality bases with dedicated trimming tools (Trimmomatic, fastp).

2. Alignment (mapping)

  • WHY: We must know where each read came from before we can compare it to the reference.
  • HOW: Align reads to the reference with a Burrows–Wheeler-based aligner (BWA-MEM, Bowtie2). Output = SAM/BAM file. Each read gets a MAPQ mapping-quality score (same Phred logic: probability the read is mis-placed).

3. Post-alignment processing

  • Sort & index BAM by coordinate.
  • Mark duplicates — WHY: PCR/optical duplicates are copies of the same original molecule; counting them as independent evidence fakes support for a variant. We flag them so they count once.
  • Base Quality Score Recalibration (BQSR) — WHY: sequencers systematically mis-estimate QQ; recalibration corrects the numbers so the probability model is honest.

4. Variant calling proper — the Bayesian core

Output = a VCF (Variant Call Format) file: one line per variant with CHROM, POS, REF, ALT, QUAL, and per-sample genotypes.

5. Filtering

  • WHY: Even good callers make errors. Remove variants with low QUAL, low depth (DP), strand bias, etc. (Hard filters or GATK's VQSR machine-learning recalibration.)

6. Annotation

  • WHY: A position is meaningless until you know what gene/effect it hits.
  • HOW: Tools like ANNOVAR, VEP, SnpEff label variants (missense, nonsense, synonymous, coding vs intron), and cross-reference dbSNP, ClinVar, gnomAD.

Worked examples


Common mistakes


Recall Feynman: explain to a 12-year-old

You copied a huge book by tearing it into confetti and scanning each piece. To find typos, you first figure out where each scrap belongs in the original book (alignment). Then, at every spot, you look at all the scraps covering it. If most scraps agree the letter changed, it's a real typo (variant). If only one weird scrap disagrees, it's probably a smudge (sequencing error). You even throw away scraps that are just Xerox-copies of the same page so you don't get fooled into thinking a smudge is real. That's variant calling!


Flashcards

What does variant calling identify?
Positions where a sample's genome differs from the reference genome, classified as SNVs, indels, or structural variants.
Define the Phred score formula and its inverse.
Q=10log10PQ=-10\log_{10}P and P=10Q/10P=10^{-Q/10}, where P is the base-call error probability.
What error probability corresponds to Q30?
103=0.00110^{-3}=0.001 (1 in 1000).
Does FastQC perform trimming?
No — FastQC only generates quality-control reports; trimming is done by tools like Trimmomatic or fastp.
What is the standard output file of alignment?
SAM/BAM (BAM = binary compressed SAM).
What is MAPQ?
Mapping quality: Phred-scaled probability that a read is aligned to the wrong location.
Why mark PCR duplicates before calling?
Duplicates are copies of the same original molecule; treating them as independent evidence violates the independence assumption in the genotype likelihood product and inflates false confidence.
State Bayes' theorem for genotype calling.
P(GD)=P(DG)P(G)/P(D)P(G\mid D)=P(D\mid G)P(G)/P(D); choose G maximizing the posterior.
Why is P(DG)P(D\mid G) a product over reads?
Reads are assumed independent, so joint probability = product of per-read probabilities.
Under a heterozygote AG, what is P(read shows A)?
12(1ϵ)+12(ϵ/3)0.499670.5\tfrac12(1-\epsilon)+\tfrac12(\epsilon/3)\approx 0.49967\approx 0.5, where ϵ\epsilon is the base error probability.
What file format stores called variants?
VCF (Variant Call Format).
What does BQSR correct?
Systematic miscalibration of base quality scores by the sequencer.
Name the ordered pipeline stages.
QC/trim → Align → Post-process (sort, mark duplicates, BQSR) → Call → Filter → Annotate.
Why annotate variants?
To assign biological meaning (gene, effect: missense/nonsense/synonymous) and cross-reference databases like dbSNP/ClinVar/gnomAD.

Connections

Concept Map

assessed by

uses

feeds

compares to

produces

includes

prevents fake evidence

feeds

signal vs noise

trusted variants

scores mapping MAPQ

Raw reads

QC and trim

Align to reference

Post-process BAM

Variant calling

Filter

Annotate

Reference genome

Phred quality Q

Mark duplicates

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Socho tumne ek reference genome ki ek "asli book" maan li, aur sequencer ne tumhare sample ko crore chote tukdo (reads) me tod diya. Variant calling ka matlab hai: har read ko wapas sahi jagah pe rakho (alignment), aur phir dekho ki kahan tumhara genome reference se alag hai — koi single base badla (SNP), koi chota insertion/deletion (indel), ya bada structural change. Yeh sirf "difference dhundhna" nahi hai; asli sawal hai — yeh difference real hai ya sequencing machine ki galti (noise)?

Isko solve karne ke liye hum probability use karte hain. Har base call ke saath ek Phred score QQ aata hai, jahan Q=10log10PQ=-10\log_{10}P; yaani Q30Q30 ka matlab error probability 0.0010.001, yaani accha base. Ek position pe agar 10 reads me se 5 'A' aur 5 'G' dikha rahe hain, to hum Bayes theorem se compute karte hain: P(genotypedata)P(datagenotype)×P(genotype)P(genotype|data) \propto P(data|genotype)\times P(genotype). Jo genotype (AA, AG, GG) sabse zyada probable ho wahi call karte hain. Isliye 5-5 wale case me AG heterozygous winner hota hai.

Ek chhoti si baat yaad rakho: QC step me FastQC sirf report banata hai (quality dikhata hai), trimming nahi karta — trimming ke liye Trimmomatic ya fastp use hote hain. Aur ek important trap: PCR duplicates. Agar 50 reads asal me ek hi molecule ki copies hain, to woh independent evidence nahi hain — isliye "mark duplicates" step lagta hai, taki fake confidence na aaye. Pipeline ke end me filtering aur annotation zaroori hai, kyunki VCF me jo variant hai woh sirf candidate hai, guaranteed sach nahi. Yeh pipeline medical genomics, cancer mutation detection, aur rare disease diagnosis me backbone hai — isliye ise samajhna high-yield hai.

Test yourself — Bioinformatics & Computational Biology

Connections