Skip to content

Calling Variants From Your Own Whole-Genome Data With GATK

Oak
A long fallen tree trunk in a glowing night forest, studded with small colored lights, with a slender creature picking some off.

By the end of this guide you will have a single-sample germline VCF for your own genome: roughly 4 to 5 million variants against GRCh38, of which about 3.5 million are single-nucleotide variants and 600,000 to 800,000 are small insertions and deletions. You will also have the intermediate files worth keeping. These are a duplicate-marked and base-recalibrated CRAM, a per-sample GVCF, and a set of quality metrics that tell you whether the call set is usable. You need the raw data as paired FASTQ or an unaligned CRAM from your sequencing provider. You also need about 500 GB of free disk and 32 GB of RAM. Budget 16 cores if you want this to finish overnight rather than over a weekend. Software: GATK 4.5 or later, samtools, and bcftools. You also need either BWA-MEM2 or DRAGMAP. Everything below assumes a 30x short-read human genome, the case that matters for a personal profile.

A note on scope before the commands. This guide covers measurement and quality control. A VCF is a list of differences between your reads and a reference sequence, and nothing in it is a clinical result. Interpretation of a specific variant in a specific gene belongs with a clinical geneticist or genetic counselor working from a validated assay.

1. Get the reference bundle right

Almost every reproducibility problem in variant calling traces back to the reference. Use the GATK GRCh38 resource bundle rather than assembling your own reference, because the training resources for recalibration and filtering are keyed to those exact contig names and coordinates.

# GATK resource bundle (gs://genomics-public-data/resources/broad/hg38/v0/)
gsutil -m cp \
  gs://genomics-public-data/resources/broad/hg38/v0/Homo_sapiens_assembly38.fasta* \
  gs://genomics-public-data/resources/broad/hg38/v0/Homo_sapiens_assembly38.dict \
  gs://genomics-public-data/resources/broad/hg38/v0/Homo_sapiens_assembly38.dbsnp138.vcf* \
  gs://genomics-public-data/resources/broad/hg38/v0/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz* \
  gs://genomics-public-data/resources/broad/hg38/v0/hapmap_3.3.hg38.vcf.gz* \
  gs://genomics-public-data/resources/broad/hg38/v0/1000G_omni2.5.hg38.vcf.gz* \
  gs://genomics-public-data/resources/broad/hg38/v0/1000G_phase1.snps.high_confidence.hg38.vcf.gz* \
  ./ref/

We recommend the analysis set reference that includes alternate haplotypes and decoy contigs. The decoys absorb reads from sequences absent in the primary assembly, which reduces false positives in the regions those reads would otherwise pile into. If your aligner is not ALT-aware, use the no-ALT analysis set instead. Mixing an ALT-containing reference with a non-ALT-aware aligner inflates multi-mapping and depresses mapping quality across segmental duplications.

2. Align, or realign from the provider’s CRAM

If you received FASTQs, align with BWA-MEM2. The read group line matters more than it looks: GATK uses the sample (SM), library (LB), and platform unit (PU) fields to group reads for duplicate marking and base recalibration.

bwa-mem2 mem -t 16 -K 100000000 -Y \
  -R '@RG\tID:WOOLF1.L001\tSM:sample1\tLB:lib1\tPL:ILLUMINA\tPU:WOOLF1.L001.NNNNN' \
  ref/Homo_sapiens_assembly38.fasta \
  sample1_R1.fastq.gz sample1_R2.fastq.gz \
| samtools sort -@ 4 -m 2G -o sample1.sorted.bam -

The -K 100000000 flag fixes the batch size so output is deterministic regardless of thread count. The -Y flag uses soft clipping for supplementary alignments, which keeps the full read sequence available downstream.

If your provider gave you an aligned CRAM against a reference you do not control, revert it rather than trusting it. GATK RevertSam followed by SamToFastq returns you to unaligned reads with the original base qualities and read groups intact. The extra six hours of compute buys you a pipeline you can rerun and audit.

3. Mark duplicates and recalibrate base qualities

