just_dna_format.assertions¶
just_dna_format.assertions ¶
The source-independent clinical-assertion table (0.6, RM25).
clinical_assertions.csv is the sixth derived-fact sidecar. It records, per allele, what a clinical
archive says about it and how much review sits behind that — the clinical call, the review status
in the archive's own words, the star rating, and the archive's stable record id. Filled by
just-dna-enricher's ClinVar pass from an injected snapshot, consumed and hashed by the compiler,
never fetched by it.
Why it exists at all. A one-star single submission and a practice guideline are not the same
claim, and a compiled module flattened both to the same clin_sig. The workspace was already
computing the distinction and throwing it away twice: clinical.ClinSigFinding.confidence renders it
into a warning string, and draft_gene_panel uses the star rating as a filter (default 2 — multiple
submitters, no conflicts) and keeps nothing. A number this workspace computes and discards gets
recomputed by every consumer, and a recomputation is a place to drift.
It is not the cross-check, and it does not change it. clinical.verify_clin_sig compares the
author's clin_sig against ClinVar's and warns in both modes, deliberately, because failing would
make the format arbitrate a clinical dispute. This table records what ClinVar says; it adjudicates
nothing, and nothing here escalates that check.
Why review_stars is a stored column and not a derived property. The house pattern for a
convenience number is to store the exact parts and materialize the derivation (allele_frequency from
AC/AN, neg_log10_p from a mantissa and an exponent). The derivation here — CLNREVSTAT prose to a
0-to-4 rating — is a ClinVar convention, and Principle 2 keeps source conventions out of this tier
entirely. So both columns are stored, the enricher fills them from one mapping it owns
(clinvar_build.review_stars), and the schema tier holds only the bound 0 <= stars <= 4.
One row is one (allele, ClinVar record). Not one row per variant: ClinVar genuinely holds several
records for one allele under different conditions, which is why clinvar.lookup_clin_sig returns a
list and orders it best-reviewed first. Collapsing them here would pick a condition on the author's
behalf.
ClinicalAssertionRow ¶
Bases: BaseModel
One archive record about one allele: the call, the review behind it, and the record's id.
Standalone (not an AuthoredModel) for the same reason every fact row is — machine-produced
reference fact, not an authored annotation — with extra="forbid" so a typo'd column is caught
rather than silently dropped.