Chapter 6: Step 4 — Variant Calling: Germline vs. Somatic Architecture
Tested Stacks:
GATK 4.6.1
Samtools 1.21
Nextflow 24.10
Seurat v5.1
Python 3.12
Prerequisites: Basic Linux CLI & Sequencing Formats
📚 Chapter 6 of 10
0% Course Completed
Chapter 6: Step 4 — Variant Calling: Germline vs. Somatic Architecture
Variant calling is the computational stage that evaluates recalibrated aligned reads against the human reference genome to identify non-reference mutations. As highlighted in our masterclass architecture, variant calling bifurcates fundamentally into two distinct biological tracks: Germline Workflow and Somatic Oncology Workflow.
Step 4 Technical Specifications
- Input File: Sorted & Recalibrated BAM/CRAM files.
- Output File: Raw Variant Call Format file (
.vcfor.vcf.gz) with Genotype Likelihoods. - Clinical Utility: Identifies inherited Mendelian mutations (Germline assuming 0/0, 0/1, 1/1 diploid states) or acquired driver mutations in heterogeneous tumors (Somatic evaluating variant allele fractions down to 1%).
The Two Divergent Workflows: Architectural Comparison
| Workflow Type | Sample Input | Biological Assumption | Variant Callers (SNV/InDel) | Variant Callers (CNV/SV) |
|---|---|---|---|---|
| Path A: Germline | Single Normal Sample (Blood / Saliva / Buccal Swab) | Diploid organism (Heterozygous ~50% VAF, Homozygous ~100% VAF) | GATK HaplotypeCaller, Google DeepVariant, FreeBayes | GATK gCNV, CNVkit, DELLY, Manta |
| Path B: Somatic | Matched Tumor-Normal Pair OR Tumor-Only Specimen | Subclonal heterogeneity, aneuploidy, low VAF (1% – 30%), stromal contamination | GATK MuTect2, Strelka2, VarScan2 | FACETS, Control-FREEC, ASCAT, CNVkit |
Path A: Germline Calling with GATK HaplotypeCaller & DeepVariant
GATK HaplotypeCaller avoids the pitfalls of single-column pileup callers by performing local de novo micro-assembly:
- Identifies candidate Active Regions showing signs of non-reference variation.
- Constructs a local de Bruijn graph across the active region to reconstruct candidate haplotypes.
- Evaluates read alignments against haplotypes using a PairHMM (Hidden Markov Model) to calculate likelihood matrices.
- Emits a Genomic VCF (GVCF) containing statistical records for both variant and invariant sites.
# Germline Variant Calling in GVCF Mode (GATK HaplotypeCaller)
gatk HaplotypeCaller -R GRCh38.primary_assembly.fa -I patient_recalibrated.bam -O patient_germline.g.vcf.gz -ERC GVCF
# Genotype GVCF to produce standard multi-sample or single-sample VCF
gatk GenotypeGVCFs -R GRCh38.primary_assembly.fa -V patient_germline.g.vcf.gz -O patient_germline.raw.vcf.gzPath B: Somatic Oncology Calling with GATK MuTect2
Somatic calling differs fundamentally because tumor samples are mixtures of malignant clones, normal stromal cells, and immune infiltrates. A critical driver mutation (e.g. PIK3CA H1047R) may be present at only 3% Variant Allele Frequency (VAF).
# Somatic Variant Calling with Matched Tumor-Normal Pair (GATK MuTect2)
gatk Mutect2 -R GRCh38.primary_assembly.fa -I tumor_recalibrated.bam -I normal_recalibrated.bam -normal NORMAL_SAMPLE_NAME --germline-resource af-only-gnomad.hg38.vcf.gz --panel-of-normals pon_1000g_hg38.vcf.gz -O somatic_raw.vcf.gz
# Filter Somatic Calls for Cross-Sample Contamination and Orientation Bias
gatk FilterMutectCalls -R GRCh38.primary_assembly.fa -V somatic_raw.vcf.gz -O somatic_filtered.vcf.gz
⚠️
Common Pitfalls & Troubleshooting Checklist
- Java Heap Exhaustion (GATK / Picard): If processes terminate with
java.lang.OutOfMemoryError, set your environment variable explicitly:export _JAVA_OPTIONS="-Xmx16g -Djava.io.tmpdir=/tmp". - Index Timestamp Mismatch: If tools complain that a BAM index is missing or out of date, regenerate with
samtools index -@ 4 sample.bam. - Conda Channel Conflicts: Avoid ABI incompatibilities between bioconda and conda-forge by setting strict priority:
conda config --set channel_priority strict. - Chromosome Naming Contamination: Always verify whether reference FASTA headers use
chr1or1; divergent naming causes silent alignment drops.
Was this guide helpful to your research?
Help us maintain 100% accurate, peer-reviewed bioinformatics standards.