Population frequency and inheritance — scope
Status: Draft scope (not yet approved for build) Date: 2026-07-29
Problem
Two columns exist, are documented as meaning one thing, and either hold something else or hold nothing at all.
variants.alleleFrequency is commented in the schema as "population AF
(gnomAD)". Its only writer is the VCF parser, which reads INFO/AF — the
caller's allele frequency for that sample or cohort, which for a single-sample
VCF is frequently just the observed allele balance. That is a different quantity
from the fraction of the population carrying the allele, and the genetics page
renders it as "Pop. freq" regardless. For a VCF with no AF key the column
stays null forever, which is the honest case by accident.
variantAssociations.inheritance has eight enum values and defaults to
unknown. The only writer is the manual addAssociation form. Nothing derives
it, so in any record built by import rather than by hand it is unknown on
every row — and inheritance is precisely what decides whether a heterozygous
pathogenic call means carrier or affected. Without it the record cannot make
the distinction that matters most to the person reading it.
Neither field can be filled by the current annotation path. ClinVar E-utilities
esummary returns classification, review status and gene; Ensembl VEP returns
consequence and gene symbols. Neither returns population frequency, and neither
returns mode of inheritance.
Separate the two frequencies
Do not overload one column. A caller AF and a population AF answer different questions, and a reader cannot tell which one a bare number is.
Either two columns, or one column plus a source discriminator — the latter
matching the match: exact | approximate qualifier already used on
substances, where the same lesson was learned about mappings. The display must
name which it is showing. "Pop. freq" over a caller AF is a wrong label on a
number a clinical decision might rest on.
gnomAD
Free, no key, GraphQL at gnomad.broadinstitute.org/api. Fits the existing
cachedFetch integration pattern with the same 30-day TTL as the ClinVar and
VEP clients, and the same best-effort failure rule: an unavailable upstream
yields a partial annotation, never a failed import.
The prior art concluded gnomAD was unusable. It was wrong, and the reason matters. That workspace ran four separate scripts and every lookup returned not-found, including for variants as common as CYP2C9 rs1799853; its summary blames "coordinate mismatch (GRCh37 vs GRCh38) OR API indexing issues" and falls back to manual web lookups.
Neither. The queries asked variant_search for fields that type does not
expose — chrom, pos, ref, alt, rsids, genome, exome — so the API
returned HTTP 400 with a schema error, the surrounding try swallowed it, and
every variant reported as absent. Verified 2026-07-29: variant_search returns
exactly one field, variant_id, and the working shape is two hops.
variant_search(dataset: gnomad_r4, query: "rs1799853") → "10-94942290-C-T"
variant(dataset: gnomad_r4, variantId: "10-94942290-C-T")
→ genome { ac 13400 an 152164 af 0.0881 }
exome { ac 171842 an 1461608 af 0.1176 }
Take the general lesson before the specific one: a best-effort integration that swallows upstream errors reports "no data" and "the query was malformed" identically. The existing ClinVar and VEP clients have the same shape, for the good reason that an import must not fail on an unavailable upstream — but an empty result needs to be distinguishable from a broken request, or a bug reads as a finding for a year.
The build question is still live, just not the cause. gnomAD v4 is GRCh38 and
the record holds GRCh37 variants. Query by rsID where one exists; for a GRCh37
variant with no rsID, record the lookup as unavailable pending conversion.
flagLiftover already refuses to compute coordinates without chain files, and
this must not become the exception that does it quietly.
The frequency rule, and where it breaks
The prior-art triage table is the single most useful idea in that workspace:
| Population AF | Reading |
|---|---|
| > 1% | Too common to cause a rare, highly penetrant disease |
| 0.5–1% | Borderline; usually benign |
| 0.1–0.5% | Consistent with a carrier frequency |
| < 0.1% | Consistent with a pathogenic rare variant |
| Absent, with ≤1-star evidence | More likely an assay artefact than a finding |
It is wrong as a flat rule, and wrong exactly where this record will use it. The threshold depends on the disease model — prevalence, penetrance and inheritance mode. Recessive conditions with high carrier frequencies break it immediately: HFE C282Y sits around 6% allele frequency in Northern European populations and is genuinely the pathogenic hereditary haemochromatosis allele. A flat ">1% cannot be pathogenic" rule discards it, and carrier findings are half the point of the feature.
So the rule is admissible as evidence displayed beside a classification, and inadmissible as an automatic reclassification. This matches the four-layer model the schema already commits to: the observed variant, the interpretation, the evidence, and the personal status are separate, and evidence that contradicts an interpretation is shown as a contradiction rather than resolved silently. The app never rewrites a ClinVar classification; it says that a 3% population frequency and a "pathogenic, single submitter" assertion do not sit comfortably together, and lets a person take that to a clinician.
Thresholds are therefore presentation, not truth, and must be stated as such wherever they appear — including the ancestry caveat, since gnomAD's global AF can be an order of magnitude away from the relevant population's.
Inheritance mode
No bulk download is required for this. The esummary call the app already
makes does not carry inheritance, which is why the field has stayed empty — but
efetch with rettype=vcv does, on the same keyless E-utilities service the
ClinVar client already uses. Verified 2026-07-29 against rs1800562, which
returns Type="ModeOfInheritance" → Autosomal recessive inheritance, correct
for hereditary haemochromatosis.
The cost is response size: ~455 KB of XML per variant against ~2 KB for a summary. That is fine at VCF scale behind the existing 30-day cache, and hopeless at array scale. So inheritance is fetched per variant, on the same best-effort terms as every other annotation, and the ClinVar bulk distribution enters the picture only for the whole-panel case in the array import scope — provisioned locally, never committed, feature-detected at runtime, exactly as the terminology scope does it. Nothing in basic function may depend on it.
ClinVar is US Government work in the public domain, so unlike the PharmGKB data in the pharmacogenomic scope there is no redistribution obstacle in principle — only a size one.
Note that a variant can carry several inheritance modes across several conditions. The field belongs on the association, where it already is, and not on the variant — the existing schema has this right.
Open questions
- Which gnomAD dataset — v4 joint, exomes, or genomes? They disagree, and for an array-derived variant the exome set may not cover the position at all.
- Population-specific AF, or global only? Global is misleading for exactly the ancestry-specific alleles where the question is sharpest, but storing all ancestry breakdowns per variant is a large widening of the schema.
- Is "absent from gnomAD" storable as distinct from "not looked up"? It carries real information and a null cannot express it.
- ClinVar's
inheritance_modesis free text of varying vocabulary; mapping it onto the eight-value enum will not be total. What happens to the remainder — and does this become a first customer for the concept map in the terminology layer? - Does a contradiction between frequency and classification deserve its own alert, alongside reinterpretation alerts, or is it only ever shown in place?
Not in scope
Automatic reclassification of any variant. Coordinate liftover. Shipping any ClinVar or gnomAD artifact in the repository. Ancestry inference from the record in order to pick a population — the profile may state ancestry, the app may not deduce it.
Relationship to the other plans
Depends on nothing. Pairs with evidence confidence gating, which hedges on how well supported a claim is, where this scope hedges on whether the claim is demographically plausible — two independent axes of doubt that should not be merged into one score. Becomes considerably more valuable after array import, which is the case that generates large numbers of thin pathogenic calls needing exactly this filter.