PCR and optical duplicates inflate apparent depth at a locus without adding independent evidence. Marking them prevents a single amplified fragment from looking like ten supporting reads.

gatk --java-options "-Xmx16g" MarkDuplicates \
  -I sample1.sorted.bam \
  -O sample1.markdup.bam \
  -M sample1.markdup.metrics.txt \
  --OPTICAL_DUPLICATE_PIXEL_DISTANCE 2500 \
  --CREATE_INDEX true

Use 2500 for patterned flowcells (NovaSeq, HiSeq X) and 100 for older unpatterned ones. Read the duplicate fraction out of the metrics file. For a PCR-free 30x library it should be under 10 percent, and often near 3 percent. A figure above 20 percent means the library was over-amplified and your effective depth is lower than the nominal 30x.

Base quality score recalibration then corrects systematic error in the sequencer’s own quality estimates. It builds an empirical model of observed mismatch rate as a function of reported quality, machine cycle, and dinucleotide context. It needs a set of known sites to mask out real variation.

gatk --java-options "-Xmx16g" BaseRecalibrator \
  -R ref/Homo_sapiens_assembly38.fasta \
  -I sample1.markdup.bam \
  --known-sites ref/Homo_sapiens_assembly38.dbsnp138.vcf \
  --known-sites ref/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz \
  -O sample1.recal.table

gatk --java-options "-Xmx16g" ApplyBQSR \
  -R ref/Homo_sapiens_assembly38.fasta \
  -I sample1.markdup.bam \
  --bqsr-recal-file sample1.recal.table \
  -O sample1.bqsr.cram

BQSR matters less on modern instruments than it did on the HiSeq 2000, since the raw qualities are better calibrated to begin with. We still run it, because it costs about an hour and it removes a known source of context-dependent false positives in homopolymers. Write the output as CRAM with the reference on hand. A 30x CRAM is roughly 15 to 20 GB against 80 to 100 GB for the equivalent BAM.

4. Call variants with HaplotypeCaller in GVCF mode

HaplotypeCaller does local de novo assembly. For each active region it builds a De Bruijn graph from the reads and extracts candidate haplotypes. It then realigns reads against them with a pair hidden Markov model and genotypes the alleles. This is why it handles indels and clustered substitutions better than a pileup-based caller.

Run it in GVCF mode even for a single sample. A GVCF records a genotype likelihood for every position, including reference-matching blocks, so you can distinguish “confidently homozygous reference” from “no data here”. That distinction is the whole reason the format exists, and it also lets you fold in a future sample without recalling this one.

# Scatter across intervals for speed; one job per chromosome is a reasonable unit.
for chr in $(seq 1 22) X Y; do
  gatk --java-options "-Xmx6g" HaplotypeCaller \
    -R ref/Homo_sapiens_assembly38.fasta \
    -I sample1.bqsr.cram \
    -L chr${chr} \
    -O gvcf/sample1.chr${chr}.g.vcf.gz \
    -ERC GVCF \
    -G StandardAnnotation -G StandardHCAnnotation -G AS_StandardAnnotation \
    --native-pair-hmm-threads 4 &
done
wait

gatk MergeVcfs $(for f in gvcf/sample1.chr*.g.vcf.gz; do echo -n "-I $f "; done) \
  -O sample1.g.vcf.gz

Single-threaded HaplotypeCaller on a 30x genome takes around 20 to 30 hours. Scattered across 24 chromosome-level jobs it finishes in two to three. The pair-HMM is the hot loop, so give it threads and make sure GATK picked up the vectorized AVX implementation. Check the log for a line about the FPGA or AVX-accelerated PairHMM. If it reports the pure Java fallback, you are running five to ten times slower than necessary.

Request allele-specific annotations (AS_StandardAnnotation) now even if you do not use them yet. The annotations cannot be recovered later without recalling, and they make multi-allelic filtering meaningfully more accurate.

5. Genotype the GVCF

