Skip to content

[FIX] ProSE: remove only peaks without intensity before normalization - #10377

Merged
timosachsenberg merged 1 commit into
developfrom
claude/quirky-galileo-tkpwe4-prose-zero-intensity
Oct 1, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/quirky-galileo-tkpwe4-prose-zero-intensity

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Standalone version of #10368, rebased onto develop. #10368 is stacked on codex/native-cid (#10335). This PR contains only the #10368 change and does not depend on #10335. It is the same source change as #10368's latest head (d21f55b), including the float::denorm_min() follow-up. It was cherry-picked from the prepared develop commit 4fba64c7.

What changes

ProSE's MS2 preprocessing ran ThresholdMower with its class default: an absolute intensity cutoff of 0.05, applied before normalising to a base peak of 1. On raw Orbitrap/timsTOF counts this removes nothing. On intensity-scaled input (spectra already normalised to a base peak of 1, or otherwise small intensities) it silently deleted every peak below 5% of the base peak before scoring.

The cutoff now removes only peaks without intensity (zero or negative, e.g. empty centroids), because those would still count as matched ions. Every positive float intensity, subnormal ones included, is kept. The window and top-N filters are unchanged.

Tests

  • ProSEAlgorithm_test:
    • A spectrum with a zero-intensity peak and peaks at 1e-4, 0.01 and 0.04 keeps exactly the positive ones.
    • A search of the calibration fixture scaled to a base peak of 1e-3 gives the same identifications, charges and scores as the unscaled search.
  • CHANGELOG entry, in the 3.7.0 section (3.6.0 is released).

Verification on this branch

  • Native harness build: ProSEAlgorithm, FragmentIndex, HyperScore and TheoreticalSpectrumGenerator are compiled from this tree and linked against pyOpenMS nightly 3.7.0.dev20261001, built from e25ac61. HyperScore_test, FragmentIndex_test and ProSEAlgorithm_test pass (3/3).
  • ProSE TOPP tests 1, 2, 4, 5 (chunked), 6 (FDR), 8 (auto decoys) and 10 were replayed through ProSEAlgorithm::search() with the tests' INI and command-line Search:* parameters. The output idXML is identical to develop, so no reference changes are needed. The develop replay reproduces the checked-in references exactly: search parameters and hits.
  • This is not a full TOPP/pyOpenMS build; CI covers that.

