Skip to content
Tech Interview Prep
Technical interview guide

Variant Calling & Genomic File Formats

The FASTQ-to-VCF pipeline: how raw reads become a filtered list of called variants, and the file formats each stage produces.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: VCF 4.5 / BCF 2.2, SAM/BAM and CRAM 3.1 specifications; current GATK, bcftools, samtools, GIAB, vcfeval and GA4GH VRS guidance reviewed 2026-09-04.

Overview

Curated: · Written: · Reviewed:

Variant Calling & Genomic File Formats

In one line

The FASTQ-to-VCF pipeline turns noisy reads into a filtered list of called variants, and each stage's file format carries a specific claim: base quality, alignment placement, or a genotype hypothesis. Reach for it when asked whether a call is real, why two callsets disagree, or how to make a pipeline reproducible.

Key definitions

  • Base quality (Phred+33): estimated probability that a called base is wrong, encoded on a log scale; a Q20 asserts about a 1% chance that this base call is an error.
  • MAPQ: confidence that a read is placed at the correct locus, aligner-specific; separate from base quality.
  • GT / AD / DP / GQ: genotype, allelic depths (evidence), total depth, and genotype quality (confidence in the chosen genotype versus the next best).
  • QUAL: phred-scaled probability that the site is not variant; not genotype confidence.
  • FILTER: PASS means this file's declared filters passed; a dot means filters were not applied. Never coerce dot to PASS.
  • gVCF reference block (END): records that a sample was observed and looked reference-like across a span, distinguishing reference from missing data.

Formulas and complexity

Phred scaling, used for base quality, QUAL and GQ:

Q=−10log⁡10(Perror)Q = -10\log_{10}(P_{\text{error}})

So Q20 is $P_{\text{error}} = 0.01$ and QUAL 842.7 is about $10^{-84}$ probability the site is non-variant.

Precision and recall, scored only inside the confident regions:

precision=TPTP+FP,recall=TPTP+FN\text{precision} = \frac{TP}{TP+FP}, \qquad \text{recall} = \frac{TP}{TP+FN}

These are not reciprocals of each other.

How it works

FASTQ carries reads with per-base error estimates. BAM/CRAM records where each read was placed (CIGAR, MAPQ, read group). The caller assembles local haplotypes in active regions, computes genotype likelihoods over the haplotype graph, and emits a VCF record. Filters then turn the raw callset into a deliverable without erasing raw evidence.

FASTQ: bases + Phred quality Align: BAM/CRAM with CIGAR and MAPQ Duplicate marking and BQSR Active regions: local haplotype assembly Genotype likelihoods: GT, AD, PL, GQ Raw VCF Normalize against pinned reference Filter and benchmark in confident regions

When to use and when not to

ChoiceUse whenAvoid when
Hard filtersThresholds were validated on this assay and cohortAssay or cohort shifted; thresholds do not transfer
VQSR-style recalibrationLarge cohort with good truth and training resourcesSmall cohort, new assay, or rare variant classes
Blind duplicate removalStandard WGS with unique fragmentsAmplicon, high-depth or single-cell data, where apparent duplicates are real molecules
Matched normal and purity modelSomatic calling in tumorsGermline diploid assumptions
CRAM with external referenceArchive where the exact reference is retained with checksum and URIReference may be deleted or not recorded

Traps interviewers probe

  • Treating PASS as truth. PASS only means this workflow's declared filters passed. Fix: state the filter set and the benchmark scope.
  • Reading QUAL as genotype confidence. Fix: QUAL is about the site; use GQ for the selected genotype.
  • Off-by-one on coordinates. VCF POS is 1-based; BAM and BED are 0-based half-open. Fix: convert explicitly, and check with a deletion whose REF includes an anchor base.
  • Merging callsets on CHROM and POS. Fix: verify REF against the destination reference, normalize, then compare haplotypes inside confident regions.
  • Calling low allele fraction an artifact by rule. Fix: decide with the ploidy model, mixture, matched normal and purity.
  • Mishandling multiallelic splits. Fix: remap GT indexes and subset AD and PL per allele, then regression-test the round trip.

Interview tips

Open by stating the claim the file makes and the assumptions behind it: reference build, aligner, ploidy and filter set. Then trace the call back through sequencing, alignment and calling.

Expect these follow-ups: how you verify the reference (checksums, contig dictionary, REF validation); how you separate artifact from a low-fraction variant (AD, MQ, matched normal, purity); how you merge two callsets; how you benchmark (scope, stratification, discordant review); and how the run is reproducible (inputs, versions, parameters, checksums).

30-second outline: "The VCF record is a summary of a chain of inferences: base quality, then placement, then genotype likelihood. I'd first confirm the reference and the filter set, then check the evidence in AD, MQ and GQ, and only then trust the PASS label. For reproducibility I'd store inputs, checksums, versions and raw calls so the call can be rebuilt."

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.