sciagent-skill-creator
Scaffold a new SciAgent-Skills entry. Picks pipeline/toolkit/database/guide template, creates skills/{category}/{name}/SKILL.md…
GWAS and population genetics tool. Processes PLINK (.bed/.bim/.fam), VCF, and BGEN; runs QC (MAF, HWE, missingness), IBD estimation, PCA, and linear/logistic regression GWAS. Outputs Manhattan-ready summary stats. Use regenie or SAIGE for biobanks (>100k samples) needing mixed
Claude Code
$ npx -y skills add jaechang-hits/SciAgent-Skills --skill plink2-gwas-analysis --agent claude-code
Codex
$ npx skills add jaechang-hits/SciAgent-Skills --skill plink2-gwas-analysis -a codex -y
Cursor
$ npx skills add jaechang-hits/SciAgent-Skills --skill plink2-gwas-analysis -a cursor -y
Gemini CLI
$ npx skills add jaechang-hits/SciAgent-Skills --skill plink2-gwas-analysis -a gemini-cli -y
GitHub Copilot
$ npx skills add jaechang-hits/SciAgent-Skills --skill plink2-gwas-analysis -a github-copilot -y
OpenCode
$ npx skills add jaechang-hits/SciAgent-Skills --skill plink2-gwas-analysis -a opencode -y
Windsurf
$ npx skills add jaechang-hits/SciAgent-Skills --skill plink2-gwas-analysis -a windsurf -y
name: "plink2-gwas-analysis" description: "GWAS and population genetics tool. Processes PLINK (.bed/.bim/.fam), VCF, and BGEN; runs QC (MAF, HWE, missingness), IBD estimation, PCA, and linear/logistic regression GWAS. Outputs Manhattan-ready summary stats. Use regenie or SAIGE for biobanks (>100k samples) needing mixed models." license: "GPL-3.0"
PLINK2 is the high-performance successor to PLINK 1.9, designed for genome-wide association studies (GWAS) and population genetics analysis on large cohorts. It processes genotype data in PLINK binary format (.bed/.bim/.fam), VCF, and BGEN formats — performing sample and variant quality control (QC), kinship estimation, principal component analysis (PCA), and linear/logistic regression association testing. PLINK2 is 10–100× faster than PLINK 1.9 on most tasks due to multithreading and optimized I/O. Output files are compatible with downstream visualization (Manhattan/QQ plots) and meta-analysis tools.
> **Check before installing**: The tool may already be available (e.g., inside a `pixi` / `conda` env). Always run `command -v plink2` first and skip the install block if it returns a path. When executing tools inside a pixi project, prefer `pixi run <tool>` over plain `<tool>`.
# Skip install if already present
if command -v plink2 >/dev/null 2>&1; then
echo "plink2 already installed: $(plink2 --version)"
else
# Download PLINK2 pre-compiled binary (Linux)
wget https://s3.amazonaws.com/plink2-assets/alpha6/plink2_linux_avx2_20241112.zip
unzip plink2_linux_avx2_20241112.zip
chmod +x plink2
export PATH="$PWD:$PATH"
# macOS
# wget https://s3.amazonaws.com/plink2-assets/alpha6/plink2_mac_20241112.zip
# unzip plink2_mac_20241112.zip
plink2 --version
# PLINK v2.00a6LM
fi
# Python for downstream analysis
pip install pandas numpy matplotlib scipySettle these with the user before writing any analysis code.
decisions:
- id: D1
param: phenotype
kind: required
source: data
ask: "Which column holds the trait being tested, and is it a measurement or a case/control status?"
default: null
- id: D2
param: regressionMode
kind: derived
source: data
depends_on: [D1]
ask: "Should the association test be linear or logistic?"
default: "linear for a quantitative trait, logistic for case/control"
- id: D3
param: qcThresholds
kind: required
source: user
ask: "Where should variants and samples be cut for allele frequency, missingness, and Hardy-Weinberg departure?"
default: "MAF 0.01, variant missingness 0.05, sample missingness 0.02, HWE 1e-6"
- id: D4
param: covariates
kind: required
source: data
ask: "Which covariates belong in the model - age, sex, batch, study site?"
default: null
- id: D5
param: populationStructure
kind: required
source: user
ask: "How many principal components should be included to absorb ancestry differences?"
default: "10, computed from LD-pruned variants"
- id: D6
param: ldPruning
kind: optional
source: user
depends_on: [D5]
ask: "Which window and correlation threshold should thin variants before computing the components?"
default: "50 variant window, step 5, r-squared 0.2"
- id: D7
param: threads
kind: never_ask
source: data
reason: "Affects runtime only, not the association statistics"
default: "min(8, available_cores)"D5 hangs on D4 because the components are themselves covariates - how many to include is a question about the covariate set, not a separate knob. Omitting them entirely is the classic way to produce a genome-wide significant result that reflects ancestry rather than the trait.
# Run GWAS: linear regression for quantitative trait
plink2 \
--bfile cohort_qc \
--pheno phenotypes.txt \
--covar covariates.txt \
--linear hide-covar \
--out results/gwas_result \
--threads 8
# View top hits
head results/gwas_result.*.glm.linear | sort -k12,12g | head -20Convert input genotype data to PLINK binary format for fast processing.
# Convert VCF to PLINK binary
plink2 \
--vcf cohort_genotyped.vcf.gz \
--make-bed \
--out cohort_plink \
--threads 8
# Convert BGEN (imputed data from Michigan/TopMed imputation server)
plink2 \
--bgen cohort_imputed.bgen ref-first \
--sample cohort_imputed.sample \
--make-bed \
--out cohort_imputed_plink \
--threads 8
echo "Files created:"
ls -lh cohort_plink.{bed,bim,fam}
echo "Samples: $(wc -l < cohort_plink.fam)"
echo "Variants: $(wc -l < cohort_plink.bim)"Remove samples with high missingness or heterozygosity outliers.
# Compute per-sample and per-variant missingness plink2 \
Turn your AI coding agent into a life sciences expert — 199 bioinformatics skills for Claude Code covering RNA-seq, single-cell analysis, genomics, proteomics, drug discovery, and more. Boosted BixBench from 65% to 92%. Open source.
Scaffold a new SciAgent-Skills entry. Picks pipeline/toolkit/database/guide template, creates skills/{category}/{name}/SKILL.md…
Bayesian modeling with PyMC 5: priors, likelihood, NUTS/ADVI sampling, diagnostics (R-hat, ESS), LOO/WAIC comparison, prediction.…
Time-to-event modeling with scikit-survival: Cox PH (elastic net), Random Survival Forests, Boosting, SVMs for censored data.…
Guided statistical analysis: test choice, assumption checks, effect sizes, power, APA reporting. Pick tests, verify assumptions,…
Python statistical modeling: regression (OLS, WLS, GLM), discrete (Logit, Poisson, NegBin), time series (ARIMA, SARIMAX, VAR),…
DL cell/nucleus segmentation for fluorescence and brightfield microscopy. Pre-trained models (cyto3, nuclei, tissuenet) and a…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.