Repository navigation
quant: report MBR quantities at one consensus elution width per precursor - #150
Conversation
The extract fit picks the elution width per run from {0.7, 1, 1.4} x w_prior,
so one precursor's area A * w * sqrt(2 pi) jumps by 40 % between runs with
the width pick alone. Finalize now reports A * w_p * sqrt(2 pi) (and
amplitude_se * w_p * sqrt(2 pi)): w_p is the median over the precursor's
identified fits in aligned runs of w / f_r', carried into each run by that
run's local alignment slope. Unaligned runs and precursors without an
identified fit keep the per-run area; extract.parquet keeps the per-run
quantity.
The width grid {0.7, 1, 1.4} x w_prior quantises every fitted width to one of
three values, and the width-prior fits' binned medians collapse onto the
default. After the grid search the width is now refined at the winning apex by
a golden-section search on log w between the winning grid width's neighbours
(one grid step beyond the grid's ends), keeping the grid width unless the
search finds a higher LLR. fit and fit_many share the arithmetic, so they stay
identical.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
The extract fit picks each (precursor, run) elution width from the grid {0.7, 1, 1.4} × w_prior, so a precursor's reported area
A · w · √(2π)can jump by 40% between runs on the width pick alone. This PR fixes that in two steps:quant finalize). Reported quantities useA · w_p · √(2π), wherew_pis the median over the precursor's identified fits in aligned runs ofw / f_r', carried into each run by that run's local alignment slope. Transfers use the samew_p. Unaligned runs and precursors with no identified fit keep the per-run area.extract.parquetkeeps the per-run quantity for provenance. Documented in DOCS.md.quant extract). After the grid search, a golden-section search on log w refines the width at the winning apex. It searches between the winning grid width's neighbours, one step beyond the grid ends. The grid width is kept unless the search finds a higher LLR.fitandfit_manyshare the arithmetic and stay identical.ProteoBench LFQ DDA (6 Orbitrap runs, min_runs 3), one change per A/B
Same stage-1 search, library and alignment for every arm. Only extract and finalize differ.
Net vs main (MBR): median abs eps −11%, eq_species −17%, ECOLI −28%, CV −4%, +160 precursors.
A third candidate was tested and left out: a signal-dependent noise term in the isotope exclusion test, which fixed the test firing on 96% of identified peaks. It regressed accuracy against the second step on every metric (id median abs eps 0.2258→0.2271, eq_species 0.2535→0.2574, ECOLI 0.2814→0.2908, −92 id precursors), with +446 MBR precursors as its only gain. It needs more work before it ships.
Test plan
cargo clippy --workspace --all-targets -- -D warningscargo test --release --workspacewith the CI skips: 1,412 passed, 0 failed--ignored): 4 passedSummary by CodeRabbit