Skip to content

[FEATURE] ProSE: search initial methionine loss by default - #10358

Merged
timosachsenberg merged 2 commits into
developfrom
codex/prose-nterm-methionine
Oct 1, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
codex/prose-nterm-methionine

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

ProSE's fully specific digest did not include the mature N-terminal peptide after removal of an initial methionine. For example, a spectrum of PEPTIDER could not match the database protein MPEPTIDER, even though downstream PeptideIndexing already accepts this protein mapping.

This is a separate follow-up to #10335, based directly on develop 2e82a31b966e59c595a4b1e6e29a3fc3abd67bc2. The final-window extraction is #10357.

Behaviour

  • New peptide:clip_nterm_methionine=true by default in ProSE. Search the retained-M form and the form with exactly the initial M removed, for any following residue. Internal methionines are not clipped. false restores the previous candidate space and decoy generation.
  • Apply length, mass and missed-cleavage limits to the mature sequence. A clipped peptide can qualify even if the retained-M form exceeds the maximum length. Minimum peptide length remains 7 and the default missed-cleavage count remains 1.
  • Keep original protein offsets: the mature peptide starts at position 1, with M as its preceding residue. It retains eligibility for protein N-terminal variable modifications, including acetylation. Generation, fragment emission and sequence reconstruction use the same terminal context.
  • Add only new N-terminal coordinates; semi-/non-specific enumeration does not gain duplicate unmodified candidates. Non-specific SNES already covers these sequences; its protein-N-terminal modification checks now recognize the mature start.
  • Preserve the leading M when ProSE generates decoys, so these decoys also have the clipping alternative. Supplied decoys are searched as provided.
  • Standalone FragmentIndex defaults to false, preserving its existing default search space; ProSE forwards its true default. Record the option in output search parameters. Tool documentation, CHANGELOG and four idXML references are updated.

ANDES source check

At the pinned ANDES revision b7eaece219ef45198eb233030cf9d69075988f72, enumerate_protein unconditionally adds an offset-1 pass when the protein starts with M and has more than one residue. Its Met-cleavage regression test confirms both forms. The offset-1 start keeps protein-N-terminal modification eligibility.

This implementation adds the missing biological variant and avoids adding a second copy of ordinary internal peptides.

Validation

Local targeted C++23/OpenMP build with GCC 13.3:

  • FragmentIndex_test: all 59 sections pass. New coverage includes retained/clipped forms, targets and supplied decoys, original offsets, exact precursor masses, upper/lower length bounds, missed cleavages, no-cleavage digestion, internal/non-M controls, single M, exactly one M removed, duplicate coordinates, acetylation, fragment retrieval and SNES terminal-modification reconstruction.
  • ProSEAlgorithm_test: all 35 sections pass. The new end-to-end fixture identifies four spectra with clipping enabled: mature target, acetylated mature target, mature decoy and retained-M target. With clipping disabled only the retained-M target is identified. This is checked in normal search and both unchunked and chunked multi-file search, including protein evidence, target/decoy labels and output metadata.
  • Generated-decoy tests cover fully specific and non-specific searches, enabled/disabled clipping, non-M proteins and single-M proteins. The existing synthetic decoy-spectrum helper was adjusted to generate the same default decoys as ProSE.
  • Also ran inputs/settings from TOPP ProSE tests 1, 2, 4 and 10 through the source-built algorithm harness with clipping enabled and disabled: peptide sequences, scores and numeric annotations are unchanged. Their idXML reference changes add only the new search parameter. Runtime paths/dates and the existing fragment-annotation whitelist were excluded from structural comparisons.
  • git diff --check passes; changed C++ regions checked with clang-format 20.1.8, omitting unrelated include/comment reformatting.

Exact tested source tree: fd8b293b57c3fe57b570f8491f2aa8ab7b906406.

Build scope: ProSEAlgorithm, FragmentIndex, HyperScore and TheoreticalSpectrumGenerator were compiled from this branch and linked against unchanged support code from official pyOpenMS 3.6.0.dev20260930 (reports 3.6.0-pre-nightly-2026-09-29, revision 55f7bdb). This is not a full clean OpenMS/TOPP build, and Python bindings were not rebuilt. No public method signatures change.

No new multi-instrument yield or true-FDR claim is made here. The benchmarks in #10335 predate this option and do not measure its benefit.