Convert genotype likelihoods into called genotypes with GenotypeGVCFs. For one sample this is a formality, but keep it as a distinct step so the pipeline generalizes to a cohort.

gatk --java-options "-Xmx16g" GenotypeGVCFs \
  -R ref/Homo_sapiens_assembly38.fasta \
  -V sample1.g.vcf.gz \
  -O sample1.raw.vcf.gz \
  -G StandardAnnotation -G AS_StandardAnnotation \
  --use-new-qual-calculator true

For larger cohorts you would import GVCFs into a GenomicsDBImport workspace first. Configuration-driven frameworks exist to manage that orchestration at cohort scale, along with the per-step parameter tracking it demands 1. For one genome, a shell script you can read in a single screen is the better engineering choice.

6. Filter: VQSR for SNVs, hard filters as the fallback

Raw calls contain a large fraction of artifacts, so filtering is where call-set quality is won or lost. Variant Quality Score Recalibration (VQSR) fits a Gaussian mixture model to the annotation profile of known true variants and uses it to score every call. It needs enough variants to fit the model, which a single whole genome provides for SNVs but generally not for indels.

gatk --java-options "-Xmx16g" VariantRecalibrator \
  -R ref/Homo_sapiens_assembly38.fasta \
  -V sample1.raw.vcf.gz \
  --resource:hapmap,known=false,training=true,truth=true,prior=15.0 ref/hapmap_3.3.hg38.vcf.gz \
  --resource:omni,known=false,training=true,truth=false,prior=12.0 ref/1000G_omni2.5.hg38.vcf.gz \
  --resource:1000G,known=false,training=true,truth=false,prior=10.0 ref/1000G_phase1.snps.high_confidence.hg38.vcf.gz \
  --resource:dbsnp,known=true,training=false,truth=false,prior=2.0 ref/Homo_sapiens_assembly38.dbsnp138.vcf \
  -an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR -an DP \
  -mode SNP \
  --max-gaussians 6 \
  -O sample1.snp.recal -tranches-file sample1.snp.tranches

gatk ApplyVQSR \
  -R ref/Homo_sapiens_assembly38.fasta \
  -V sample1.raw.vcf.gz \
  --recal-file sample1.snp.recal --tranches-file sample1.snp.tranches \
  -mode SNP --truth-sensitivity-filter-level 99.7 \
  -O sample1.snp.vqsr.vcf.gz

The 99.7 truth-sensitivity tranche is the standard whole-genome setting: it retains 99.7 percent of HapMap true positives at the cost of admitting more false positives than a stricter 99.0 cut. Choose according to what you will do with the data. For discovery and population comparison, take the sensitive tranche. For examining one gene closely, use 99.0 and inspect the remaining calls by eye in IGV.

For indels, and for SNVs if VQSR fails to converge, use hard filters. These are the thresholds from the GATK best-practices documentation, and they encode specific artifact signatures. They cover strand bias with FS and SOR, depth-normalized quality with QD, and position bias within reads with ReadPosRankSum 2.

gatk VariantFiltration \
  -V sample1.raw.vcf.gz \
  --filter-name "QD2"    --filter-expression "QD < 2.0" \
  --filter-name "FS200"  --filter-expression "FS > 200.0" \
  --filter-name "RPRS20" --filter-expression "ReadPosRankSum < -20.0" \
  --select-type-to-include INDEL \
  -O sample1.indel.hardfilter.vcf.gz

Whichever route you take, filtering thresholds are a choice about the precision-recall tradeoff, and that choice should follow from your intended use. Comparisons across GATK, and other callers show substantial disagreement in the tails, with concordance well below 100 percent even between well-tuned pipelines on the same reads 3.

7. Verify the call set before you trust it

Never hand off a VCF you have not sanity-checked. Four numbers catch most of the ways a run goes wrong.

bcftools stats sample1.filtered.vcf.gz > sample1.stats.txt
gatk CollectVariantCallingMetrics \
  -I sample1.filtered.vcf.gz \
  --DBSNP ref/Homo_sapiens_assembly38.dbsnp138.vcf \
  -O sample1.callmetrics

