varianthound-data / docs /METHODS.md
Tinyants21's picture
Publish VariantHound dataset 0.8.0 from ac278a1fef6d22e3e6f803449cc71d971ad78117
f24acd6 verified
|
Raw History Blame Contribute Delete
4.78 kB
# Ranking methods
## Semantic similarity
For two phenotype terms, VariantHound uses Resnik similarity: the information content of their most informative common ancestor.
For two phenotype profiles, it calculates symmetric best-match average (BMA):
1. for every query term, find the most similar evidence term;
2. average those best matches;
3. repeat from evidence terms to query terms;
4. average both directions and normalize to 0–1.
The two directions prevent a large generic evidence profile from receiving an unfair advantage.
## Evidence fusion
Each gene receives independent canine, human, and mouse phenotype scores. They
are combined as the best weighted match plus corroboration at a discount: take
the weighted source scores in descending order `s1 >= s2 >= s3` and compute
```
1 - (1 - s1) x (1 - d.s2) x (1 - d^2.s3)
```
Read it as the chance that at least one species' annotation identifies this
gene, where a second and third agreeing species help with diminishing returns.
The rule is monotone in every source score, bounded in [0, 1], and depends on
nothing but the scores.
| Track | Weight |
|---|---:|
| Direct canine evidence | 1.000 |
| Human disease evidence | 0.833 |
| Mouse model evidence | 0.708 |
The corroboration discount `d` is 0.6, chosen by sweeping the benchmark rather
than by judgement: mean reciprocal rank runs 0.082, 0.087, 0.091, **0.095**,
0.083, 0.076 at d = 0.2, 0.3, 0.45, 0.6, 0.8, 1.0. Re-run `npm run sweep` after
any change to the evidence mix; the optimum moves with it.
### Why not reciprocal rank fusion
Earlier revisions used semantic-strength-weighted reciprocal rank fusion, which
added `weight x score^2 / (k + rank_within_source)`. It was retired because
rank within a source depends on how many candidates that source annotates at
all, and the sources differ by fortyfold — 354 canine profiles, 5,329 human
and 14,590 mouse in the current build. A gene with any canine annotation sat
near the top of a 300-long list almost by default, while a genuinely good human
match sat at rank 500 of twelve and a half thousand and earned nothing. On the
benchmark this let genes with zero human and zero mouse similarity win
outright, and it made *adding* mouse evidence halve discovery performance. The
implementation is retained as `reciprocalRankFusion` so the comparison stays
reproducible, but it is not used in production ranking.
## Evaluation modes
- **Mode 1 — clinical retrieval (`known`):** all available evidence is allowed. It measures retrieval of established knowledge, not discovery.
- **Mode 2 — discovery simulation (`discovery`):** canine evidence is withheld
in the data layer, before any profile or feature is constructed, under one of
two policies that are reported side by side and never combined.
- `no-canine` withholds every direct canine observation from every candidate.
This is the headline: it is the leave-the-species-out question the project
claims to answer.
- `own-disease` withholds only the canine records for the case's own
disorder. It sounds like the more realistic simulation, but it makes the
expected gene the single candidate guaranteed to have no canine evidence
while every competitor keeps theirs, so any rule that values canine
evidence penalises the right answer by construction. It is reported, and it
reads five times worse than `no-canine` for exactly that reason.
- **Mode 3 — temporal validation (`temporal`):** uses a pre-materialized historical knowledge snapshot and removes evidence that was unavailable after the cutoff. Undated evidence is excluded rather than guessed.
Temporal mode fails closed: the ranker refuses to run unless the dataset declares a snapshot cutoff no newer than the requested evaluation cutoff. This code-level check complements, but does not replace, source-release archiving in the ETL layer.
## Excluded phenotypes
Explicitly absent phenotypes produce a bounded penalty when they strongly match a gene's evidence profile. Absence is not treated as decisive because veterinary phenotyping is often incomplete and age-dependent.
## Interpretation
Scores are relative evidence-ranking scores. They are not calibrated probabilities, diagnostic conclusions, or variant classifications.
## Learned ranking gate
The deterministic weighted model is a valid final model. Learned ranking is attempted only after leakage filtering leaves enough independent diseases for nested disease-level and temporal evaluation. Random row splits, duplicate publications across folds, and tuning on the temporal test set are prohibited. A learned model is adopted only if the versioned [readiness and promotion gate](ML_READINESS.md) passes; otherwise the deterministic ranker remains the production method.