Reproduce the targeted build and tests

Linux x86_64 with g++-13, make, git, curl, Python 3.12, unzip and required runtime libraries. The public bundle supplies the existing C++ harness/generated configuration headers; no large benchmark downloads are needed for these regression tests.

curl -fL https://raw.githubusercontent.com/OpenMS/OpenMS/a5705ec8e1cb19d40ebfa7bb16f6b5651aa1dc65/benchmark-reproduction/prose-andes/prose-andes-reproduction.zip -o reproduction.zip
echo 'e24cbe748001df4e77bd03b98b2bc47d18463948a6ce05e6f1f422806f5075b2  reproduction.zip' | sha256sum -c -
unzip reproduction.zip
cd prose-andes-reproduction
sha256sum -c MANIFEST.sha256
git clone --branch codex/prose-nterm-methionine https://github.com/OpenMS/OpenMS.git OpenMS
git -C OpenMS checkout --detach 180503b63ef0a39491511cf41ce780be3730de65
python3 -m pip install --target nightly --no-deps --index-url https://pypi.openms.de pyopenms==3.6.0.dev20260930
python3 -m pip install --target deps --no-deps cmake==4.4.3
python3 -m pip install --target header_deps --no-deps cmeel-boost==1.84.0 cmeel-eigen==3.4.0.2
python3 - <<'PY'
from pathlib import Path
import re
p = Path("native_cid/include/OpenMS/test_config.h")
data = str(Path("OpenMS/src/tests/class_tests/openms/data").resolve()) + "/"
p.write_text(re.sub(r'"[^"]*/src/tests/class_tests/openms/data/"', '"' + data + '"', p.read_text()))
PY
export OPENMS_DATA_PATH="$PWD/nightly/pyopenms/share/OpenMS"
export OMP_NUM_THREADS=2
deps/cmake/data/bin/cmake -S native_cid -B build-methionine -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-13 -DOPENMS="$PWD/OpenMS"
deps/cmake/data/bin/cmake --build build-methionine --target FragmentIndex_test ProSEAlgorithm_test -j2
deps/cmake/data/bin/ctest --test-dir build-methionine -R '^(FragmentIndex|ProSEAlgorithm)_test$' --output-on-failure

For a normal OpenMS build, build the same two test targets and run the same CTest expression.

TOPP-fixture checks used each ProSE_1.ini, ProSE_2.ini and ProSE_4.ini Search section with their spectra/FASTA from src/tests/topp/CMakeLists.txt; test 10 uses ProSE_10_duplicate_peaks.mzML, ProSE_10.fasta, 10 ppm fragments and other defaults. Repeat each with peptide:clip_nterm_methionine=false for the legacy control.

Summary by CodeRabbit

  • New Features
    • ProSE searches protein N-terminal peptides both with and without the initial methionine by default. Clipped and unclipped forms follow the configured peptide length, mass, and missed-cleavage limits; clipped peptides can receive protein N-terminal variable modifications.
    • Generated decoys retain the initial methionine when clipping is enabled, while supplied decoys are searched as provided.
  • Documentation
    • Clarified that disabling methionine clipping restores the previous search space and that internal methionines are not clipped.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

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: 6cf04243-1696-4e38-9f95-56ed86c61b31

📥 Commits

Reviewing files that changed from the base of the PR and between 180503b and 256106e.

📒 Files selected for processing (9)
  • CHANGELOG
  • src/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.h
  • src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp
  • src/tests/class_tests/openms/source/ProSEAlgorithm_test.cpp
  • src/tests/topp/ProSE_10_out.idXML
  • src/tests/topp/ProSE_1_out.idXML
  • src/tests/topp/ProSE_2_out.idXML
  • src/tests/topp/ProSE_4_out.idXML
  • src/topp/ProSE.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG

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


📝 Walkthrough

Walkthrough

ProSE now searches eligible protein N-terminal peptides with and without the initial methionine by default. FragmentIndex adds clipping support, including protein N-terminal modification and SNES handling. Generated decoys retain the initial methionine when clipping is enabled.

Changes

Initial Methionine Clipping

