Skip to content

[FEATURE] ProSE report:collapse_positional_isomers: one row per positional isomer set - #10634

Closed
timosachsenberg wants to merge 1 commit into
developfrom
claude/andes-isomer-collapse
Closed

timosachsenberg wants to merge 1 commit into
developfrom
claude/andes-isomer-collapse

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Timo · project thread

Description

Before: With report:top_hits > 1 (e.g. for PeptDeep rescoring), a phospho spectrum's top hits are often the same peptide with the phosphate on another residue. These near-duplicates split the spectrum's evidence over several rows in rescoring.

After: With report:collapse_positional_isomers true, only the best of a spectrum's hits with the same charge, residues and modifications is reported. Modifications are compared by name, so Phospho on S and on T, or Acetyl on the N-terminus and on K, are isomers. Default false.

How: In postProcessHits_, before the top-N cut, hits are sorted and duplicates of positionalIsomerKey_() (charge, unmodified sequence, sorted modification names) removed. Class test for the key.

Ported from bigbio/andes#143.

Benchmark

Baseline 74048ef5 (merge-base with develop) vs. PR 5639017e, option off and on, same machine (4 cores, 15 GB). ProSE TOPP writes -out_pin (no in-process rescoring); external Percolator 3.09.0 -Y -U, seeds 1/42/137, target PSMs at q ≤ 0.01. Scripts, per-file/per-seed tables and the exact parameters: benchmark-reproduction/andes-ports/pr10634 on claude/andes-benchmarks.

Default unchanged: with the option off, PIN and idXML are byte-identical to the baseline on all 21 inputs (20 suite files + phospho).

Phospho, andes's dataset — PXD007653 …totalliver_control2_phospho.raw (102,819 MS2, converted in-process), UniProt mouse reviewed + 1:1 shuffled entrapment (andes's build_shuffled_entrap.py) + reversed decoys. Frozen high-res parameters (Trypsin/P, 2 MC, 7–40, 20/20 ppm, report:top_hits 10, candidate cap 50), fixed CAM(C), variable Ox(M), Acetyl(Protein N-term), Phospho(STY), ≤ 3 per peptide (andes: 4), database:chunk_size 8000.

Seeds 1/42/137 off on Δ andes #143 before → after
PIN rows (target + decoy) 766,400 457,142 −309,258 (−40.4%) −363,181 (−40%)
PSMs, q ≤ 0.01 38,830 / 38,821 / 38,801 38,970 / 38,982 / 38,955 +0.39% (z = +13) 37,038–37,110 → 37,220–37,356 (+0.6%)
Peptides (sequences) 15,156 / 15,149 / 15,154 15,284 / 15,301 / 15,287 +0.91% 14,522–14,561 → 14,726–14,771 (+1.4%)
Peptidoforms 20,905 (mean) 20,584 −1.5% –
Entrapment FDP (2·N_E/N) 0.93 / 0.90 / 0.93% 0.92 / 0.94 / 0.90% ±0 andes nominal 1% = 0.97–1.08%
Search wall, median of 3 398 s 374 s −6% –
Percolator wall (seed 42), median of 3 122 s 57 s −53% –
Peak RSS 12.3 GB 12.3 GB ±0 –
  • The collapse removes 43.9% of the target rows and 35.4% of the decoy rows (82,308 / 57,092 isomer sets), but never a spectrum's best row: the rank-1 row of all 85,065 spectra is identical in both arms (peptide, label, every feature). Target-decoy competition therefore sees the same candidates at the top; the gain comes from Percolator training without near-duplicate lower-rank rows, and the entrapment FDP stays at 0.9%.
  • With the option off, 4,339 of 38,821 accepted PSMs (seed 42) are a site isomer that Percolator ranked above ProSE's rank-1 hit. With the option on there are none; this is the drop in peptidoforms. This data has no ground truth for the site; on the spike-in below, most such switches are right.
  • No backfill: removed isomer rows are not replaced by further candidates (rows drop by exactly the isomer duplicates); andes also collapses only the emitted rows.

Frozen #10364 suite (≤ 1 Ox(M)), 20 files × 8,000 MS2, frozen native_dedup parameters:

Group n off on Δ up/flat/down
Velos CID 3 2977.6 2976.1 −0.05% 0/3/0
HF-X HCD 3 4597.6 4601.4 +0.08% 1/2/0
Astral HCD 3 3049.8 3048.2 −0.05% 0/3/0
Lumos HCD LFQ 3 5553.6 5554.9 +0.02% 1/2/0
Lumos CID TMT6plex 3 2457.1 2448.8 −0.34% 0/3/0
Exploris 480 TMTpro 3 2622.2 2617.4 −0.18% 0/3/0
timsTOF HT plasma 2 1048.5 1044.5 −0.38% 0/2/0
All 20 files (sum) 20 65,870.3 65,829.7 −0.06% 2/18/0

