Repository navigation
[FEATURE] ProSE precursor:isotope_mimic: annotate or remove candidates whose isotope-like modifications an isotope-step precursor error explains - #10635
Conversation
…modifications an isotope-step precursor error explains Deamidation (+0.984 Da), N->D and Q->E sit 19 mDa from one 13C step: an unmodified peptide whose precursor was picked on its M+1 peak matches the 'modified' candidate within tolerance, and decoys cannot model this. With annotate:isotope_mimic, ProSE annotates each PSM with isotope_mimic = 1 when replacing its variable modifications within 0.05 Da of one or two isotope steps by whole steps gives a smaller precursor error, and adds it to the Percolator features. Default false. Ported from bigbio/andes #102/#152 (on Astral, 61% of accepted deamidations were isotope mis-picks). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01F73hZDwadLuUofLxkDHyVS
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 33 minutes. View limit details
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 |
|
Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1MRVABax5o7Y3ijLEcWj5
…efore ranking (andes#102) Benchmark of the first head (#10364 suite, 12 files, Deamidated N/Q): most accepted deamidations are isotope mimics, the right peptide in the wrong modification state, so neither decoys nor entrapment see them. As a Percolator feature the flag made Percolator prefer the mimic over its unmodified competitor (flagged accepted PSMs +41%, PSMs -0.3%). annotate:isotope_mimic (true/false) becomes precursor:isotope_mimic (off|annotate|remove, default off): - annotate: the isotope_mimic meta value, as before, but no longer a Percolator feature. - remove: isotope mimics are neither scored nor part of the candidate pool, so the unmodified candidate matched at the other isotope offset takes their rank, as andes#102 drops them. The number removed is logged. Closed search only. The mode is recorded in the search parameters unless off. New static ProSEAlgorithm::isIsotopeMimic(); class test for it and for the three modes in a search; TOPP test ProSE_13_isotope_mimic. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1MRVABax5o7Y3ijLEcWj5
…esults Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1MRVABax5o7Y3ijLEcWj5
|
Pushed
On the #10364 suite with Deamidated (N/Q), Generated by Claude Code |
What
|
Note for a later revisit: genuine deamidations lost by
|
| group | unmodified PSMs below −9.7 mDa | est. genuine deamidations lost | share of genuine deamidations |
|---|---|---|---|
| Velos CID | 7.4% | 62 | 8.6% |
| HF-X HCD | 6.4% | 27 | 5.4% |
| Astral HCD | 5.6% | 14 | 5.6% |
| Lumos HCD LFQ | 3.0% | 20 | 3.1% |
| All 12 files | 122 | 5.8% |
(Suite databases: 135, 5.9%.)
- Cross-check: in the
offarm, 129 accepted deamidated PSMs flagged as mimics have a residual between −12 and −9.7 mDa, the boundary region where the misflagged genuine ones should sit. - Net,
removestill accepts more deamidated PSMs (1,986) thanoffaccepts unflagged ones (1,794), because the mimics had been crowding genuine deamidations out of the top-N. - A discarded genuine deamidation is usually not a lost spectrum. It is reassigned to the unmodified peptide at the neighbouring isotope offset: right peptide, missing modification. This probably contributes to the small FDP rise.
Not a low-resolution effect. All four datasets have Orbitrap/Astral precursors; Velos CID is low-res only for the fragments, which the rule does not use. What matters is the absolute precursor error, because the boundary is fixed in mDa while measurement errors scale with mass:
| group | median residual | 5% quantile |
|---|---|---|
| Velos CID | −1.4 mDa | −11.6 mDa |
| HF-X HCD | −0.9 mDa | −10.8 mDa |
| Astral HCD | −2.2 mDa | −11.2 mDa |
| Lumos HCD LFQ | −0.5 mDa | −5.8 mDa |
With genuinely low-res precursors (ion-trap MS1, ~0.5 Da tolerance), 19 mDa cannot be resolved and the rule becomes arbitrary. There remove should stay off, or ProSE should disable it above some precursor tolerance.
Recalibration in OpenMS:
- ProSE
calibration:enabled(off in this benchmark) estimates the median shift and spread of the precursor error, but only shifts and narrows the tolerance window. It does not correct masses, and the mimic check (ProSEAlgorithm.cpp:2613) uses the uncorrected precursor m/z. Enabling it would leave the loss unchanged. - The TOPP tool
InternalCalibrationactually recalibrates the mzML, from lock masses or from the IDs of a first search, optionally with an m/z- and RT-dependent model. It costs a second search.
Effect of a per-file offset correction (share of unmodified PSMs below −9.7 mDa after subtracting the file's median residual):
| group | uncorrected | offset-corrected |
|---|---|---|
| Velos CID | 7.4% | 5.5% |
| HF-X HCD | 6.4% | 5.3% |
| Astral HCD | 5.6% | 4.8% |
| Lumos HCD LFQ | 3.0% | 2.9% |
The loss would drop from about 6% to about 4.5–5%; most of it comes from the tails of the error distribution, not the systematic offset.
Options if this is revived:
- Cheap: subtract
cal.precursor_shiftin the mimic check when calibration runs. A one-line change that recovers about a quarter of the loss. - More effective: discard only when the residual lies clearly on the isotope side, i.e. its distance from the boundary relative to the calibrated spread. Candidates in the ambiguous region around −10 mDa stay and Percolator decides. This gives up some mimic suppression but protects genuine deamidations.
- Thorough: run
InternalCalibrationfirst. It narrows the error distribution itself, at the cost of a second search.
Generated by Claude Code
Requested by Timo · project thread
Description
Before: Deamidation (+0.984 Da), N→D and Q→E lie 19 mDa from one 13C step. With isotope errors searched, the deamidated candidate matches an unmodified peptide's precursor at a neighbouring isotope offset within tolerance, and often outscores the unmodified form. Decoys cannot model this error, and neither can entrapment, because the peptide is right and only its modification state is wrong. On the #10364 suite with Deamidated (N/Q), 65% of accepted deamidated PSMs are such mimics (andes: 61% on Astral).
After:
-Search:precursor:isotope_mimic off|annotate|remove(defaultoff, which is byte-identical to develop). A candidate is an isotope mimic when replacing its variable modifications that lie within 0.05 Da of one or two isotope steps by whole steps gives a smaller precursor error.annotate: PSM meta valueisotope_mimic(1/0). It is not a Percolator feature; see the benchmark.remove: mimics are neither scored nor part of the candidate pool, so the unmodified candidate matched at the other isotope offset takes their rank. This is how andes#102 drops them. The number removed is logged.The mode is recorded in the search parameters unless it is
off. Closed search only.How: New public statics
ProSEAlgorithm::isotopeGap(),isotopeMimicShift()andisIsotopeMimic().removeacts inscoreSpectraAgainstIndex_before scoring;annotateinpostProcessHits_. Tests: class tests for the statics and for the three modes in a search, and TOPP testProSE_13_isotope_mimic. On the existing test data,removereplacesIALSRPNVEVVALN(Deamidated)DPFITNDYAAYM(Oxidation)FKat isotope error −1 by the unmodified peptide at 0.Commits:
6ceb7553added the flag asannotate:isotope_mimictogether with a Percolator feature.e1df7302adds the removal, renames the option, and drops the feature.Ported from bigbio/andes#102 and bigbio/andes#152.
Benchmark
Verdict:
removereproduces andes:The first head's Percolator feature had the opposite effect: PSMs −0.3%, and accepted mimics rose by 41%.
Setup.
74048ef5(merge-base); first head6ceb7553; second heade1df7302. Release, TOPPProSE.inputs.json): Velos CID, HF-X, Astral and Lumos HCD LFQ, 3 files each, 8,000 MS2 per file.native_dedupparameters (Trypsin/P, 2 MC, length 7–40, z 2–5, ±20 ppm, isotope errors −2..1, fragment 0.5 Da for Velos and 20 ppm otherwise, 50 candidates, top 10, deduplicate) plus variableDeamidated (N)and(Q), at most 2 variable modifications per peptide.-Y -U, seeds 1/42/137; target PSMs at q ≤ 0.01.off: option off.on: first head with the flag as a Percolator feature.drop: flagged rows removed from theoffPIN before Percolator, a simulation of andes.remove: second head withprecursor:isotope_mimic remove.PSMs at q ≤ 0.01 (suite databases; group mean of the 3-seed means; All = sum over the 12 files; files up/flat/down vs
offwith |z| ≥ 2):Entrapment databases (all 12 files; deamidated = accepted deamidated PSMs per seed):
Per group, FDP from
offtoremove(estimated true PSMs in brackets):The implementation does slightly better than the simulation: +1.9% vs +1.6%, and +2.1% vs +1.5% on the entrapment databases. Removing mimics before the top-N pruning lets further candidates in, which the PIN-level simulation cannot do.
What the mimics are (
off):removerecovers about half of that.andes:
72ee0a5vs3dded7b,--refine, the same three Astral files, same Percolator): mis-picks 47% → 0%; Pass-2 PSMs −41%; total +0.3%.removeOption off and cost:
annotategives exactly theoffcounts.ctest -R ProSEpasses all 63 tests, includingProSEAlgorithm_testand the newTOPP_ProSE_13_isotope_mimic.Scripts, per-file and per-seed tables, hashes and the reproduction recipe:
benchmark-reproduction/andes-ports/pr10635on branchclaude/andes-benchmarks.Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.Generated by Claude Code