In Silico · system structure
Multi-Agent Orchestration for Rare Disease Diagnosis
Separate roles annotate variants, rank candidate genes and propose ACMG criteria. A separate auditor rechecks every claim before it can reach a report.
What this work is
This work turns the rare-disease diagnosis task into two runnable pipelines: separate roles annotate variants from a VCF (variant call file), rank candidate genes from HPO (Human Phenotype Ontology) terms and propose ACMG/AMP criteria (the standard evidence codes for classifying variants), and a separate auditor rechecks the result before it can be reported. In the synthetic unit every role is deterministic code and no model API is called. In the public-record unit the evidence agents, the default curation rule engine, the audit gate and the final adjudication are also deterministic code; language models appear only as the literature reader, its second reader from another model family, and a small trial that put a model in the curation seat.
Scope The synthetic unit runs on a few fixed synthetic VCF cases with a made-up evidence registry; the public-record unit runs on ClinGen expert-panel variants joined to ClinVar (a public archive of variant interpretations), gnomAD frequencies, HPO annotations, published text, and patients simulated from those records. Neither unit uses a real patient, measures clinical performance or carries a human auditor's sign-off.
D3 · Synthetic replay · rare19
Synthetic replay with audit gates
Checks, on fixed synthetic cases, that separated roles produce a run that a separate auditor can recompute and then pass or reject gate by gate. It tests whether role separation and the audit work as built, not diagnostic ability.
- Data curatorLock file, reference tables and synthetic VCFs in fixtures/ → Validated snapshot: cases, HPO graph, diseases, registries
- Variant annotation roleOne case's variant keys and the annotation table → One annotation row per variant, matched or empty
- Phenotype ranking roleObserved and absent HPO terms, annotated variants, disease table → Ranked genes with score, tied best diseases, variant keys
- ACMG evidence proposal roleAnnotated variants and the synthetic evidence registry → Evidence rows: code, kind, source ID and version
- RunnerValidated snapshot → Run document: annotations, rankings, evidence rows, hash
- Independent HPO re-rankingValidated snapshot and a case ID → A ranking to compare with the submitted one
- Independent auditorRun document, fixtures and the held-out answer file → Audit document: gate status and reasons, pass or fail
| Component | What it does | Input → output | Code |
|---|---|---|---|
| Data curator | Checks the lock file's pinned SHA-256 and each input file's hash, then validates links between tables and VCFs. Stops on any mismatch; never reads the held-out answers. | Lock file, reference tables and synthetic VCFs in fixtures/ → Validated snapshot: cases, HPO graph, diseases, registries | rare19/ |
| Variant annotation role | Joins a variant to the synthetic registry only when build, chromosome, position, REF and ALT all match. Keeps unmatched variants with an empty annotation; infers nothing. | One case's variant keys and the annotation table → One annotation row per variant, matched or empty | rare19/ |
| Phenotype ranking role | Scores each candidate gene's diseases by exact and ancestor HPO matches, subtracts for findings recorded absent, and ranks genes keeping ties. Computes no inheritance. | Observed and absent HPO terms, annotated variants, disease table → Ranked genes with score, tied best diseases, variant keys | rare19/ |
| ACMG evidence proposal role | Copies criterion codes and evidence keys from the frozen synthetic registry for the annotated variants. May not add free text, create evidence or state an interpretation. | Annotated variants and the synthetic evidence registry → Evidence rows: code, kind, source ID and version | rare19/ |
| Runner | Calls the roles in a fixed order for every case and writes one run document sealed with a SHA-256 of its body. Calls no model API; needs neither auditor nor answers. | Validated snapshot → Run document: annotations, rankings, evidence rows, hash | rare19/ |
| Independent HPO re-ranking | Inside the auditor, recomputes each case's gene ranking another way: descendants of disease terms, not ancestors of observed terms. Never calls the runner's code. | Validated snapshot and a case ID → A ranking to compare with the submitted one | rare19/ |
| Independent auditor | Rechecks the run in four gates: frozen inputs, attribution of annotations and evidence, held-out answers, own ranking and hash. Does not import the runner; signs nothing. | Run document, fixtures and the held-out answer file → Audit document: gate status and reasons, pass or fail | rare19/ |
Flow
- The runner loads the fixtures through the data curator, which checks every hash and cross-reference before any role runs.
- For each case the annotation role joins the VCF variants to the synthetic registry by exact key.
- The phenotype role ranks the annotated genes from the case's HPO terms, and the evidence role copies the registered ACMG evidence rows for the same variants.
- The runner writes all cases into one run document and adds a SHA-256 of the body.
- A separate audit command reads that document; gates G1 and G2 check inputs and structure, then compare every annotation and evidence row with the registry.
- Gate G3 scores the auditor's own ranking against the held-out answers, and gate G4 requires the submitted run to equal the auditor's rebuilt result and hash.
- At the first failed gate the auditor records the reason, marks the remaining gates as not run, sets the status to fail and exits with a non-zero code.
What is guarded
- Role separation: the runner's roles and the auditor are separate modules, the auditor does not import the runner, and only the auditor reads the held-out answer file.
- Frozen inputs: the lock file's SHA-256 is pinned in code and each file's hash is checked, so a changed file or a re-hashed lock file stops the run.
- Provenance: each evidence row must name the registered source and version and point to an annotated variant and a disease of the same gene, and its code must agree with its evidence kind.
- Rejection rules: the auditor rejects unknown, missing or duplicate rows, extra fields such as an inserted conclusion, repeated codes, and the conflicting pairs PP3 with BP4 and PS3 with BS3.
- Independent recomputation: the auditor rebuilds the whole expected result, with the ranking computed by a different method, and passes the run only if the canonical bytes and SHA-256 match; a tie at the cut-off counts only when the whole tied group fits within the top five.
- Tamper tests: unit tests feed altered inputs and submissions (a changed file, an invented code, a different source version, an inserted conclusion, a rewritten rank) and require rejection at the expected gate.
Not built or not run
- No language model takes part: every role is a deterministic function, so this unit shows role separation and audit, not model behaviour.
- The runner and the auditor share the input loader and VCF parser and run with the same file permissions; the held-out file is not kept in a blinded environment, a separate host or a container.
- The human auditor signature field is always left empty, and no external timestamp or sign-off is produced.
- The VCF reader accepts only passing, biallelic single-nucleotide site rows marked as synthetic; genotype columns, multi-allelic records, indels, structural variants and real variant calling are not supported.
- ACMG codes here only link a code name to a synthetic evidence kind; the unit does not judge whether a code applies clinically, weigh strengths or classify a variant as pathogenic.
Result and documents
The runner annotates variants from a fixed VCF subset and ranks candidate genes from HPO phenotypes; a separate audit command rechecks evidence codes, ranks and input hashes. 2 of 4 synthetic cases reached the top five. A tie counts only if the whole tied group fits within five places.
Synthetic inputs only (synthetic_only). Scope: synthetic inputs and evidence-code review. Patient VCFs, clinical performance and auditor sign-off are not included.
Measured values, limits and gates on the D3 record · Causal-Gene Ranking from Variants and Phenotypes
D3 synthetic replay record (KR) · Audit record (JSON) · Run output (JSON)
D3 · Public-record audit · acmg19
Public-record pipeline with ACMG audit
Takes a VCF and HPO terms through evidence-gathering agents, a curation agent that claims ACMG criteria, and an audit gate that lets only supported criteria reach the report. It is used to measure how the pipeline classifies expert-reviewed public variants and simulated patients, and whether the gate stops unsupported claims.
- Intake agentCase VCF and case file (proband, parents, sex, HPO terms) → Ledger items: genotype, zygosity, parental genotypes
- Annotation agentCarried variants and the frozen knowledge store → Ledger items per variant and gene, with source and locator
- Phenotype agentPatient HPO terms and HPO disease annotations → Ledger items: phenotype match per candidate gene
- Inheritance agentProband and parental genotypes, established variant records → Ledger items: inheritance pattern, second allele
- Literature agentReader findings, text-window store, second-reader verdicts → Ledger items: functional assay, segregation, second allele
- Curation agentEvidence ledger grouped by variant and gene → Claim set: criteria, cited evidence IDs, classification
- Audit gateExported ledger and claim set → Verdict and reason per criterion, audited classification
- AdjudicationAudit report, carried variants, phenotype ranking → Report: positive or negative, candidate genes with reasons
| Component | What it does | Input → output | Code |
|---|---|---|---|
| Intake agent | Reads the VCF, splits multi-allelic records, trims alleles to minimal form and keeps only those the proband carries. Records genotypes; interprets nothing. | Case VCF and case file (proband, parents, sex, HPO terms) → Ledger items: genotype, zygosity, parental genotypes | acmg19/ |
| Annotation agent | Attaches facts from the frozen store: consequence, frequency, prediction scores, gene records. Never uses the variant's own ClinVar classification; no live lookups. | Carried variants and the frozen knowledge store → Ledger items per variant and gene, with source and locator | acmg19/ |
| Phenotype agent | Ranks genes by information-content similarity of patient HPO terms to disease annotations; records rank, score and matched terms for candidates. Classifies no variant. | Patient HPO terms and HPO disease annotations → Ledger items: phenotype match per candidate gene | acmg19/ |
| Inheritance agent | Reads from trio genotypes: de novo, homozygous, or a second established pathogenic allele in the gene. Without parents it records phase as unknown, not a guess. | Proband and parental genotypes, established variant records → Ledger items: inheritance pattern, second allele | acmg19/ |
| Literature agent | Admits a language-model reader's findings, citing text-window IDs, only if a rule check and a second reader of another model family both accept. No ready-made evidence. | Reader findings, text-window store, second-reader verdicts → Ledger items: functional assay, segregation, second allele | acmg19/ |
| Curation agent | Claims ACMG criteria and a five-tier class per variant, citing ledger item IDs. Cannot write to the ledger. A rule engine by default; a language model was also tried. | Evidence ledger grouped by variant and gene → Claim set: criteria, cited evidence IDs, classification | acmg19/ |
| Audit gate | Verifies the ledger, checks each claimed criterion against its cited items and recomputes the class from accepted criteria only. Callers cannot skip the ledger check. | Exported ledger and claim set → Verdict and reason per criterion, audited classification | acmg19/ |
| Adjudication | Builds candidate diagnoses from audited classes, genotype fit to the gene's inheritance mode and phenotype rank. Uses audited results only; blocked claims never reach it. | Audit report, carried variants, phenotype ranking → Report: positive or negative, candidate genes with reasons | acmg19/ |
Flow
- The orchestrator opens an empty append-only ledger for the case and runs intake, annotation, phenotype, inheritance and literature in that order, each adding evidence.
- Every item gets an ID derived from the SHA-256 of its content and carries the name and locator of its source.
- The ledger is exported and handed to the curation agent, which returns claims that cite item IDs.
- The audit gate checks the ledger, accepts or blocks each criterion with a reason, and recomputes each variant's class from the accepted criteria.
- A blocked claim set can go back to the curation agent once with the reasons; whatever is still blocked is left out of the report.
- Adjudication combines audited classes with genotype fit and phenotype rank into the report, returned with the trace, ledger, claims and audit.
- A separate evaluation script replays this on frozen inputs and injects faults, and a summary script recomputes the status gates G1 to G4 from the stored result.
What is guarded
- Role separation: only the evidence agents write to the ledger; the curation agent only makes claims, and the gate rejects a whole ledger that holds an item from any other agent.
- Provenance: item IDs are content hashes, so editing an item changes its ID and an invented ID cannot be cited; the gate rejects any ledger whose items do not match their IDs.
- Independent audit: a criterion passes only if the code exists and is not retired, the strength is allowed, the cited items are in the ledger and belong to that variant or gene, the required evidence kinds are present, and the values meet the rule at no more than the supported strength; the class is then recomputed from accepted criteria alone and a different claimed class is flagged.
- Literature double check: a finding needs the rule check (its cited window belongs to the variant and carries the needed wording) and an explicit supported verdict from a second reader of another model family; its ID is a hash of the claim, so an edited claim loses its verdict.
- Fault injection: one unsupported statement at a time is put into honest claim sets, ledger values are edited, items from an untrusted agent are added and false findings are fed to the literature check; the summary marks the audit failed if any of these gets through or if honest claims are blocked.
- Frozen inputs and held-out genes: input files are frozen with recorded SHA-256 values that the summary checks, and rules were adjusted on development genes only, with held-out genes kept for the final measurement.
Not built or not run
- No real patient, clinician review or clinical performance test is part of this unit, and the human auditor signature field is empty.
- In the main measurements the curation agent is the deterministic rule engine. The language-model curator was a small trial run through Claude Code subagents with stored replies; the direct API route in model_runs.py is written but has not been run.
- The orchestrator has a hook for returning blocked claims once, but neither the command line nor the evaluation supplies a reviser; the revision round was run separately on the stored model replies.
- The literature step ran on a sample of variants, not all of them; it admits functional and segregation findings at supporting strength only, and does not yet read table headers or count affected patients for PS4.
- The rule table lists criteria such as PS2, PM1 and BS2 whose evidence kinds no agent writes, so the pipeline cannot apply them; panel-specific frequency thresholds and negative cases on a real exome background are also listed as remaining work.
Result and documents
Every ACMG criterion an agent claims is checked against an evidence ledger built from public records before it can reach a report. On 20 held-out genes the pipeline kept 1,323 of 1,324 expert-benign variants out of the pathogenic classes (99.92%) and called 475 of 1,890 expert-pathogenic variants pathogenic or likely pathogenic (25.13%). The audit gate stopped 8,641 of 8,641 injected unsupported claims and blocked 0 of the 160,899 criteria derived from the ledger.
Public records and simulated patients (public_records_and_simulated_patients). Figures come from ClinGen, ClinVar, gnomAD, HPO and published text, and from patients simulated out of those records. No patient data were used and no clinical performance was measured. No human auditor has signed.
Measured values, limits and gates on the D3 record · Causal-Gene Ranking from Variants and Phenotypes
D3 ACMG audit gate: method and replay record (KR) · D3 ACMG audit gate: cross-model review record (KR) · Audit record (JSON) · Run output (JSON)
How to read this screen
This screen describes structure: the parts, the order work passes through them and what each run is checked against. It carries no measured value of its own. The figure in each result paragraph is filled from the audit file when the site is built, and every component names the code that does the work.