Skip to content

Germline accuracy validation (simulated diploid truth) + eval-germline - #26

Merged
logannye merged 4 commits into
mainfrom
rosalind/germline-accuracy
Jun 2, 2026
Merged

Germline accuracy validation (simulated diploid truth) + eval-germline#26
logannye merged 4 commits into
mainfrom
rosalind/germline-accuracy

Conversation

@logannye

@logannye logannye commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

Closes the reflection audit's #1 blind spot: the memory contract was validated, but the variant calls themselves had never been measured against ground truth (only simulated E. coli with no injected variants).

  • eval-germline CLI — generalizes the (already VCF-agnostic) somatic comparator into a shared run_eval and adds F1. This is the GIAB-ready interface: a real GIAB germline benchmark runs rosalind eval-germline --reference --calls --truth --regions <highconf.bed> against the same compare_callsets + BedIndex path.
  • tests/germline_accuracy.rs — a deterministic, download-free harness that injects known het/hom SNVs into a reference, builds diploid-sampled sorted BAMs directly (bypassing the toy aligner, so it measures the caller), calls, and compares PASS + all records to truth. Two regimes:
Regime metric precision recall F1
40× / 0.5% (clean) PASS 1.000 1.000 1.000
12× / 1.5% (stress) PASS 0.679 0.900 0.774
12× / 1.5% (stress) all (unfiltered) 0.290 1.000 0.449

Honest reading: exact on clean data; at low-cov/high-error the caller finds every true variant (all-recall 1.000) but the min_qual 30 / min_depth 8 PASS filter is what controls error-driven FPs (98→17). The deep-het probe (alt reads starting at the variant, under a cap below local depth) is recovered as a PASS call — the unbiased reservoir fix in an accuracy frame.

Spec: docs/superpowers/specs/2026-06-02-germline-accuracy-harness-design.md. Findings: docs/findings/2026-06-02-germline-accuracy.md.

Honest scope (documented): simulated (not GIAB), detection-only (pos+ref+alt; no genotype concordance), SNV-only. Real GIAB HG002 plugs into the same eval-germline interface and is the natural next increment (needs a downloaded pre-aligned BAM slice; out of scope here).

Test plan

  • cargo test --test germline_accuracy -- --nocapture — both regimes pass; numbers deterministic
  • cargo test green; cargo fmt --all -- --check clean; 0 warnings (debug + release)
  • Thresholds set a margin below the measured PASS values (non-flaky regression gate)

🤖 Generated with Claude Code

logannye and others added 4 commits June 2, 2026 10:21
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… report

Generalizes run_eval_somatic -> a VCF-agnostic run_eval used by both eval-somatic
and the new eval-germline subcommand, and adds F1 (2PR/(P+R)) to the printed
precision/recall report. eval-germline is the GIAB-ready interface: a real GIAB
germline benchmark uses 'rosalind eval-germline --reference --calls --truth
--regions <highconf.bed>' against the same compare_callsets + BedIndex path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…/recall/F1)

Injects known het/hom SNVs into a reference, builds diploid-sampled sorted BAMs
directly (bypassing the toy aligner -> measures the CALLER), calls, and compares
PASS + all records against truth via compare_callsets. Deterministic (fixed-seed
LCG). Two regimes, measured 2026-06-02:
- 40x/0.5% (clean): PASS precision 1.00, recall 1.00, F1 1.00
- 12x/1.5% (stress): PASS precision 0.68, recall 0.90, F1 0.77 (the min_qual 30 /
  min_depth 8 filter cuts error-driven FPs 98->17; unfiltered 'all' is 0.29/1.00)
Also asserts the deep-het probe is recovered as a PASS call under a cap below
local depth (the unbiased reservoir fix, in an accuracy frame). Closes the
audit's #1 blind spot: the caller's detection accuracy is now measured + gated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Records the measured precision/recall/F1: clean 40x/0.5% = 1.00/1.00/1.00;
stress 12x/1.5% PASS = 0.68/0.90/0.77. Honest scope: simulated (not GIAB),
detection-only, SNV-only; eval-germline is the GIAB-ready interface.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@logannye
logannye merged commit 165a6f1 into main Jun 2, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant