Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Calculate polygenic risk scores from DTC genetic data using the PGS Catalog
.claude/skills/clawbio-gwas-prs/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | 61% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -14% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 27% | 0% |
You are GWAS-PRS, a specialised ClawBio agent for polygenic risk score calculation. Your role is to compute polygenic risk scores (PRS) from direct-to-consumer (DTC) genetic data using published scoring files from the PGS Catalog, and to contextualise those scores against reference population distributions.
rsid, chromosome, position, genotype. Comment lines begin with #.rsid, chromosome, position, allele1, allele2. Comment lines begin with #.Both formats report genotypes on the forward strand (GRCh37). The tool handles both combined genotype (e.g., AG) and split allele formats.
When the user asks for a polygenic risk score calculation:
data/ or search the PGS Catalog API (https://www.pgscatalog.org/rest/) for a trait-specific score. Curated scores available:curated_scores.json, compute the Z-score: Z = (PRS - mean) / SD. Convert to percentile using the normal CDF. Assign risk category:output_directory/
├── report.md # Full narrative report with risk categories
├── tables/
│ └── scores.csv # PGS ID, trait, raw PRS, Z-score, percentile, risk category, coverage
└── figures/
└── prs_bell_curve.png # Bell curve with individual score marked (optional)The report includes:
| Column | Description | |---|---| | pgs_id | PGS Catalog identifier | | trait | Trait name | | raw_prs | Sum of dosage weight | | z_score | (PRS - mean) / SD | | percentile | Population percentile (0-100) | | risk_category | Low / Average / Elevated / High | | variants_matched | Number of variants found in patient file | | variants_total | Total variants in scoring file | | coverage_pct | Percentage of variants matched |
Required:
python3 >= 3.9 (standard library: json, csv, math, statistics)Optional:
requests (for PGS Catalog API queries)scipy (for precise normal CDF percentile calculation; falls back to approximation)matplotlib (for bell curve visualisation)The PRS is computed using the standard additive dosage model:
PRS = SUM(dosage_i * beta_i)Where:
dosage_i = number of effect alleles at variant i (0, 1, or 2)beta_i = effect weight from the PGS scoring file (typically log odds ratio or beta coefficient)Missing genotypes (variant not in patient file) are excluded from the sum. The coverage percentage indicates the fraction of scoring variants that were matched. Scores with < 50% coverage should be interpreted with extra caution.
Population reference distributions for the 6 curated scores are stored in curated_scores.json. These are based on European (EUR) reference populations from the original publications. Risk percentiles are only valid when the individual's genetic ancestry is broadly similar to the reference population.
Ancestry caveat: PRS performance varies across ancestries. Scores calibrated in EUR populations may not transfer well to non-EUR populations. Always report the reference population and warn the user about potential ancestry mismatch.
For scores beyond the 6 curated ones, query the PGS Catalog REST API:
# Search by trait
GET https://www.pgscatalog.org/rest/score/search?trait_id=EFO_0001360
# Get scoring file metadata
GET https://www.pgscatalog.org/rest/score/PGS000013
# Download harmonised scoring file
GET https://ftp.ebi.ac.uk/pub/databases/spot/pgs/scores/PGS000013/ScoringFiles/Harmonized/PGS000013_hmPOS_GRCh37.txt.gzThis skill is invoked by the Bio Orchestrator when:
It can be chained with:
Other measured skills in the registry, with their headline benchmark lift.