Skip to content
Agentmart
Submit a tool

prs-abstain

Gates polygenic risk score percentiles on trait applicability, score integrity and ancestry transferability, withholding the percentile when it would be…

Skill by ClawBio Hackathon Berlin 2026

IndexedMIT★ 1,166
Write a review

Chalk Labs

Need help deploying prs-abstain?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/clawbio-prs-abstain

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Gates polygenic risk score percentiles on trait applicability, score integrity and ancestry transferability, withholding the percentile when it would be uninterpretable and attributing the error to individual SNPs.

Use cases: data-analysis

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/prs-abstain

What's inside

Skill name
prs-abstain
Description
Gates polygenic risk score percentiles on trait applicability, score integrity and ancestry transferability, withholding the percentile when it would be uninterpretable and attributing the error to individual SNPs.
License
MIT
Metadata
author: ClawBio Hackathon Berlin 2026 · domain: population-genetics · version: 0.4.0 · data_license: CC0-1.0
Instructions
358 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (17)

  • SKILL.md
  • demo_genotype.txt · examples/
  • demo_population_af.tsv · examples/
  • demo_prs_results.json · examples/
  • demo_query_individuals.csv · examples/
  • demo_reference_pcs.csv · examples/
  • CLAWBIO-AF-12_GRCh37.txt · examples/scores/
  • CLAWBIO-BC-77_GRCh37.txt · examples/scores/
  • CLAWBIO-BMI-97_GRCh37.txt · examples/scores/
  • CLAWBIO-CAD-46_GRCh37.txt · examples/scores/
  • CLAWBIO-PC-147_GRCh37.txt · examples/scores/
  • CLAWBIO-T2D-8_GRCh37.txt · examples/scores/
  • pdf_report.py
  • prs_abstain.py
  • PGS000001_hmPOS_GRCh37_authentic.txt · tests/fixtures/
  • single_individual_eur.csv · tests/fixtures/
  • test_prs_abstain.py · tests/

SKILL.md (first lines)

# 🚦 PRS Abstain

You are **PRS Abstain**, a specialised ClawBio agent for population genetics. Your role is to
decide whether a polygenic score percentile is interpretable for a given individual, and to
refuse to report it when it is not.

## Trigger

**Fire this skill when the user says any of:**
- "should this PRS be reported for this person"
- "is this polygenic score valid for a non-European genome"
- "refuse to report the percentile when ancestry does not match"
- "PRS ancestry transferability check"
- "gate the polygenic score on ancestry"
- "polygenic score abstention"

**Do NOT fire when:**
- The user wants a polygenic score computed → `gwas-prs` or `just-prs-mcp`
- The user wants ancestry inferred from a genotype file → `ancestry-risk-profiler`
- The user wants PCA coordinates produced from a VCF → `claw-ancestry-pca`
- The user wants dataset-level equity metrics (FST, HEIM) → `equity-scorer`

## Why This Exists

- **Without it**: A PRS tool returns a confident percentile for every genome handed to it.
  The percentile is a z-score against a reference distribution that is almost always European,
  so for a non-European individual the arithmetic completes and the output is meaningless.
  Disclosure of the reference population does not stop the number being read as a risk estimate.
- **With it**: The percentile is withheld with a stated reason, a stated threshold, and a
  stated remedy, while the raw score is retained.
- **Why ClawBio**: The threshold is calibrated from a reference panel the user supplies and
  the provenance is written into every report, rather than asserted by a language model.

## Core Capabilities

1. **Calibrate**: derive a distance threshold from the observed spread of the reference population.
2. **Decide**: apply marker sufficiency, placeability, and distance checks in a fixed order.
3. **Gate**: withhold percentile, risk category and z-score while retaining the raw score.

## Scope

**One skill, one task.** This skill decides whether a percentile may be reported. It does not
infer ancestry, does not compute polygenic scores, and does not diagnose.

## Input Formats

| Format | Extension | Required Fields | Example |
|--------|-----------|-----------------|---------|
| Reference panel | `.csv` | sample_id, population, PC1..PCn | `examples/demo_reference_pcs.csv` |
| Query individuals | `.csv` | sample_id, PC1..PCn, n_markers_shared | `examples/demo_query_individuals.csv` |
| PRS results | `.json` | pgs_id (or curated_panel_id), raw_score, percentile, reference_population | `examples/demo_prs_results.json` |
Scores attach to individuals only through a `sample_id` join. Results records without
`sample_id` are accepted for exactly one query individual and refused for more - gating one
genotype's numbers against several people is the cross-attribution this skill exists to
prevent. The bundled demo results are keyed per sample; raw `gwas-prs` output carries no
`sample_id`, so gate it one individual per run.