Only 0.6–2% of rows are Ox(M) site isomers here; unique peptides −0.05%. Entrapment, combined FDP off → on: Velos natural 1.18 → 1.18%; frozen paired-mass r = 1: HF-X 1.58 → 1.57%, Astral 1.40 → 1.47%, TMTpro 1.36 → 1.24% (±3–5 entrapment PSMs, seed noise). Search time unchanged (HF-X 6.2 → 5.8 s).

Known-position test: MHCquant spike-in (PXD011628, 66 synthetic HLA peptides with exactly one heavy V/P/L at a known position; 100 fmol replicates msms52/53/54, Lumos FTMS CID). Human Swiss-Prot + reversed decoys, unspecific cleavage, 8–12 aa, z 1–4, 10/20 ppm, variable Ox(M) and the heavy V, P and L labels (≤ 2 per peptide), report:top_hits 10, low_memory true. Accepted spike-in PSMs (q ≤ 0.01) with one heavy label, sum over the 3 files of the seed means:

off on
All accepted PSMs 23,696.7 23,761.3 (+0.3%)
Spike-in PSMs, correct site 4,308.7 4,248.7 (−1.4%)
Spike-in PSMs, wrong site 133.0 180.7 (+36%, higher in 9/9 file × seed pairs)
Site accuracy 97.0% 95.9%
Accepted spike-in PSMs that are not ProSE's rank-1 row 111.7, of these 89.0 with the correct site (ProSE's rank 1: 27.7) 17.0

With the option off, Percolator often replaces ProSE's wrong rank-1 site with the right isomer; the collapse removes those alternatives, so ProSE's rank-1 site errors stay. Most of the loss is one peptide, VLLAGFKPPL (label on P8, next to P9): 17–22 → 34–47 wrong-site PSMs per file (seed 42). Search time 20–22 min per file in both arms. Scripts and per-seed table: results/mhc_site.tsv, mhc_wrong_sites.txt in the folder above.

Verdict vs. andes:

  • Phospho PSMs: reproduced (+0.39% vs +0.6%, same direction, similar size, FDP flat).
  • Phospho peptides: reproduced, smaller (+0.9% vs +1.4%). Differences: ProSE's own baseline and features, ≤ 3 instead of 4 variable mods, 2 instead of 1 missed cleavage, Percolator 3.09 vs 3.7.1, and the OpenMS port compares modifications by name, andes by mass.
  • Rows removed: reproduced (40.4% vs 40%).
  • Non-phospho data: reproduced (andes: "within or just above seed noise"; here −0.06%, no file down).
  • Site accuracy (not measured by andes): worse with the option on the spike-in (97.0% → 95.9%, wrong-site PSMs +36%). The option trades site correctness for a small count gain. Proposal: say so in the parameter description; for site-level results keep it off or follow it with a localization step.
  • Not measured: the PeptDeep / chimeric top-N use case named in the description; andes's chimeric phospho arm.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out

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 with Claude Code

https://claude.ai/code/session_01F73hZDwadLuUofLxkDHyVS

…ional isomer set with report:top_hits > 1

Of a spectrum's hits with the same charge, residues and modifications,
only the best is reported; the others differ only in where the
modifications sit and split the spectrum's evidence over near-duplicate
rows in rescoring. Default false.

Ported from bigbio/andes #143 (phospho PXD007653: +0.6% PSMs, +1.5%
peptides; needed for chimeric top-N).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F73hZDwadLuUofLxkDHyVS
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c64a0b0e-9d4e-4d40-aec0-08f01a8ab999
📥 Commits

Reviewing files that changed from the base of the PR and between b8f55c6 and 5639017.

📒 Files selected for processing: 4
  • CHANGELOG
  • src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h
  • src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp
  • src/tests/class_tests/openms/source/ProSEAlgorithm_test.cpp
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@timosachsenberg
timosachsenberg marked this pull request as draft October 19, 2026 12:42

Copy link
Copy Markdown
Contributor Author

Closing this port: the benefit is small and it costs localization accuracy.

  • Phospho (PXD007653, andes's own file): +0.4% PSMs and +0.9% peptides at 1% q, with an unchanged entrapment FDP. Percolator runs about 2× faster because there are 40% fewer PIN rows.
  • Frozen [BENCHMARK] Reproducible ProSE / ANDES / Sage suite: 20 measurements across six instrument models #10364 suite: −0.06% (neutral).
  • Known-position test (MHCquant spike-in, PXD011628, 66 peptides with one heavy V/P/L each): site accuracy goes from 97.0% to 95.9%, and wrong-site PSMs rise by 36% (higher in 9 of 9 file×seed pairs). The reason is that collapsing removes the positional alternatives Percolator would otherwise pick correctly; with the option off, 89 of 112 non-rank-1 spike-in PSMs that Percolator accepts carry the correct site.

The option buys speed and a fraction of a percent in IDs, but it is worse on what positional isomers are about, so it is not worth the extra option. Benchmark details are in the description and in claude/andes-benchmarks, benchmark-reproduction/andes-ports/pr10634.


Generated by Claude Code

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.

2 participants