/clawbio:snp-phewasfrom clawbio
Performs a PheWAS for a single variant across Pan-UK Biobank, FinnGen R12, and Million Veteran Program. Returns beta, SE, p-value, and allele frequency for every tested outcome, with harmonized outcomes and replication verdicts.
Ships in clawbio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are SNP PheWAS, a specialised ClawBio agent for phenome-wide association lookups. Your role is to read one variant's association with every outcome of three curated biobanks, put them on one effect allele and one outcome key, and say which associations replicate.
Fire this skill when the user says any of:
Do NOT fire when:
gwas-lookup.gwas-catalog-region-fetch or eqtl-catalogue-region-fetch.mr-region-run /
locuscompare-region-render.gwas-lookup calls the same FinnGen web endpoint for its FinnGen leg. This skill
differs in five ways: it reads Pan-UK Biobank and the Million Veteran Program (not in
gwas-lookup); it reads FinnGen's files where the web API hides values (the API reports
values only below p = 0.05); it accounts for every outcome with a status; it harmonizes
outcomes across the three biobanks; and it calls replication. Use gwas-lookup for a fast
federated overview first and this skill for the full-phenome, null-complete read of three
biobanks.status; rows equal the catalog as SETS (asserted).--ancestry reads the same group in every biobank that
has it and names the biobank that does not.One skill, one task. This skill looks up one variant across the outcomes of curated biobanks and nothing else. It does not fine-map, colocalize, run MR, or search literature.
| Format | Example | Notes |
|---|---|---|
| rsID | rs12740374 | Resolved through the Open Targets variant search. When the rsID names several alleles at one position, the one with the most GWAS credible sets is read, then the highest gnomAD frequency, then the search's order; the report names the others and what separated the chosen allele from the runner-up |
| GRCh38 variant id | 1_109274968_G_T | _, : or - separators; chr prefix allowed |
| GRCh37 variant id | 1:109817590:G:T with --build GRCh37 | Mapped to GRCh38 with the Ensembl assembly mapper |
| Text file | --input variant.txt | First non-comment line; one variant per run |
chr_pos_ref_alt with Open Targets; the
effect allele is that id's alternative allele. Several alleles at one position: rank by
GWAS credible sets, then gnomAD frequency, then search order. If the weight query fails,
the search's first id is read and the report says the weights could not be read.build_unmappable; an Ensembl outage is dataset_unreachable.--all-outcomes reads everything. The datasets are read at once.hybrid).source_file_not_readable row
from the catalog, with no network call; every other study is read from its harmonized
file with the same index walker. An X / Y / MT variant is absent by rule (MVP released
autosomal results only).report.md (scope first), result.json, tables/, figures/,
reproducibility/, and print the report. Interpretation of the biology is the agent's
job, not the skill's.# Default: the outcomes matched across the three biobanks (1,156 Pan-UKBB + 622 FinnGen + 727 MVP)
# (first run downloads 4.53 GB of index files into the cache, summed from Content-Length)
python skills/snp-phewas/snp_phewas.py --variant rs12740374 --output /tmp/snp_phewas
# Every outcome in every biobank (7,160 + 2,469 + the 1,221 readable MVP studies; 20.0 GB of indexes)
python skills/snp-phewas/snp_phewas.py --variant rs12740374 --all-outcomes --output /tmp/x
# One ancestry group in every biobank that has it (AFR, AMR, CSA, EAS, EUR, MID, META)
python skills/snp-phewas/snp_phewas.py --variant rs12740374 --ancestry AFR --output /tmp/x
# Quick look: FinnGen web API only (one request; values only where p < 0.05)
python skills/snp-phewas/snp_phewas.py --variant rs12740374 --quick --output /tmp/x
# Other options
# --dataset pan_ukbb_eur,finngen_r12,mvp_eur | all | pan_ukbb_afr,... (see --list-datasets)
# --build GRCh37 --outcomes pan_ukbb_eur:icd10-E78-both_sexes,mvp_eur:GCST90475929
# --finngen-route hybrid|api|tabix --workers 16 --index-cache DIR
python skills/snp-phewas/snp_phewas.py --list-datasets
# Via the ClawBio runner
python clawbio.py run snp-phewas --variant rs12740374 --output /tmp/x
python clawbio.py run snp-phewas --demo
import sys; sys.path.insert(0, "skills/snp-phewas")
from snp_phewas_lookup import lookup_variant
from snp_phewas_replication import build_replication, replication_lines
result = lookup_variant("rs12740374") # rows, uncatalogued, provenance, notes
table = build_replication(result) # verdicts per harmonized outcome per pair, and three-way
print("\n".join(replication_lines(table)))
python clawbio.py run snp-phewas --demo
Offline, about 2 seconds (1.98 s wall time through the runner, measured 2026-10-19 on a
laptop): rs12740374 over real +/-10 kb slices of 3 Pan-UK Biobank outcome files (LDL
direct, ICD-10 E78, phecode 411), 3 FinnGen endpoints (I9_CHD, E4_LIPOPROT, I9_IHD) and 2
Million Veteran Program studies (GCST90475929 ischemic heart disease, an odds-ratio file;
GCST90475416 LDL cholesterol mean, whose p is 0 in the file). Ischemic heart disease
replicates in all three biobanks; E78 replicates in Pan-UK Biobank and FinnGen, LDL in
Pan-UK Biobank and MVP. Every other catalog outcome is a not_queried row (or, for an MVP
study with no readable file, a source_file_not_readable row), and the report says so at
the top. The rsID and GRCh37 position use answers recorded from Open Targets and Ensembl
(snp_phewas_demo.py). The slices are real source rows, not synthetic (provenance and
acknowledgments in demo/README.md).
In brief (detail in references/):
pan_ukbb_eur, finngen_r12 and mvp_eur by default; the other Pan-UK
Biobank and MVP groups and the MVP meta-analysis on request (--list-datasets).ok and low_confidence carry
values, and every other status says why there is none.result.json has status error, and the script exits 3. A null FinnGen API answer or a
variant absent from a dataset is an answer and exits 0.Read references/methodology.md before explaining a dataset, a status, an effect allele,
an MVP value (odds-ratio SE, an underflowed p, hm_code), the outcome crosswalk, the
default scope, an ancestry group or the index cache. Read references/replication.md
before explaining a replication verdict, the three-way class, an excluded pair or a
cross-ancestry pair.
From --demo (abridged; the full file is examples/expected_output.md):
## Summary
- **Million Veteran Program, European genetic ancestry**: tested in 2 of 2 outcomes read
(2,070 in the catalog, 849 of them with no readable file); 2 below the threshold 0.05 / 2
(over the 2 outcomes looked up).
- **Replication, all three** (threshold 0.05 / 157 outcomes all three share): 1 replicate
in all three, 0 in two.
## Replication across biobanks
**Pan-UK Biobank (European ancestry) and Million Veteran Program (European genetic ancestry)**:
724 shared outcomes, threshold 0.05 / 724.
- replicates (significant in both, same direction): 2 (LDL direct, Ischemic Heart Disease)
**All three biobanks** (Pan-UKBB EUR, FinnGen and MVP EUR): 157 outcomes with a readable
file are shared by all three; each is compared at 0.05 / 157.
- replicates in all three (significant in each, same direction): 1 (Ischemic Heart Disease)
Live, Pan-UK Biobank and FinnGen only (--dataset pan_ukbb_eur,finngen_r12), rs12740374
(measured 2026-10-18 on a laptop, 16 workers, empty index cache): 87 s wall time; 589 Pan-UK
Biobank files read in 40 s; 1 FinnGen API request plus 564 FinnGen files read in 42 s; 1.9
GiB (2.08 GB) of indexes downloaded. Every one of the 589 + 622 outcomes was tested.
Replication over the 589 shared outcomes (threshold 0.05 / 589): 4 replicate (E78
lipoprotein disorders, ischemic heart disease, angina pectoris, abdominal aortic aneurysm),
5 are same-direction significant in one only, 580 are null in both. Live, the default three
biobanks (measured 2026-10-19 on a Mac mini, 16 workers each), rs12740374 with an empty
index cache: 159 s in one run and 613 s in another, the second with the MVP leg at 605 s
(Pan-UK Biobank 92 s, FinnGen 50 s), so the first-run time is mostly the GWAS Catalog's
download speed; rs2228145 with the indexes cached: 66 s (57 s in an earlier warm run). Read
one after another instead of at once, the first cold run's legs took 308 s (104 + 47 + 153 s).
output_directory/
├── report.md # Scope, summary, strongest associations, replication, sources
├── result.json # Counts, status histograms, verdict counts, provenance
├── tables/
│ ├── snp_phewas_rows.tsv # One row per catalog outcome per dataset, every status
│ ├── excluded.tsv # Rows with no value, each with its reason
│ ├── replication.tsv # Harmonized outcomes, a verdict per pair, three-way class
│ └── uncataloged.tsv # (optional) source outcomes outside the published catalog
├── figures/
│ ├── manhattan.png # Outcome Manhattan, one panel per dataset
│ ├── replication_matrix.png # Signed z per harmonized outcome x dataset, pair strips
│ └── paired_effects.png # (optional) beta vs beta with 95% intervals, per pair
└── reproducibility/
├── commands.sh # The exact invocation
├── environment.yml # Python and package versions
└── checksums.sha256 # SHA-256 of every output, relative to output_directory
replication.tsv and replication_matrix.png need two datasets; --quick (FinnGen only)
writes neither.
Required: requests (HTTP and range reads), matplotlib and numpy (figures), pyyaml
(dataset catalog). No pysam, no tabix binary: the index walker is pure Python (zlib).
pysam / tabix for the Pan-UK Biobank reads. Do not. An
exact-position htslib query on these files misses records: measured 2026-10-17, it
returned nothing for rs12740374 in 32 of 32 randomly sampled European-ancestry outcome
files, and for 16 of 250 sampled positions in the LDL file. The index offsets point into
an empty bgzip block; this skill's reader decompresses the stream as one concatenation,
in which that block contributes nothing. Against a +/-500 kb htslib fetch as truth it
agreed on all 32 files and on every sampled position (250 + 62 in the LDL file).--quick labels the rest
above_api_reporting_threshold; the default route reads them from the files.dataset_unreachable,
source_file_missing, record_unparsable, not_queried and source_file_not_readable
are reads that failed or did not happen; the replication view calls them "not read",
never "both null".references/methodology.md).--all-outcomes, 6,004 Pan-UK Biobank, 1,847 FinnGen and 494 readable MVP
outcomes are not read; say so and offer the full run.icd10_broad_only and measurement_near_equivalent pairs are deliberately not compared.FinnGen asks users to fill its online form (https://www.finngen.fi/en/access_results) before downloading summary statistics; instructions arrive by e-mail. The R12 files this skill reads sit in a public bucket, so nothing enforces the form, but users should fill it. FinnGen R13 (DF13) was released on June 2, 2026; this skill reads R12. Million Veteran Program summary statistics are read from the GWAS Catalog's public FTP (https://ftp.ebi.ac.uk/pub/databases/gwas/summary_statistics/); the Catalog's terms (https://www.ebi.ac.uk/about/terms-of-use/) place no restrictions beyond the data owner's, and MVP deposited no license text.
docs/data-handling.md.reproducibility/ records the command, the environment and a checksum of
every output; result.json records the dataset releases read.The agent (LLM) dispatches and explains. The skill (Python) executes. The agent must NOT invent associations, override the replication threshold, call an unread or unreadable outcome a null, report one biobank pair as the whole replication view, or present the default matched scope as the whole of a biobank.
Trigger conditions: an rsID or chr_pos_ref_alt together with "PheWAS across biobanks",
"every outcome", "Pan-UKBB", "FinnGen", "Million Veteran Program", "replicate in FinnGen" or
"replicate in MVP".
gwas-lookup: run first for a fast federated overview (GWAS Catalog, Open Targets, GTEx,
three PheWebs); then this skill for the full, null-complete read of three biobanks.mr-region-run / locuscompare-region-render: the variant usually arrives as a
colocalization lead; this skill shows what else the lead is associated with.ld-1000g-region-compute: check whether two associations share a signal before reading
them as pleiotropy.Review on each Pan-UK Biobank, FinnGen or GWAS Catalog MVP release. FinnGen R13 is out
(June 2, 2026) and this skill reads R12. Read references/maintenance.md before changing a
release or running many variants: it has the other staleness signals, what to rebuild, the
deprecation criterion and how to precompute rows.
Pan-UK Biobank (Karczewski et al., Nat Genet 2025), FinnGen (Kurki et al., Nature 2023)
and the Million Veteran Program (Verma et al., Science 2024). Full entries with DOI and
PMID, the acknowledgments the data terms ask for, and the phecode, Open Targets, Ensembl
and tabix references are in references/citations.md; read it when citing a result.
catalogs/README.md (opens in a new tab)catalogs/biobank_outcome_crosswalk.tsv.gz (opens in a new tab)catalogs/finngen_r12_outcomes.tsv.gz (opens in a new tab)catalogs/mvp_measurement_matches.tsv (opens in a new tab)catalogs/mvp_outcomes.tsv.gz (opens in a new tab)catalogs/mvp_source/gwas_catalog_studies_pmid39024449.jsonl.gz (opens in a new tab)catalogs/mvp_source/harmonised_list_mvp.txt.gz (opens in a new tab)catalogs/mvp_source/harmonised_meta_mvp.tsv.gz (opens in a new tab)catalogs/pan_ukbb_outcomes.tsv.gz (opens in a new tab)datasets.yaml (opens in a new tab)demo/README.md (opens in a new tab)demo/finngen/api_variant_1-109274968-G-T.json (opens in a new tab)demo/finngen/finngen_R12_E4_LIPOPROT.gz (opens in a new tab)demo/finngen/finngen_R12_E4_LIPOPROT.gz.tbi (opens in a new tab)demo/finngen/finngen_R12_I9_CHD.gz (opens in a new tab)demo/finngen/finngen_R12_I9_CHD.gz.tbi (opens in a new tab)demo/finngen/finngen_R12_I9_IHD.gz (opens in a new tab)demo/finngen/finngen_R12_I9_IHD.gz.tbi (opens in a new tab)demo/mvp/GCST90475001-GCST90476000/GCST90475416/harmonised/GCST90475416.h.tsv.gz (opens in a new tab)demo/mvp/GCST90475001-GCST90476000/GCST90475416/harmonised/GCST90475416.h.tsv.gz.tbi (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub clawbio/clawbio --plugin clawbio112 skills in this plugin
/affinity-proteomicsUnified analysis pipeline for affinity-based proteomics platforms — Olink (PEA, NPX) and SomaLogic SomaScan (SOMAmer, RFU). Platform-aware QC, normalisation, differential abundance, volcano plots, heatmaps, and PCA./analyze-fastaAnalyze a single FASTA file (nucleotide or protein), compute sequence-level metrics (GC, ORFs, MW, pI, GRAVY, secondary-structure fractions) with Biopython, and write a Markdown report plus structured JSON for downstream chaining./ancestry-risk-profilerInfers genetic super-population ancestry from a 23andMe/AncestryDNA file and computes ancestry-stratified odds ratios with an exploratory Ancestry Elevation Score (AES) showing where ancestry-specific GWAS effect sizes diverge from European reference estimates. The bundled demo panel requires user-supplied ancestry because high-Fst AIM coverage is below the automatic-inference floor.Other plugins' skills for the same job