Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Impute missing genotypes using reference panels with Beagle or Minimac4. Use when increasing variant density for GWAS, harmonizing data across genotyping platforms, or inferring variants not directly typed in array data.
.claude/skills/bio-phasing-imputation-genotype-imputation/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 118% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 35% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 71% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 56% | 0% |
<!--
#
#
-->
bash# Basic imputation java -jar beagle.jar \ gt=study.vcf.gz \ ref=reference_panel.vcf.gz \ map=genetic_map.txt \ out=imputed # Output: imputed.vcf.gz with imputed genotypes
bashjava -Xmx32g -jar beagle.jar \ gt=study.vcf.gz \ ref=reference_panel.vcf.gz \ map=genetic_map.txt \ out=imputed \ nthreads=8 \ gp=true \ # Output genotype probabilities ap=true \ # Output allele probabilities impute=true \ # Perform imputation (default) ne=20000 # Effective population size
bashfor chr in {1..22}; do java -Xmx32g -jar beagle.jar \ gt=study.chr${chr}.vcf.gz \ ref=ref.chr${chr}.vcf.gz \ map=genetic_maps/plink.chr${chr}.GRCh38.map \ out=imputed.chr${chr} \ gp=true \ nthreads=8 done # Concatenate bcftools concat imputed.chr*.vcf.gz -Oz -o imputed.all.vcf.gz bcftools index imputed.all.vcf.gz
bash# Newer IMPUTE software impute5 \ --h reference.bcf \ --m genetic_map.txt \ --g study.vcf.gz \ --r chr22 \ --o imputed.chr22.vcf.gz \ --threads 8
bash# Often used via web server, but can run locally minimac4 \ --refHaps reference.m3vcf.gz \ --haps study.vcf.gz \ --prefix imputed \ --format GT,DS,GP \ --cpus 8
bash# 1. Align to reference (strand, allele order) bcftools +fixref study.vcf.gz -Oz -o fixed.vcf.gz -- \ -f reference.fa -m flip # 2. Filter to sites in reference bcftools isec -n=2 -w1 fixed.vcf.gz reference_sites.vcf.gz \ -Oz -o study_overlap.vcf.gz # 3. Phase first (if not already phased) java -jar beagle.jar gt=study_overlap.vcf.gz out=phased # 4. Then impute java -jar beagle.jar gt=phased.vcf.gz ref=reference.vcf.gz out=imputed
bash# INFO/DR2 or INFO/R2 contains imputation quality bcftools query -f '%CHROM\t%POS\t%ID\t%INFO/DR2\n' imputed.vcf.gz > info_scores.txt # Filter by quality bcftools view -i 'INFO/DR2 > 0.3' imputed.vcf.gz -Oz -o imputed_filtered.vcf.gz
| Format | Field | Description | |--------|-------|-------------| | GT | 0\|0, 0\|1, 1\|1 | Hard-called genotype | | DS | 0.0-2.0 | Dosage (expected ALT allele count) | | GP | 0.0-1.0,0.0-1.0,0.0-1.0 | Genotype probabilities (AA,AB,BB) | | DR2/R2 | 0.0-1.0 | Imputation quality score |
pythonimport pandas as pd # Extract dosages # bcftools query -f '%CHROM\t%POS\t%ID[\t%DS]\n' imputed.vcf.gz > dosages.txt dosages = pd.read_csv('dosages.txt', sep='\t') # Dosage-based association (treats uncertainty) # Use --dosage in PLINK2 or similar
bash# PLINK2 with dosages plink2 --vcf imputed.vcf.gz dosage=DS \ --glm \ --pheno phenotypes.txt \ --out gwas_results
| Analysis | Minimum INFO/R2 | |----------|-----------------| | GWAS discovery | 0.3 | | GWAS fine-mapping | 0.8 | | Meta-analysis | 0.5 | | Polygenic scores | 0.9 |
| Parameter | Beagle | Description | |-----------|--------|-------------| | gt | input VCF | Study genotypes | | ref | reference VCF | Reference panel | | map | genetic map | Recombination map | | gp | true/false | Output genotype probs | | ne | 20000 | Effective population size | | nthreads | N | CPU threads | | window | 40 | Window size (cM) |
For large-scale imputation, consider web-based servers:
bash# Prepare input for server # Most require VCF.GZ per chromosome for chr in {1..22}; do bcftools view -r chr${chr} study.vcf.gz -Oz -o study.chr${chr}.vcf.gz done
<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-21 | pass→pass | 6,464 | 3,716 | -43% | 1 | 1 | 0% | 1,056 | 2,309 | +119% | 0 | 0 | — |
case-20 | pass→pass | 6,450 | 5,946 | -8% | 1 | 1 | 0% | 1,257 | 2,706 | +115% | 0 | 0 | — |
case-01 | fail→pass | 28,610 | 9,944 | -65% | 1 | 1 | 0% | 1,760 | 3,833 | +118% | 0 | 0 | — |
case-02 | fail→pass | 36,122 | 11,091 | -69% | 1 | 1 | 0% | 3,500 | 4,172 | +19% | 0 | 0 | — |
case-03 | pass→pass | 7,400 | 5,631 | -24% | 1 | 1 | 0% | 1,489 | 2,765 | +86% | 0 | 0 | — |
case-04 | pass→pass | 11,157 | 11,287 | +1% | 1 | 1 | 0% | 2,316 | 4,034 | +74% | 0 | 0 | — |
case-05 | pass→pass | 10,408 | 6,280 | -40% | 1 | 1 | 0% | 2,124 | 2,775 | +31% | 0 | 0 | — |
case-06 | pass→pass | 13,772 | 7,992 | -42% | 1 | 1 | 0% | 2,540 | 2,901 | +14% | 0 | 0 | — |
case-07 | pass→pass | 7,119 | 3,943 | -45% | 1 | 1 | 0% | 1,440 | 2,417 | +68% | 0 | 0 | — |
case-08 | fail→pass | 8,871 | 4,032 | -55% | 1 | 1 | 0% | 1,841 | 2,487 | +35% | 0 | 0 | — |
case-09 | fail→pass | 7,801 | 5,918 | -24% | 1 | 1 | 0% | 1,617 | 2,769 | +71% | 0 | 0 | — |
case-10 | pass→pass | 12,790 | 5,086 | -60% | 1 | 1 | 0% | 2,123 | 2,470 | +16% | 0 | 0 | — |
case-11 | fail→pass | 8,745 | 3,918 | -55% | 1 | 1 | 0% | 1,474 | 2,304 | +56% | 0 | 0 | — |
case-12 | fail→pass | 12,972 | 5,951 | -54% | 1 | 1 | 0% | 2,142 | 2,589 | +21% | 0 | 0 | — |
case-13 | fail→pass | 19,196 | 3,437 | -82% | 1 | 1 | 0% | 1,877 | 2,218 | +18% | 0 | 0 | — |
case-14 | pass→pass | 6,913 | 5,460 | -21% | 1 | 1 | 0% | 1,405 | 2,591 | +84% | 0 | 0 | — |
case-15 | pass→pass | 5,185 | 1,731 | -67% | 1 | 1 | 0% | 919 | 1,906 | +107% | 0 | 0 | — |
case-16 | pass→pass | 3,210 | 2,538 | -21% | 1 | 1 | 0% | 601 | 2,052 | +241% | 0 | 0 | — |
case-17 | pass→pass | 5,712 | 2,290 | -60% | 1 | 1 | 0% | 1,127 | 2,015 | +79% | 0 | 0 | — |
case-18 | pass→pass | 11,860 | 4,693 | -60% | 1 | 1 | 0% | 2,273 | 2,433 | +7% | 0 | 0 | — |
case-19 | pass→pass | 7,769 | 5,188 | -33% | 1 | 1 | 0% | 1,493 | 2,600 | +74% | 0 | 0 | — |
case-22 | pass→pass | 9,743 | 1,861 | -81% | 1 | 1 | 0% | 1,636 | 1,923 | +18% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/24/2026 | +27% |
Other measured skills in the registry, with their headline benchmark lift.