gwas-pipeline

Automates GWAS with PLINK2 genotype QC and REGENIE two-step association testing.

1.1k|257|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/ClawBio/ClawBio --skill gwas-pipeline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gwas-pipeline
Source: https://github.com/ClawBio/ClawBio/tree/main/skills/gwas-pipeline
Command: npx skills add https://github.com/ClawBio/ClawBio --skill gwas-pipeline

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires plink2, regenie, matplotlib, numpy.

What problem does it solve?

Running a genome-wide association study normally requires manually orchestrating PLINK2 quality-control filters and REGENIE's two-step regression, writing hundreds of lines of bash, and tracking dozens of parameters. This Skill automates the entire workflow from genotype files to publication-ready Manhattan plots, QQ plots, and lead variant tables with a full reproducibility log.

Core Features & Use Cases

  • Genotype QC via PLINK2: Applies field-standard filters for variant/sample missingness, minor allele frequency, Hardy-Weinberg equilibrium, and LD pruning based on Anderson et al. (2010) thresholds.
  • REGENIE Two-Step Association: Runs Step 1 whole-genome ridge regression with LOCO predictions and Step 2 single-variant testing with Firth correction for binary traits or linear regression for quantitative traits.
  • Post-GWAS Outputs: Generates Manhattan plots, QQ plots with lambda GC, lead variant extraction at genome-wide significance (P < 5e-8), summary statistics TSV, and a reproducibility bundle logging every command and software version.
  • Use Case: A researcher with PLINK binary files (BED/BIM/FAM) and a phenotype file for a case-control study can run one command to obtain a complete GWAS report with QC summary, association results, and figures.

Quick Start

Run the GWAS pipeline in demo mode on the bundled REGENIE example dataset to produce a full association report with Manhattan and QQ plots.

Frequently Asked Questions about gwas-pipeline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a GWAS with PLINK2 and REGENIE?

Provide a PLINK BED prefix, a phenotype file, and optionally a covariate file, then run the pipeline with your trait name and type (bt for binary, qt for quantitative). It executes PLINK2 QC, REGENIE Step 1 and Step 2, and writes a report with plots and summary statistics.

What input file formats does this GWAS pipeline accept?

The pipeline accepts PLINK binary files (.bed/.bim/.fam) for genotypes, BGEN v1.2+ files for Step 2 imputed variants, and plain-text phenotype and covariate files with FID and IID columns. A demo mode uses REGENIE's bundled 500-sample example dataset.

Does the pipeline support binary and quantitative traits?

Yes. Binary traits use REGENIE's Firth logistic regression with the fast approximation and a p-value threshold of 0.01, while quantitative traits use standard linear regression. Select the mode with the --trait-type bt or qt flag.

What QC thresholds are used for genotype filtering?

Default thresholds follow Anderson et al. (2010): variant missingness 0.02, sample missingness 0.02, minor allele frequency 0.01, and HWE p-value 1e-6, plus LD pruning (window 1000, step 100, r2 0.9). All thresholds are configurable via command-line flags.

Why is plink2 or regenie not found when running the pipeline?

Both external binaries must be installed and on PATH, or present in a clawbio-gwas conda environment. Install them with conda create -n clawbio-gwas -c conda-forge -c bioconda plink2 regenie, then rerun the pipeline.

What outputs does the GWAS pipeline generate?

Outputs include a Markdown report, result.json with lambda GC and top variants, full summary statistics and lead variant TSV tables, Manhattan and QQ plots, and a reproducibility folder containing the executed commands and software versions.