Benchmark vs. develop (20-file suite of #10364)

Frozen 20-file suite of #10364: 8,000 DDA MS2 per file, the same FASTAs, Percolator 3.09.0 seeds 1/42/137, target PSMs at q ≤ 0.01. Each count is the mean over seeds within a file, then over files within a group. Each arm differs from develop f5ea2d04 only by this PR and the setting named; other PRs are never stacked on it.

The algorithms are compiled from this branch against pyOpenMS nightly 3.7.0.dev20261001 support code; this is a native harness, not a full TOPP build. Scripts, parameters, logs and per-seed results: supplement, ZIP`` (SHA256 650b8732602c76b038d2907b8be26bc469c6a50231424c2a58de33e60df04dea). Combined comparison: #10364.

Instrument / acquisition n develop This PR Delta Native TDC delta
Velos CID 3 2600.3 2600.3 +0.00% +0.0
HF-X HCD 3 4380.3 4380.3 +0.00% +0.0
Astral HCD 3 2189.6 2189.6 +0.00% +0.0
Lumos HCD LFQ 3 5496.1 5496.1 +0.00% +0.0
Lumos CID TMT 3 2327.3 2327.3 +0.00% +0.0
Exploris 480 TMTpro 3 2244.9 2244.9 +0.00% +0.0
timsTOF HT 2 1015.0 1015.0 +0.00% +0.0

The normalized Percolator input is byte-identical to develop on all 20 files: raw intensities never fall below the old 0.05 cutoff.

Intensity-scale control (same derived inputs as on 2026-09-30): every spectrum is scaled by a power of two so its base peak lies in [1,2), preserving m/z, RT, precursors and scan IDs.

File Arm Unscaled seeds Scaled seeds Identical PIN
velos_125_R1 develop [2480, 2505, 2602] [2243, 2049, 2192] False
velos_125_R1 this PR [2480, 2505, 2602] [2480, 2505, 2602] True
eclipse_tmtpro_10855 develop [2405, 2407, 2443] [2293, 2331, 2294] False
eclipse_tmtpro_10855 this PR [2405, 2407, 2443] [2405, 2407, 2443] True

On the scaled inputs develop loses 15% (Velos CID) and 5% (TMTpro) of its identifications; this PR gives exactly the unscaled result.

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.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01D1N3pC2AqJt57Q3v87bWxz


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • ProSE now retains all positive-intensity peaks during spectrum preprocessing, including peaks below the previous cutoff, while removing zero- and negative-intensity peaks.
    • Searches on intensity-scaled calibration spectra now produce matching top-hit counts, sequences, charges, and scores when calibration is disabled.
  • Documentation

    • Updated the changelog to describe the revised intensity cutoff behavior.

ProSE's MS2 preprocessing ran the ThresholdMower with its class default, an
absolute intensity cutoff of 0.05, before normalizing to a base peak of 1. On
intensity-scaled input (spectra already normalized, or otherwise small
intensities) that silently deleted every peak below 5% of the base peak. The
cutoff now removes only peaks without intensity (zero or negative); every
positive float intensity, subnormal ones included, is kept.

Standalone version of #10368 on develop (previously stacked on #10335).
Adds the positive-intensity and search scale-invariance regression tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D1N3pC2AqJt57Q3v87bWxz

timosachsenberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

CI note: build-wheels-linux-arm (run 36850577057) failed before any build step. The runner's docker run quay.io/pypa/manylinux_2_34_aarch64 failed with a DNS timeout (lookup quay.io on 127.0.0.53:53: i/o timeout), so this is runner infrastructure, not this PR. I'll re-run the failed job once the rest of the workflow run finishes; GitHub refuses a re-run while the run is still in progress.

Update, 13:25 UTC: the one re-run (attempt 2, job 110388280006) also failed before any OpenMS code was compiled, this time with a different external error. Inside the container, the vcpkg bootstrap's download of vcpkg-arm64-glibc got HTTP 504 four times (curl: (22) The requested URL returned error: 504).

Why this is not this PR:

I won't re-run it again. A maintainer re-run of the failed job, or the next push to this branch, will retry it.


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a132859f-d3e8-4b26-9b46-c9579e66b1a9

📥 Commits

Reviewing files that changed from the base of the PR and between 66db687 and a44c46c.

📒 Files selected for processing (3)
  • CHANGELOG
  • src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp
  • src/tests/class_tests/openms/source/ProSEAlgorithm_test.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

ProSE now removes zero and negative MS2 intensities before normalization while retaining positive intensities below 0.05. New tests check peak retention and compare search results for original and intensity-scaled spectra.

Changes

ProSE intensity preprocessing

Layer / File(s) Summary
Set and validate the intensity threshold
src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp, src/tests/class_tests/openms/source/ProSEAlgorithm_test.cpp, CHANGELOG
preprocessSpectra_ sets the threshold to the smallest positive subnormal float. Tests verify that positive peaks below 0.05 survive and that searches on original and 1e-3-scaled spectra return matching top hits. The changelog describes the updated cutoff.

Suggested reviewers: cbielow

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a44c4

The change preserves representable positive ProSE peak intensities, and no material merge-blocking behavior is established in the supplied context.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: ProSE now removes only peaks without intensity before normalization.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

A rabbit checks each peak with care
Zero leaves; small positives stay
Scaled spectra meet the same result
The search keeps scores and sequences
Then hops along its way

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

@timosachsenberg
timosachsenberg merged commit 30be92f into develop Oct 1, 2026
25 of 27 checks passed
@timosachsenberg
timosachsenberg deleted the claude/quirky-galileo-tkpwe4-prose-zero-intensity branch October 1, 2026 19:17
timosachsenberg added a commit that referenced this pull request Oct 1, 2026
Resolves the conflict with #10377 in ProSEAlgorithm_test.cpp (both sides add test sections at
the same place; both are kept) and merges the two ProSE CHANGELOG blocks of 3.7.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D1N3pC2AqJt57Q3v87bWxz
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