bio-gatk-variant-calling
Variant calling with GATK HaplotypeCaller following best practices. Covers germline SNP/indel calling, GVCF workflow for cohorts, joint genotyping, and variant quality score recalibration (VQSR). Use when calling variants with GATK HaplotypeCaller.
Best use case
bio-gatk-variant-calling is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Variant calling with GATK HaplotypeCaller following best practices. Covers germline SNP/indel calling, GVCF workflow for cohorts, joint genotyping, and variant quality score recalibration (VQSR). Use when calling variants with GATK HaplotypeCaller.
Teams using bio-gatk-variant-calling should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/bio-gatk-variant-calling/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How bio-gatk-variant-calling Compares
| Feature / Agent | bio-gatk-variant-calling | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Variant calling with GATK HaplotypeCaller following best practices. Covers germline SNP/indel calling, GVCF workflow for cohorts, joint genotyping, and variant quality score recalibration (VQSR). Use when calling variants with GATK HaplotypeCaller.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
## Version Compatibility
Reference examples tested with: GATK 4.5+, bcftools 1.19+
Before using code patterns, verify installed versions match. If versions differ:
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# GATK Variant Calling
GATK HaplotypeCaller is the gold standard for germline variant calling. This skill covers the GATK Best Practices workflow.
## Prerequisites
BAM files should be preprocessed:
1. Mark duplicates
2. Base quality score recalibration (BQSR) - optional but recommended
## Single-Sample Calling
**Goal:** Call germline SNPs and indels from a single sample using HaplotypeCaller.
**Approach:** Run local de novo assembly of haplotypes in active regions to detect variants with optional annotation enrichment.
**"Call variants from my BAM file using GATK"** → Perform local haplotype assembly and genotyping on aligned reads using HaplotypeCaller.
### Basic HaplotypeCaller
```bash
gatk HaplotypeCaller \
-R reference.fa \
-I sample.bam \
-O sample.vcf.gz
```
### With Standard Annotations
```bash
gatk HaplotypeCaller \
-R reference.fa \
-I sample.bam \
-O sample.vcf.gz \
-A Coverage \
-A QualByDepth \
-A FisherStrand \
-A StrandOddsRatio \
-A MappingQualityRankSumTest \
-A ReadPosRankSumTest
```
### Target Intervals (Exome/Panel)
```bash
gatk HaplotypeCaller \
-R reference.fa \
-I sample.bam \
-L targets.interval_list \
-O sample.vcf.gz
```
### Adjust Calling Confidence
```bash
gatk HaplotypeCaller \
-R reference.fa \
-I sample.bam \
-O sample.vcf.gz \
--standard-min-confidence-threshold-for-calling 20
```
## GVCF Workflow (Recommended for Cohorts)
**Goal:** Enable joint genotyping across a cohort by generating per-sample genomic VCFs.
**Approach:** Call each sample in GVCF mode (-ERC GVCF), combine into a GenomicsDB or merged GVCF, then jointly genotype.
The GVCF workflow enables joint genotyping across samples for better variant calls.
### Step 1: Generate GVCFs per Sample
```bash
gatk HaplotypeCaller \
-R reference.fa \
-I sample.bam \
-O sample.g.vcf.gz \
-ERC GVCF
```
### Step 2: Combine GVCFs (GenomicsDBImport)
```bash
# Create sample map file
# sample_map.txt:
# sample1 /path/to/sample1.g.vcf.gz
# sample2 /path/to/sample2.g.vcf.gz
gatk GenomicsDBImport \
--genomicsdb-workspace-path genomicsdb \
--sample-name-map sample_map.txt \
-L intervals.interval_list
```
### Alternative: CombineGVCFs (smaller cohorts)
```bash
gatk CombineGVCFs \
-R reference.fa \
-V sample1.g.vcf.gz \
-V sample2.g.vcf.gz \
-V sample3.g.vcf.gz \
-O cohort.g.vcf.gz
```
### Step 3: Joint Genotyping
```bash
# From GenomicsDB
gatk GenotypeGVCFs \
-R reference.fa \
-V gendb://genomicsdb \
-O cohort.vcf.gz
# From combined GVCF
gatk GenotypeGVCFs \
-R reference.fa \
-V cohort.g.vcf.gz \
-O cohort.vcf.gz
```
## Variant Quality Score Recalibration (VQSR)
**Goal:** Apply machine learning-based variant filtering using known truth/training sets.
**Approach:** Build a Gaussian mixture model from annotation values at known sites, then apply a sensitivity threshold to classify variants.
Machine learning-based filtering using known variant sites. Requires many variants (WGS preferred).
### SNP Recalibration
```bash
# Build SNP model
gatk VariantRecalibrator \
-R reference.fa \
-V cohort.vcf.gz \
--resource:hapmap,known=false,training=true,truth=true,prior=15.0 hapmap.vcf.gz \
--resource:omni,known=false,training=true,truth=false,prior=12.0 omni.vcf.gz \
--resource:1000G,known=false,training=true,truth=false,prior=10.0 1000G.vcf.gz \
--resource:dbsnp,known=true,training=false,truth=false,prior=2.0 dbsnp.vcf.gz \
-an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR \
-mode SNP \
-O snp.recal \
--tranches-file snp.tranches
# Apply SNP filter
gatk ApplyVQSR \
-R reference.fa \
-V cohort.vcf.gz \
-O cohort.snp_recal.vcf.gz \
--recal-file snp.recal \
--tranches-file snp.tranches \
--truth-sensitivity-filter-level 99.5 \
-mode SNP
```
### Indel Recalibration
```bash
# Build Indel model
gatk VariantRecalibrator \
-R reference.fa \
-V cohort.snp_recal.vcf.gz \
--resource:mills,known=false,training=true,truth=true,prior=12.0 Mills.vcf.gz \
--resource:dbsnp,known=true,training=false,truth=false,prior=2.0 dbsnp.vcf.gz \
-an QD -an MQRankSum -an ReadPosRankSum -an FS -an SOR \
-mode INDEL \
--max-gaussians 4 \
-O indel.recal \
--tranches-file indel.tranches
# Apply Indel filter
gatk ApplyVQSR \
-R reference.fa \
-V cohort.snp_recal.vcf.gz \
-O cohort.vqsr.vcf.gz \
--recal-file indel.recal \
--tranches-file indel.tranches \
--truth-sensitivity-filter-level 99.0 \
-mode INDEL
```
## Hard Filtering (When VQSR Not Suitable)
**Goal:** Apply fixed-threshold filters when the dataset is too small for VQSR.
**Approach:** Separate SNPs and indels, apply GATK-recommended annotation thresholds, then merge results.
For small datasets, exomes, or single samples where VQSR fails.
### Extract SNPs and Indels
```bash
gatk SelectVariants \
-R reference.fa \
-V cohort.vcf.gz \
--select-type-to-include SNP \
-O snps.vcf.gz
gatk SelectVariants \
-R reference.fa \
-V cohort.vcf.gz \
--select-type-to-include INDEL \
-O indels.vcf.gz
```
### Apply Hard Filters
```bash
# Filter SNPs
gatk VariantFiltration \
-R reference.fa \
-V snps.vcf.gz \
-O snps.filtered.vcf.gz \
--filter-expression "QD < 2.0" --filter-name "QD2" \
--filter-expression "FS > 60.0" --filter-name "FS60" \
--filter-expression "MQ < 40.0" --filter-name "MQ40" \
--filter-expression "MQRankSum < -12.5" --filter-name "MQRankSum-12.5" \
--filter-expression "ReadPosRankSum < -8.0" --filter-name "ReadPosRankSum-8" \
--filter-expression "SOR > 3.0" --filter-name "SOR3"
# Filter Indels
gatk VariantFiltration \
-R reference.fa \
-V indels.vcf.gz \
-O indels.filtered.vcf.gz \
--filter-expression "QD < 2.0" --filter-name "QD2" \
--filter-expression "FS > 200.0" --filter-name "FS200" \
--filter-expression "ReadPosRankSum < -20.0" --filter-name "ReadPosRankSum-20" \
--filter-expression "SOR > 10.0" --filter-name "SOR10"
```
### Merge Filtered Variants
```bash
gatk MergeVcfs \
-I snps.filtered.vcf.gz \
-I indels.filtered.vcf.gz \
-O cohort.filtered.vcf.gz
```
## Base Quality Score Recalibration (BQSR)
**Goal:** Correct systematic errors in base quality scores before variant calling.
**Approach:** Model quality score errors at known variant sites with BaseRecalibrator, then apply corrections with ApplyBQSR.
Preprocessing step to correct systematic errors in base quality scores.
### Step 1: BaseRecalibrator
```bash
gatk BaseRecalibrator \
-R reference.fa \
-I sample.bam \
--known-sites dbsnp.vcf.gz \
--known-sites known_indels.vcf.gz \
-O recal_data.table
```
### Step 2: ApplyBQSR
```bash
gatk ApplyBQSR \
-R reference.fa \
-I sample.bam \
--bqsr-recal-file recal_data.table \
-O sample.recal.bam
```
## Parallel Processing
**Goal:** Reduce wall-clock time for variant calling on large datasets.
**Approach:** Scatter by chromosome or interval, run HaplotypeCaller in parallel, then gather results.
### Scatter by Interval
```bash
# Split calling across intervals
for interval in chr{1..22} chrX chrY; do
gatk HaplotypeCaller \
-R reference.fa \
-I sample.bam \
-L $interval \
-O sample.${interval}.g.vcf.gz \
-ERC GVCF &
done
wait
# Gather GVCFs
gatk GatherVcfs \
-I sample.chr1.g.vcf.gz \
-I sample.chr2.g.vcf.gz \
... \
-O sample.g.vcf.gz
```
### Native Pairwise Parallelism
```bash
gatk HaplotypeCaller \
-R reference.fa \
-I sample.bam \
-O sample.vcf.gz \
--native-pair-hmm-threads 4
```
## CNN Score Variant Filter (Deep Learning)
**Goal:** Filter variants using a deep learning model as an alternative to VQSR.
**Approach:** Score variants with CNNScoreVariants using reference context, then filter by tranche sensitivity.
Alternative to VQSR using convolutional neural network.
### Score Variants
```bash
gatk CNNScoreVariants \
-R reference.fa \
-V cohort.vcf.gz \
-O cohort.cnn_scored.vcf.gz \
--tensor-type reference
```
### Filter by CNN Score
```bash
gatk FilterVariantTranches \
-V cohort.cnn_scored.vcf.gz \
-O cohort.cnn_filtered.vcf.gz \
--resource hapmap.vcf.gz \
--resource mills.vcf.gz \
--info-key CNN_1D \
--snp-tranche 99.95 \
--indel-tranche 99.4
```
## Complete Single-Sample Pipeline
**Goal:** Run the full GATK best practices workflow from BQSR through filtered variants.
**Approach:** Chain BaseRecalibrator, ApplyBQSR, HaplotypeCaller (GVCF mode), GenotypeGVCFs, and hard filtering.
```bash
#!/bin/bash
SAMPLE=$1
REF=reference.fa
DBSNP=dbsnp.vcf.gz
KNOWN_INDELS=known_indels.vcf.gz
# BQSR
gatk BaseRecalibrator -R $REF -I ${SAMPLE}.bam \
--known-sites $DBSNP --known-sites $KNOWN_INDELS \
-O ${SAMPLE}.recal.table
gatk ApplyBQSR -R $REF -I ${SAMPLE}.bam \
--bqsr-recal-file ${SAMPLE}.recal.table \
-O ${SAMPLE}.recal.bam
# Call variants
gatk HaplotypeCaller -R $REF -I ${SAMPLE}.recal.bam \
-O ${SAMPLE}.g.vcf.gz -ERC GVCF
# Single-sample genotyping
gatk GenotypeGVCFs -R $REF -V ${SAMPLE}.g.vcf.gz \
-O ${SAMPLE}.vcf.gz
# Hard filter
gatk VariantFiltration -R $REF -V ${SAMPLE}.vcf.gz \
-O ${SAMPLE}.filtered.vcf.gz \
--filter-expression "QD < 2.0" --filter-name "LowQD" \
--filter-expression "FS > 60.0" --filter-name "HighFS" \
--filter-expression "MQ < 40.0" --filter-name "LowMQ"
```
## Key Annotations
| Annotation | Description | Good Values |
|------------|-------------|-------------|
| QD | Quality by Depth | > 2.0 |
| FS | Fisher Strand | < 60 (SNP), < 200 (Indel) |
| SOR | Strand Odds Ratio | < 3 (SNP), < 10 (Indel) |
| MQ | Mapping Quality | > 40 |
| MQRankSum | MQ Rank Sum Test | > -12.5 |
| ReadPosRankSum | Read Position Rank Sum | > -8.0 (SNP), > -20.0 (Indel) |
## Resource Files
| Resource | Use |
|----------|-----|
| dbSNP | Known variants (prior=2.0) |
| HapMap | Training/truth SNPs (prior=15.0) |
| Omni | Training SNPs (prior=12.0) |
| 1000G SNPs | Training SNPs (prior=10.0) |
| Mills Indels | Training/truth indels (prior=12.0) |
## Related Skills
- variant-calling - bcftools alternative
- alignment-files - BAM preprocessing
- filtering-best-practices - Post-calling filtering
- variant-normalization - Normalize before annotation
- vep-snpeff-annotation - Annotate final callsRelated Skills
tooluniverse-variant-interpretation
Systematic clinical variant interpretation from raw variant calls to ACMG-classified recommendations with structural impact analysis. Aggregates evidence from ClinVar, gnomAD, CIViC, UniProt, and PDB across ACMG criteria. Produces pathogenicity scores (0-100), clinical recommendations, and treatment implications. Use when interpreting genetic variants, classifying variants of uncertain significance (VUS), performing ACMG variant classification, or translating variant calls to clinical actionability.
tooluniverse-variant-analysis
Production-ready VCF processing, variant annotation, mutation analysis, and structural variant (SV/CNV) interpretation for bioinformatics questions. Parses VCF files (streaming, large files), classifies mutation types (missense, nonsense, synonymous, frameshift, splice, intronic, intergenic) and structural variants (deletions, duplications, inversions, translocations), applies VAF/depth/quality/consequence filters, annotates with ClinVar/dbSNP/gnomAD/CADD via ToolUniverse, interprets SV/CNV clinical significance using ClinGen dosage sensitivity scores, computes variant statistics, and generates reports. Solves questions like "What fraction of variants with VAF < 0.3 are missense?", "How many non-reference variants remain after filtering intronic/intergenic?", "What is the pathogenicity of this deletion affecting BRCA1?", or "Which dosage-sensitive genes overlap this CNV?". Use when processing VCF files, annotating variants, filtering by VAF/depth/consequence, classifying mutations, interpreting structural variants, assessing CNV pathogenicity, comparing cohorts, or answering variant analysis questions.
tooluniverse-structural-variant-analysis
Comprehensive structural variant (SV) analysis skill for clinical genomics. Classifies SVs (deletions, duplications, inversions, translocations), assesses pathogenicity using ACMG-adapted criteria, evaluates gene disruption and dosage sensitivity, and provides clinical interpretation with evidence grading. Use when analyzing CNVs, large deletions/duplications, chromosomal rearrangements, or any structural variants requiring clinical interpretation.
tooluniverse-cancer-variant-interpretation
Provide comprehensive clinical interpretation of somatic mutations in cancer. Given a gene symbol + variant (e.g., EGFR L858R, BRAF V600E) and optional cancer type, performs multi-database analysis covering clinical evidence (CIViC), mutation prevalence (cBioPortal), therapeutic associations (OpenTargets, ChEMBL, FDA), resistance mechanisms, clinical trials, prognostic impact, and pathway context. Generates an evidence-graded markdown report with actionable recommendations for precision oncology. Use when oncologists, molecular tumor boards, or researchers ask about treatment options for specific cancer mutations, resistance mechanisms, or clinical trial matching.
bio-variant-normalization
Normalize indel representation and split multiallelic variants using bcftools norm. Use when comparing variants from different callers or preparing VCF for downstream analysis.
bio-variant-calling
Call SNPs and indels from aligned reads using bcftools mpileup and call. Use when detecting variants from BAM files or generating VCF from alignments.
bio-variant-calling-structural-variant-calling
Call structural variants (SVs) from short-read sequencing using Manta, Delly, and LUMPY. Detects deletions, insertions, inversions, duplications, and translocations that are too large for standard SNV callers. Use when detecting structural variants from short-read data.
bio-variant-calling-joint-calling
Joint genotype calling across multiple samples using GATK CombineGVCFs and GenotypeGVCFs. Essential for cohort studies, population genetics, and leveraging VQSR. Use when performing joint genotyping across multiple samples.
bio-variant-calling-filtering-best-practices
Comprehensive variant filtering including GATK VQSR, hard filters, bcftools expressions, and quality metric interpretation for SNPs and indels. Use when filtering variants using GATK best practices.
bio-variant-calling-deepvariant
Deep learning-based variant calling with Google DeepVariant. Provides high accuracy for germline SNPs and indels from Illumina, PacBio, and ONT data. Use when calling variants with DeepVariant deep learning caller.
bio-variant-calling-clinical-interpretation
Clinical variant interpretation using ClinVar, ACMG guidelines, and pathogenicity predictors. Prioritize variants for diagnostic and research applications. Use when interpreting clinical significance of variants.
bio-variant-annotation
Comprehensive variant annotation using bcftools annotate/csq, VEP, SnpEff, and ANNOVAR. Add database annotations, predict functional consequences, and assess clinical significance. Use when annotating variants with functional and clinical information.