Repository navigation
fix(PIPECHO): revive dead mass-error feature and drop raw/inverted RT from mbr_score - #9674
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe PR updates PIPECHO mass-error handling so ChangesPIPECHO mass-error flow and bootstrap scoring
Sequence Diagram(s)sequenceDiagram
participant ProteomicsLFQ as "ProteomicsLFQ::quantifyFraction_"
participant Util as "Util::feature_mass_error"
participant PeptideIdentification
ProteomicsLFQ->>Util: preserve masserror_ppm metadata
Util->>Util: read stored masserror_ppm values
Util->>PeptideIdentification: fall back when metadata is absent
PeptideIdentification-->>Util: observed m/z, sequence, charge
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/openms/source/ANALYSIS/MAPMATCHING/PIPECHO/Util.cpp`:
- Around line 64-85: The `Util.cpp` handling of `masserror_ppm` currently
assumes `errs.front()` is the monoisotopic error without verifying the
producer’s ordering contract. Trace the code path that calls
`setMetaValue("masserror_ppm", ...)` (especially `dia_massdiff_score` in
`DIAScoring`) and confirm whether index 0 is guaranteed to be the monoisotopic
isotope; if not, replace the `front()` shortcut with an explicit monoisotopic
check against the theoretical m/z or remove the assumption and use the
validated/ordered values only.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 31bdd535-c561-436e-aca9-6fd3485bfa1d
📒 Files selected for processing (3)
src/openms/source/ANALYSIS/MAPMATCHING/PIPECHO/RunStatistics.cppsrc/openms/source/ANALYSIS/MAPMATCHING/PIPECHO/Util.cppsrc/topp/ProteomicsLFQ.cpp
… from mbr_score PIP-ECHO's transfer-FDR SVM produced ZERO match-between-runs transfers on real ProteomicsLFQ data (PXD016921 single-cell, quantms#287) at every FDR cutoff. Root cause: two of its three scoring features were broken, which the #9661 SimpleSVM fix exposed (it previously rode on a feature-index-misalignment bug). mass_error was DEAD. RunStatistics calibrates the donor mass-error distribution via Util::feature_mass_error, which computed getPPM(feature.getMZ(), theoretical). But FeatureFinderIdentification seeds the feature's position m/z to the peptide's THEORETICAL m/z, so this is identically 0 for every donor: the calibration distribution is degenerate, calc_score_using returns a constant MIN_SCORE, and SimpleSVM drops the feature as uninformative. The real observed mass accuracy is carried in the feature's "masserror_ppm" meta (the OpenSWATH DIA mass-difference score = getPPM(observed, theoretical) per isotope), which ProteomicsLFQ stripped before grouping. Fix: whitelist "masserror_ppm" in keep_meta ONLY on the pip_echo path (it is needed solely by PIP-ECHO; keeping it on the default QT-linker path leaks it into the consensusXML/mzTab output and shifts the TOPP_ProteomicsLFQ references), and read it in feature_mass_error (monoisotopic-first; -1 is a "no signal" sentinel matched exactly, so genuinely negative errors are kept; precursor-m/z then feature-m/z fallbacks). This mirrors FlashLFQ, which calibrates its ppm distribution from the observed mass errors of identified peaks. rt_diff_error was RAW and INVERTED in the geometric-mean mbr_score: it multiplied in the raw absolute RT difference (0-1200+ s, magnitude-dominating) with inverted monotonicity (a larger RT error increased the score), poisoning best-acceptor selection and the round-1 bootstrap. Drop RT from the geomean (it is still given to the SVM as a feature). A faithful calibrated RT-agreement score (FlashLFQ's anchor-peptide RT prediction-error distribution) is a follow-up; see #9655. Effect on the PXD016921 benchmark: PIP-ECHO goes from 0 transfers at every FDR to FDR-controlled MBR -- at PipEcho:fdr=0.05, 1280 transfers at ~5% realized FDR, adding +392 peptides to the deep run while the empty Blank stays clean (+2). Both PipEchoAlgorithm tests pass; the keep_meta change is output-neutral (masserror_ppm is dropped at the consensus level, so the default pip_echo=false path is unaffected). Co-Authored-By: Claude Opus 4.8 <[email protected]>
f04bb33 to
515d372
Compare
…O fixes) (#9677) Documents two PIP-ECHO improvements merged on 2026-06-27: - #9674: revive dead mass_error feature and drop raw/inverted RT from mbr_score - #9676: isotope-distribution envelope correlation as a new SVM-only MBR feature Claude-Session: https://claude.ai/code/session_01GRoRx9TnjaBjfuBWT8umia Co-authored-by: Claude <[email protected]>
fix(PIPECHO): revive the dead mass-error feature and drop raw/inverted RT from
mbr_scoreSummary
On real
ProteomicsLFQdata, PIP-ECHO (-pip_echo true) produced zeromatch-between-runs transfers at every FDR cutoff. Two of its three scoring
features were broken; the recently-merged #9661
SimpleSVMfix exposed it (theold behaviour rode on a feature-index-misalignment bug that manufactured spurious
separation). This PR fixes the two feature bugs.
How it was found
Replicating the PXD016921 single-cell blank-leakage benchmark (the quantms
#287 dataset) on landed
develop:PIP-ECHO transferred 0 features at
fdr= 0.01 / 0.05 / 0.10. Bisectionpinned the change to #9661; instrumenting the per-feature target/decoy AUC on real
data showed no feature separated (mass 0.50, intensity 0.52, RT 0.49). That
led to the two root causes below.
Root causes
1.
mass_errorwas a dead (constant) featureRunStatistics::init_mass_errorcalibrates a donor mass-error distribution viaUtil::feature_mass_error, which computedgetPPM(feature.getMZ(), theoretical).But
FeatureFinderIdentificationseeds the feature's position m/z to thepeptide's theoretical m/z, so this is identically 0 for every donor. The
distribution is degenerate →
calc_score_usingreturns a constantMIN_SCOREfor every acceptor →
SimpleSVMlogsPredictor 'mass_error' is uninformativeand drops it.
The real observed mass accuracy is already computed and stored on the feature as
the
masserror_ppmmeta (the OpenSWATH DIA mass-difference score,getPPM(observed, theoretical)per isotope) — butProteomicsLFQstrips itbefore grouping.
Fix: whitelist
masserror_ppminkeep_meta, and read it infeature_mass_error(monoisotopic-first; the-1"no signal" sentinel matchedexactly so genuinely-negative errors are kept; precursor-m/z then feature-m/z
fallbacks). This mirrors FlashLFQ, which calibrates its ppm distribution from the
observed mass errors of identified peaks.
2.
rt_diff_errorwas raw and inverted inmbr_scoreThe geometric-mean
mbr_scoremultiplied in the raw absolute RT difference(0–1200+ s, so it dominates the product by magnitude) with inverted
monotonicity — a larger RT error increased the score. Because
mbr_scoredrives best-acceptor selection and the round-1 bootstrap seed, this corrupted
both. On pre-aligned runs the in-window decoys share the targets' RT range, so RT
is also a weak discriminator here.
Fix: drop RT from the
mbr_scoregeomean (it is still handed to the SVM as afeature). A correctly calibrated RT-agreement score is deferred to #9655 (see
below).
Results (PXD016921, Blank = empty run, direct-ID floor 93 peptides)
developPIP-ECHO now performs genuine FDR-controlled MBR: transfers concentrate in the
data-rich runs (100-cell +888, 20-cell +317 features) while the empty Blank stays
clean (+4 transfers → +2 peptides). The FDR knob behaves monotonically
(Blank 65→98, sensitivity rising) — driven by real mass signal, not an SVM
artifact. The donor calibration is now
Normal(+1.91 ppm, 1.20), matching theacceptor target population (+1.49 ppm).
Validation
PipEchoAlgorithm_testandPipEchoAlgorithm_realistic_test(slow): pass.keep_metachange is output-neutral:masserror_ppmis dropped at theconsensus level (
FeatureHandleis not aMetaInfoInterface), so it neverreaches the
consensusXML. The defaultpip_echo=falsepath is unchanged.(Worth confirming
TOPP_ProteomicsLFQ_*in CI.)Scope / honesty
This recovers the mass signal; it is not FlashLFQ-level MBR. The OpenMS
port still scores only 3 of FlashLFQ's 5 features — the strongest
discriminators (isotopic-distribution similarity and MS1 scan count) are absent,
and RT is dropped rather than properly calibrated. An RT attribution run shows the
raw-RT variant is more sensitive (2048 vs 1280 at fdr=0.05) but leaks 2× into
the Blank (8 vs 4) via that arbitrary magnitude-dominating term — so RT does carry
signal and should be added back calibrated, not kept raw. All of this is
tracked in #9655.
Files
src/topp/ProteomicsLFQ.cpp—keep_meta += "masserror_ppm"src/openms/source/ANALYSIS/MAPMATCHING/PIPECHO/Util.cpp—feature_mass_errorreadsmasserror_ppmsrc/openms/source/ANALYSIS/MAPMATCHING/PIPECHO/RunStatistics.cpp— drop raw RT from thembr_scoregeomean🤖 Generated with Claude Code
Summary by CodeRabbit