Check the total variant count, which is 4 to 5 million for a 30x genome of any ancestry and higher for African ancestry. The SNV transition-to-transversion ratio should be about 2.0 to 2.1 genome-wide, since above 2.3 or below 1.8 signals a filtering or contamination problem. The heterozygous-to-homozygous-alternate ratio should be roughly 1.5 to 2.0, and dbSNP concordance should be above 98 percent for SNVs. Also run GATK CalculateContamination or VerifyBamID. Contamination above one percent shows up as excess heterozygosity and quietly corrupts every downstream genotype.

If you have benchmark data, evaluate against a truth set with hap.py or RTG vcfeval restricted to the Genome in a Bottle high-confidence regions. That gives you real precision and recall figures rather than proxies. The relationship between depth and sensitivity is not linear. Low-depth genomes still recover a large fraction of common variants while losing sensitivity for rare and structurally complex ones, which is why depth is a design parameter and not just a cost line 4.

Common problems

HaplotypeCaller is unexpectedly slow. Check the log for the PairHMM implementation. The Java fallback runs when the AVX-accelerated native library fails to load, usually because of a glibc mismatch in a container. Also confirm you scattered by interval. Threading inside a single HaplotypeCaller process only accelerates the pair-HMM. Region traversal does not get faster.

VQSR throws “no data found” or produces a degenerate model. The Gaussian mixture failed to fit. Lower --max-gaussians to 4, then to 2, and drop DP from the annotation list if you are working with exome or targeted data where depth varies by design. If it still fails, switch to hard filters. A hard-filtered call set is better than a VQSR model fit to insufficient data.

Variant counts far outside the expected range. Counts near 3 million usually mean an over-aggressive filter or a reference mismatch. Counts above 6 million point to contamination or an unmarked duplicate problem. Verify the reference MD5 matches the one used for alignment, and read the duplicate metrics again.

Indels look wrong in homopolymers and short tandem repeats. This is expected. Short reads spanning a 15-base poly-A tract give ambiguous alignments, and left-alignment conventions differ between tools. Normalize with bcftools norm -f ref.fasta -m -any before any comparison, and treat repeat-region indels as low-confidence unless confirmed by a different technology.

Genotypes disagree with a consumer array or another pipeline. Some disagreement is normal and is a property of the methods. It does not mean yours has a bug. Independent callers on identical reads produce call sets that overlap incompletely, with the differences concentrated in low-complexity and low-depth regions 3. Resolve specific discordant sites by loading the CRAM in IGV and looking at the reads. If a site has clinical significance for you, it needs confirmation in an accredited laboratory and discussion with a clinical geneticist. A research-grade pipeline, however carefully run, is not a diagnostic test.

Footnotes

  1. Manuel Rueda, Dietmar Fernandez-Orth, Ivo G Gut. CBIcall: a configuration-driven framework for variant calling in large sequencing cohorts. Bioinformatics Advances, 2026. https://doi.org/10.1093/bioadv/vbag232 ↩

  2. Peter N. Robinson, Rosario M. Piro, Marten Jäger. Variant Calling and Quality-Based Filtering. Computational Exome and Genome Analysis, 2017. https://doi.org/10.1201/9781315154770-12 ↩

  3. Anna Supernat, Oskar Valdimar Vidarsson, Vidar M. Steen, et al. Comparison of three variant callers for human whole genome sequencing. Scientific Reports, 2018. https://doi.org/10.1038/s41598-018-36177-7 ↩ ↩2

  4. Sun Young Joo, Iyosaphit Endrias Essay, Seung Hyun Jang, et al. Low-depth whole genome sequencing as a complementary approach for detecting clinically relevant variants in hearing loss. Scientific Reports, 2026. https://doi.org/10.1038/s41598-026-67227-0 ↩

Pothos builds longitudinal molecular profiles of individuals: whole-genome sequencing, single-cell RNA sequencing, and plasma proteomics, delivered as a detailed report, every data file, and stored cells. Build your profile.