Install any skill in seconds. Free to start, no credit card required.
Get Started Free →End-to-end GWAS workflow from VCF to association results. Covers PLINK QC, population structure correction, and association testing for case-control or quantitative traits. Use when running genome-wide association studies.
.claude/skills/bio-workflows-gwas-pipeline/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 63% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 76% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 170% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 93% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 109% | 0% |
<!--
#
#
-->
Complete workflow for genome-wide association studies from genotype data to significant associations.
VCF/PLINK files
|
v
[1. QC Filtering] ------> Sample and variant QC
|
v
[2. LD Pruning] --------> Independent variants for PCA
|
v
[3. Population Structure] --> PCA for covariates
|
v
[4. Association Testing] --> Logistic/linear regression
|
v
[5. Results] -----------> Manhattan plot, QQ plot
|
v
Significant associationsbash# VCF to PLINK binary format plink2 --vcf input.vcf.gz \ --make-bed \ --out study # Or with phenotype/covariate files plink2 --vcf input.vcf.gz \ --pheno phenotypes.txt \ --make-bed \ --out study
bash# Calculate sample statistics plink2 --bfile study \ --missing \ --out study_stats # Remove samples with high missing rate (>5%) plink2 --bfile study \ --mind 0.05 \ --make-bed \ --out study_sample_qc # Check for sex discrepancies (if sex chromosome data available) plink2 --bfile study_sample_qc \ --check-sex \ --out study_sex_check # Remove related individuals (optional, requires IBD) plink2 --bfile study_sample_qc \ --king-cutoff 0.0884 \ --make-bed \ --out study_unrelated
bash# Apply standard variant filters plink2 --bfile study_sample_qc \ --geno 0.05 \ --maf 0.01 \ --hwe 1e-6 \ --make-bed \ --out study_qc # Summary plink2 --bfile study_qc --freq --out study_qc
QC Checkpoint:
bash# Identify independent variants plink2 --bfile study_qc \ --indep-pairwise 50 5 0.2 \ --out pruned # Extract pruned variants plink2 --bfile study_qc \ --extract pruned.prune.in \ --make-bed \ --out study_pruned
bash# Calculate principal components plink2 --bfile study_pruned \ --pca 10 \ --out study_pca # The eigenvec file contains PCs for use as covariates
rlibrary(ggplot2) # Load PCA results pca <- read.table('study_pca.eigenvec', header = FALSE) colnames(pca) <- c('FID', 'IID', paste0('PC', 1:10)) # Load phenotype for coloring pheno <- read.table('phenotypes.txt', header = TRUE) pca <- merge(pca, pheno, by = c('FID', 'IID')) # Plot ggplot(pca, aes(x = PC1, y = PC2, color = as.factor(PHENO))) + geom_point(alpha = 0.5) + labs(title = 'PCA of Study Samples', color = 'Phenotype') + theme_minimal() ggsave('pca_plot.pdf', width = 8, height = 6)
bash# Logistic regression with PCA covariates plink2 --bfile study_qc \ --pheno phenotypes.txt \ --covar study_pca.eigenvec \ --covar-col-nums 3-12 \ --glm hide-covar \ --out gwas_results # Results in gwas_results.PHENO.glm.logistic
bash# Linear regression plink2 --bfile study_qc \ --pheno phenotypes.txt \ --pheno-name BMI \ --covar study_pca.eigenvec \ --covar-col-nums 3-12 \ --glm hide-covar \ --out gwas_bmi # Results in gwas_bmi.BMI.glm.linear
bash# Include age, sex, and PCs plink2 --bfile study_qc \ --pheno phenotypes.txt \ --covar covariates.txt \ --covar-name AGE,SEX,PC1-PC10 \ --glm hide-covar \ --out gwas_adjusted
rlibrary(qqman) # Load results results <- read.table('gwas_results.PHENO.glm.logistic', header = TRUE) results <- results[!is.na(results$P),] # Manhattan plot png('manhattan.png', width = 1200, height = 600) manhattan(results, chr = 'X.CHROM', bp = 'POS', snp = 'ID', p = 'P', suggestiveline = -log10(1e-5), genomewideline = -log10(5e-8)) dev.off() # QQ plot png('qq_plot.png', width = 600, height = 600) qq(results$P) dev.off()
r# Lambda (genomic inflation factor) chisq <- qchisq(1 - results$P, 1) lambda <- median(chisq) / qchisq(0.5, 1) cat('Lambda:', round(lambda, 3), '\n') # Lambda should be close to 1.0 (1.0-1.1 acceptable)
bash# Genome-wide significant (p < 5e-8) awk '$12 < 5e-8' gwas_results.PHENO.glm.logistic > significant_hits.txt # Suggestive (p < 1e-5) awk '$12 < 1e-5' gwas_results.PHENO.glm.logistic > suggestive_hits.txt
| Step | Parameter | Value | |------|-----------|-------| | Sample QC | --mind | 0.05 | | Variant QC | --geno | 0.05 | | Variant QC | --maf | 0.01 | | Variant QC | --hwe | 1e-6 | | LD pruning | --indep-pairwise | 50 5 0.2 | | PCA | --pca | 10 | | Significance | p-value | 5e-8 |
| Issue | Likely Cause | Solution | |-------|--------------|----------| | High lambda (>1.1) | Population stratification | Add more PCs, check ancestry | | No significant hits | Low power | Increase sample size, meta-analysis | | Deflated lambda (<1) | Over-correction | Reduce PC covariates | | QQ deviation at low end | Batch effects | Check for technical artifacts |
bash#!/bin/bash set -e INPUT_VCF="genotypes.vcf.gz" PHENO="phenotypes.txt" OUTDIR="gwas_results" mkdir -p ${OUTDIR} # Step 1: Convert and QC plink2 --vcf ${INPUT_VCF} --make-bed --out ${OUTDIR}/raw plink2 --bfile ${OUTDIR}/raw --mind 0.05 --geno 0.05 --maf 0.01 --hwe 1e-6 \ --make-bed --out ${OUTDIR}/qc # Step 2: LD pruning plink2 --bfile ${OUTDIR}/qc --indep-pairwise 50 5 0.2 --out ${OUTDIR}/pruned plink2 --bfile ${OUTDIR}/qc --extract ${OUTDIR}/pruned.prune.in \ --make-bed --out ${OUTDIR}/pruned # Step 3: PCA plink2 --bfile ${OUTDIR}/pruned --pca 10 --out ${OUTDIR}/pca # Step 4: Association plink2 --bfile ${OUTDIR}/qc --pheno ${PHENO} \ --covar ${OUTDIR}/pca.eigenvec --covar-col-nums 3-12 \ --glm hide-covar --out ${OUTDIR}/gwas echo "=== GWAS Complete ===" echo "Results: ${OUTDIR}/gwas.*.glm.*"
<!-- 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-02 | pass→pass | 12,037 | 3,846 | -68% | 1 | 1 | 0% | 1,079 | 2,910 | +170% | 0 | 0 | — |
case-01 | fail→pass | 11,564 | 7,336 | -37% | 1 | 1 | 0% | 2,513 | 4,084 | +63% | 0 | 0 | — |
case-20 | fail→fail | 13,937 | 13,049 | -6% | 1 | 1 | 0% | 2,684 | 4,938 | +84% | 0 | 0 | — |
case-21 | fail→fail | 29,031 | 13,335 | -54% | 1 | 1 | 0% | 2,961 | 4,970 | +68% | 0 | 0 | — |
case-22 | fail→fail | 16,494 | 19,588 | +19% | 1 | 1 | 0% | 3,158 | 6,256 | +98% | 0 | 0 | — |
case-03 | pass→pass | 7,471 | 3,082 | -59% | 1 | 1 | 0% | 1,583 | 3,048 | +93% | 0 | 0 | — |
case-04 | pass→pass | 8,802 | 7,144 | -19% | 1 | 1 | 0% | 1,803 | 3,775 | +109% | 0 | 0 | — |
case-05 | fail→pass | 12,973 | 9,799 | -24% | 1 | 1 | 0% | 2,398 | 4,221 | +76% | 0 | 0 | — |
case-06 | fail→fail | 12,057 | 8,915 | -26% | 1 | 1 | 0% | 2,052 | 4,041 | +97% | 0 | 0 | — |
case-07 | pass→pass | 6,823 | 3,554 | -48% | 1 | 1 | 0% | 1,395 | 3,100 | +122% | 0 | 0 | — |
case-08 | pass→pass | 7,550 | 4,530 | -40% | 1 | 1 | 0% | 1,468 | 3,156 | +115% | 0 | 0 | — |
case-09 | pass→pass | 10,471 | 7,884 | -25% | 1 | 1 | 0% | 2,071 | 3,890 | +88% | 0 | 0 | — |
case-10 | pass→pass | 9,208 | 8,357 | -9% | 1 | 1 | 0% | 1,883 | 4,113 | +118% | 0 | 0 | — |
case-11 | pass→pass | 9,112 | 8,564 | -6% | 1 | 1 | 0% | 1,983 | 4,136 | +109% | 0 | 0 | — |
case-12 | pass→pass | 8,360 | 3,414 | -59% | 1 | 1 | 0% | 1,708 | 3,040 | +78% | 0 | 0 | — |
case-13 | pass→pass | 9,918 | 3,373 | -66% | 1 | 1 | 0% | 1,839 | 2,988 | +62% | 0 | 0 | — |
case-14 | pass→pass | 13,839 | 9,617 | -31% | 1 | 1 | 0% | 2,392 | 4,165 | +74% | 0 | 0 | — |
case-15 | pass→pass | 17,336 | 12,565 | -28% | 1 | 1 | 0% | 3,013 | 4,670 | +55% | 0 | 0 | — |
case-16 | pass→pass | 4,713 | 3,249 | -31% | 1 | 1 | 0% | 810 | 2,893 | +257% | 0 | 0 | — |
case-17 | pass→pass | 4,115 | 2,623 | -36% | 1 | 1 | 0% | 776 | 2,830 | +265% | 0 | 0 | — |
case-18 | pass→pass | 6,353 | 4,004 | -37% | 1 | 1 | 0% | 1,264 | 3,194 | +153% | 0 | 0 | — |
case-19 | pass→pass | 4,139 | 1,808 | -56% | 1 | 1 | 0% | 752 | 2,683 | +257% | 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. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 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/26/2026 | +23% |
Other measured skills in the registry, with their headline benchmark lift.