clinical-variant-prioritizer
Turn a genotype set into a prioritised list of clinically relevant variants, the
way a clinical genome analyst would: screen catalogued disease-gene panels,
then rank what is carried by how much it matters, not by how loud the raw
ClinVar label is.
This skill implements the pathogenicity-screening stage of Whole Genome
Interpretation for a Family of Five (Corpas et al., Front Genet 2021): variants
are filtered through OMIM-morbid, ACMG-SF and Hereditary-Cancer
panels, intersected with ClinVar significance and gnomAD population
frequency, and classified by inheritance model and zygosity.
Why it is not a raw ClinVar lookup
A raw lookup reports a label. This skill reports actionability. The same
"pathogenic" allele means very different things depending on context:
| Context |
Category |
| Dominant / risk gene, allele carried |
actionable |
| Recessive gene, homozygous |
affected |
| Recessive gene, heterozygous |
carrier (reproductive-risk only) |
| Uncertain / conflicting ClinVar |
uncertain (flagged, not acted on) |
| Benign allele carried |
benign |
| Variant not carried |
reference |
A heterozygous carrier of a common, recessive, benign-spectrum allele is not
an actionable finding, even when ClinVar shows "pathogenic" submissions. Saying
so plainly is the point.
Interface
from api import run
result = run(
{"rs28941785": "CT", "rs1800562": "GG"}, # rsid -> genotype
options={"panel_path": "..."}, # optional custom panel
)
run() returns:
summary: panel_size, loci_tested, loci_carried, reference,
not_tested, and per-category counts (actionable, affected, carriers,
uncertain, benign).
findings: ranked list (highest priority first); each carries gene, HGVS,
consequence, genotype, zygosity, ClinVar significance + review status, gnomAD
frequency, condition, inheritance, panel membership, category and a
plain-language rationale.
headline, method, disclaimer.
Panel
data/clinical_panel.json is a curated set of catalogued clinical loci, each
shipping its ClinVar significance, ClinVar review status, gnomAD frequency,
consequence, condition and inheritance model, so the screen is deterministic and
offline-reproducible (no per-call ClinVar/gnomAD/VEP network round-trips). Extend
it by adding entries; keys may be rsids or stable variant ids for WGS-only
variants not present on arrays.
Limitations
Array-based input covers only catalogued loci and misses most rare variants; a
clean screen is not a clean genome. Heterozygous calls do not establish phase.
Confirm any finding with an accredited clinical assay. Research and educational
use only; not a clinical diagnosis.
Test
python -m pytest tests/ -q
1---2name: clinical-variant-prioritizer3description: Screen a genotype set (array or WGS-derived) against OMIM-morbid, ACMG-SF and Hereditary-Cancer gene panels and prioritise carried variants by ClinVar significance, gnomAD frequency, inheritance model and zygosity, following the pathogenicity-screening method of Corpas et al. 2021 (Whole Genome Interpretation for a Family of Five).4license: MIT5---6
7# clinical-variant-prioritizer
8
9Turn a genotype set into a prioritised list of clinically relevant variants, the
10way a clinical genome analyst would: screen catalogued disease-gene panels,
11then rank what is carried by **how much it matters**, not by how loud the raw
12ClinVar label is.
13
14This skill implements the pathogenicity-screening stage of *Whole Genome
15Interpretation for a Family of Five* (Corpas et al., Front Genet 2021): variants
16are filtered through **OMIM-morbid**, **ACMG-SF** and **Hereditary-Cancer**
17panels, intersected with **ClinVar** significance and **gnomAD** population
18frequency, and classified by **inheritance model** and **zygosity**.
19
20## Why it is not a raw ClinVar lookup
21
22A raw lookup reports a label. This skill reports *actionability*. The same
23"pathogenic" allele means very different things depending on context:
24
25| Context | Category |
26|---|---|
27| Dominant / risk gene, allele carried | `actionable` |
28| Recessive gene, homozygous | `affected` |
29| Recessive gene, heterozygous | `carrier` (reproductive-risk only) |
30| Uncertain / conflicting ClinVar | `uncertain` (flagged, not acted on) |
31| Benign allele carried | `benign` |
32| Variant not carried | `reference` |
33
34A heterozygous carrier of a common, recessive, benign-spectrum allele is *not*
35an actionable finding, even when ClinVar shows "pathogenic" submissions. Saying
36so plainly is the point.
37
38## Interface
39
40```python
41from api import run
42
43result = run(
44 {"rs28941785": "CT", "rs1800562": "GG"}, # rsid -> genotype
45 options={"panel_path": "..."}, # optional custom panel
46)
47```
48
49`run()` returns:
50
51- `summary`: `panel_size`, `loci_tested`, `loci_carried`, `reference`,
52 `not_tested`, and per-category counts (`actionable`, `affected`, `carriers`,
53 `uncertain`, `benign`).
54- `findings`: ranked list (highest priority first); each carries gene, HGVS,
55 consequence, genotype, zygosity, ClinVar significance + review status, gnomAD
56 frequency, condition, inheritance, panel membership, category and a
57 plain-language `rationale`.
58- `headline`, `method`, `disclaimer`.
59
60## Panel
61
62`data/clinical_panel.json` is a curated set of catalogued clinical loci, each
63shipping its ClinVar significance, ClinVar review status, gnomAD frequency,
64consequence, condition and inheritance model, so the screen is deterministic and
65offline-reproducible (no per-call ClinVar/gnomAD/VEP network round-trips). Extend
66it by adding entries; keys may be rsids or stable variant ids for WGS-only
67variants not present on arrays.
68
69## Limitations
70
71Array-based input covers only catalogued loci and misses most rare variants; a
72clean screen is not a clean genome. Heterozygous calls do not establish phase.
73Confirm any finding with an accredited clinical assay. Research and educational
74use only; not a clinical diagnosis.
75
76## Test
77
78```bash
79python -m pytest tests/ -q
80```