Layer / File(s) Summary
FragmentIndex clipping and N-terminal handling
src/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.h, src/openms/source/ANALYSIS/ID/FragmentIndex.cpp, src/tests/class_tests/openms/source/FragmentIndex_test.cpp
FragmentIndex adds the peptide:clip_nterm_methionine option, which defaults to false. Enzymatic searches can add eligible peptides beginning after an initial methionine. Peptide limits apply to the clipped sequence. Protein N-terminal modifications and SNES recognize the clipped start. Tests cover peptide coordinates, limits, duplicate spans, modifications, and SNES matching.
ProSE defaults, decoys, and validation
src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp, src/tests/class_tests/openms/source/ProSEAlgorithm_test.cpp, src/tests/topp/ProSE_*_out.idXML, src/topp/ProSE.cpp, CHANGELOG
ProSE defaults clipping to true and records the setting in search metadata. When enabled, generated decoys retain an initial methionine. Tests cover search results and decoys. The output fixtures, ProSE documentation, and changelog describe the setting and its behavior.

Suggested reviewers: claude

Priority: ⬇️ Low

Change: Feature

Merge Risk: ⚪ Minimal · up to 25610

ProSE now searches the N-terminal peptide with and without the initial methionine by default, and the option can be disabled to restore the previous search space. No concrete merge-blocking risk was identified in the supplied context.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 25610

The reviewed change expands peptide matching while retaining existing limits and providing an opt-out. No new privilege or external-access boundary was identified. Remaining uncertainty about the complete comparison scope prevents a minimal-risk assessment.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated exposure is additional candidate enumeration and matching within the existing search process. The traced clipping path introduces no external-service call, credential use, or privilege transition; this conclusion is bounded to the inspected path.

Trust Boundaries and Controls

  • observed — Index construction retains the caller's clipping parameter across normal and chunked searches, including multi-file chunking. The generated-decoy transformation is gated by the generation strategy and operates on copied entries; reused supplied decoys do not enter that transformation branch.

Resilience and Maintainability Implications

  • observed — The inspected index lifecycle clears previous state before rebuilding and marks the index built only after completion. Candidate generation uses per-thread storage before merging; fragments reference the finalized peptide-vector indices. The clipping changes preserve these ownership and ordering mechanisms rather than introducing a separate publication path.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. (5 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 searches for initial methionine loss by default.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • 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 the peptide trail
Past the M, new forms prevail
Decoys keep their first M bright
Tests follow each clipped site
The burrow hums with spectra tonight

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

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

…methionine

# Conflicts:
#	CHANGELOG
#	src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp
#	src/tests/topp/ProSE_10_out.idXML
#	src/tests/topp/ProSE_1_out.idXML
#	src/tests/topp/ProSE_2_out.idXML
#	src/tests/topp/ProSE_4_out.idXML
#	src/topp/ProSE.cpp

Co-authored-by: timosachsenberg <[email protected]>

Copilot AI commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merged develop and resolved the conflicts while preserving both sets of changes. Merge commit: 256106e77c.

@timosachsenberg
timosachsenberg merged commit 4392693 into develop Oct 1, 2026
13 checks passed
@timosachsenberg
timosachsenberg deleted the codex/prose-nterm-methionine branch October 1, 2026 09:45
timosachsenberg pushed a commit that referenced this pull request Oct 1, 2026
Resolves the conflicts with the two ProSE changes that landed on develop
after this branch's last develop merge: #10357 (peaks:window_type, the
same final-window retention this branch carried; the develop text and the
richer develop test are kept, the branch's duplicate CHANGELOG bullet is
dropped) and #10358 (peptide:clip_nterm_methionine, kept alongside this
branch's peptide:deduplicate and fragment:query_spectrum parameters).

Also documents the evidence_spectra parameter of postProcessHits_, which
Doxygen_Warning_test flagged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UGKGwMtvsf72yELV4xNmAQ
timosachsenberg pushed a commit that referenced this pull request Oct 1, 2026
…rences

The references from develop (refreshed there for #10357 and #10358) lack the
search-parameter entries this branch writes: scoring:method,
scoring:method_resolved, scoring:fragment_charges,
scoring:fragment_charges_resolved, scoring:mass_error_sd, fragment:max_charge,
fragment:query_spectrum, peptide:deduplicate and
annotate:local_fragment_evidence; peptide:clip_nterm_methionine moves to the
position this branch writes it at. Every identification, score and
annotation line is unchanged, so only these UserParam lines are added to
ProSE_1_out (also used by the multi-file and chunked tests), ProSE_2_out,
ProSE_4_out and ProSE_10_out.

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