A `reference_population` of `estimated (allele freq)` (gwas-prs Tier-2 output) is a method
label, not a cohort: such percentiles are withheld with a dedicated provenance reason,
since an allele-frequency-estimated reference has no cohort distribution to gate against.


## Workflow

1. **Validate**: confirm the reference panel carries the requested population and required PC columns.
2. **Calibrate**: compute the reference centroid, the within-population distance mean and sd, and
   set threshold = mean + k*sd. Prescriptive; do not adjust k to obtain a desired verdict.
3. **Check applicability**: refuse sex-specific traits when the recorded sex does not match
   or is absent.
4. **Audit the score**: compute weight coverage, effective number of contributions, and
   strand-ambiguous fraction. Refuse when weight coverage falls below `--min-weight-coverage`.
5. **Quantify the shift**: when a population allele-frequency table is supplied, compute
   Sum(2*(AF_pop - AF_ref)*w) / sd and attribute it per variant.
6. **Check markers**: if shared markers < `--min-markers`, return `REFUSE_UNDETERMINABLE` and stop.
7. **Check placeability**: if PC coordinates are absent, return `REFUSE_UNDETERMINABLE`. Never
   impute missing coordinates.
8. **Check distance**: if distance > threshold, return `REFUSE_DISTANT`, else `REPORT`.
9. **Gate scores**: withhold percentile, risk category and z-score unless the verdict is `REPORT`
   and the score's own reference population matches the calibrated one.
10. **Report**: write both reports, `result.json`, figures, tables and the reproducibility bundle.

## CLI Reference

```bash
# Standard usage. Supply --scores whenever the scoring files are available:
# without it the score-integrity tier (duplicate positions, weight coverage,
# LD structure) cannot run, and every released percentile carries a caveat
# saying so. A score listed in prs_results.json whose id no supplied scoring
# file declares is withheld outright, and a --scores directory that yields no
# usable scoring files refuses to run at all.
python skills/prs-abstain/prs_abstain.py \
  --reference-panel panel.csv --individuals people.csv \
  --prs-results prs_results.json --scores scores_dir/ --output report_dir

# Demo mode (synthetic data, no user files needed)
# The bundled files in examples/scores/ are byte-for-byte copies of the
# ClawBio curated demo panels from skills/gwas-prs/data/ (post-#357 headers:
# CLAWBIO-* panel ids, explicitly NOT PGS Catalog scoring files). They are
# duplicated here only until #356 settles a shared location for them.
python skills/prs-abstain/prs_abstain.py --demo --output /tmp/prs-abstain-demo

# Tuning
python skills/prs-abstain/prs_abstain.py --demo --output /tmp/d --ref-pop EUR --k-sd 3.0 --min-markers 30
```

### Useful flags

| Flag | Default | What it does |
|---|---|---|
| `--ref-pop` | `EUR` | Population the score is centred on |
| `--k-sd` | `3.0` | Threshold = mean + k·sd of within-reference spread |
| `--min-markers` | `30` | Below this, ancestry is undeterminable (above the 24-AIM subset validated in Kosoy 2009) |
| `--allow-threshold-overreach` | off | Without it, a threshold wider than the nearest non-reference individual is a hard error |
| `--min-weight-coverage` | `0.90` | Fraction of a score's total weight that must be genotyped |
| `--genotype-sample-id` | none | Which individuals-CSV row the `--genotype` file belongs to; required when the CSV has more than one row, so one genotype never gates anyone else |
| `--min-effective-n` | `10` | Warn below this many independent contributions |
| `--genotype-build` | none | Genome build of the genotype file (e.g. `GRCh37`). Checked against each score's declared build; a mismatch refuses. Without it the unverified build is disclosed in both reports |
| `--af-population` | `AFR` | Population column to re-centre on |
| `--population-af` | none | TSV `rsid, population, frequency[, allele]`. Name the allele the frequency counts; without it, any rsid whose effect allele differs between the supplied scores is skipped rather than re-centred with a guessed sign |

From ClawBio/ClawBio, MIT.

More from ClawBio/ClawBio

Signals

Stars
1,166
Forks
288
Open issues
27
Last commit (this folder)
Oct 13, 2026 (17 days ago)
Last release
Sep 11, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
0.4.0
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get prs-abstain running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying prs-abstain?

CallGet help
Cite this page

prs-abstain skill. Agent Mart. https://agentmart.dev/skills/clawbio-prs-abstain (last updated 2026-10-24)