Skip to content

PepXMLFile: write schema-valid specificity and search_engine placement - #10346

Merged
timosachsenberg merged 2 commits into
OpenMS:developfrom
ManasBagul23:pr/40-pepxml-schema-valid
Oct 15, 2026
Merged

timosachsenberg merged 2 commits into
OpenMS:developfrom
ManasBagul23:pr/40-pepxml-schema-valid

Conversation

@ManasBagul23

@ManasBagul23 ManasBagul23 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10345.

Validating every written reference file against the bundled schemas (share/OpenMS/SCHEMAS) showed all idXML, featureXML and trafoXML references validate — the five pepXML ones did not, for two reasons:

  1. For identifications whose search parameters carry no enzyme (the default unknown_enzyme, which is what X! Tandem, Percolator and OpenNuXL results in the test data have), the writer emitted <specificity cut="" sense="C"/>. pepXML requires at least one cleavage residue (cut has minLength 1); specificity itself is optional, so it's now left out entirely for an unknown enzyme instead of written empty.
  2. The writer also put a search_engine attribute on msms_run_summary, an attribute the schema only defines on search_summary. Real TPP-written files (e.g. the reader fixture PepXMLFile_test_store.pepxml) don't carry it on msms_run_summary either.

Note for review: the unspecific cleavage case (regex (?<=[A-Z])) is still written as cut="A", i.e. "cuts after alanine" — schema-valid, and what the writer already did before this fix. Expressing it as a sample_enzyme without specificity (or fidelity="nonspecific") would be more semantically faithful to what's actually meant, but that's a separate semantic change beyond just fixing validation, so I left it alone here and I'm flagging it rather than guessing at the preferred approach.

Verified in Docker (scoped to the pepXML-relevant tests, since two unrelated TOPP_IDFileConverter_32/33 tests segfault on unmodified develop itself — confirmed by running them against a plain checkout of develop with no changes, so that's a pre-existing issue unrelated to this fix): PepXMLFile_test plus TOPP_IDFileConverter_17/18/19/20/25 (the pepXML-writing ones) all pass; a red check confirms PepXMLFile_test fails without the fix.

Summary by CodeRabbit

  • Bug Fixes
    • pepXML exports now include search-engine information in the search summary only, not the run summary.
    • Enzyme specificity is written only when a nonempty cleavage rule can be extracted. Enzymes without an expressible rule, including unspecific-cleavage enzymes, no longer produce empty specificity entries.

- an enzyme without cleavage rules (the default 'unknown_enzyme', e.g. when
  the search parameters carry no enzyme) produced <specificity cut="">,
  which pepXML does not allow; the specificity is now omitted, which it does
- 'search_engine' is an attribute of 'search_summary', not of
  'msms_run_summary', where it was written as well
Copilot AI balanced review requested due to automatic review settings September 29, 2026 18:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 29, 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: 59e76e5e-6849-44d0-ba41-2f10322905d4
📥 Commits

Reviewing files that changed from the base of the PR and between ec5b1b4 and d41eb07.

📒 Files selected for processing (2)
  • src/openms/source/FORMAT/PepXMLFile.cpp
  • src/tests/topp/IDFileConverter_25_output.pep.xml
💤 Files with no reviewable changes (1)
  • src/tests/topp/IDFileConverter_25_output.pep.xml

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

PepXMLFile::store no longer writes search_engine on msms_run_summary. It writes enzyme specificity only when it extracts a nonempty cut value. Expected PepXML outputs were updated.

Changes

PepXML output

Layer / File(s) Summary
Writer output and expected fixtures
src/openms/source/FORMAT/PepXMLFile.cpp, src/tests/class_tests/openms/data/PepXMLFile_test_out*, src/tests/topp/IDFileConverter_*_output.pepXML, src/tests/topp/IDFileConverter_25_output.pep.xml
The writer keeps search_engine on search_summary and omits it from msms_run_summary. It emits <specificity> only when it extracts a nonempty cut value. Expected output fixtures reflect these changes.

Suggested reviewers: timosachsenberg

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to d41eb

The requested output changes are reflected in the writer and fixtures. No concrete new merge-blocking behavior is established; the v117 fidelity rule remains unverified.

Security Architecture Review

Security architecture risk: 🔵 Low · up to d41eb

The changes remain within the existing file-export path and introduce no demonstrated increase in access or privileges. Compatibility uncertainty remains because nonspecific-enzyme output also changes, and downstream interpretation has not been established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated changed exposure is the content of generated pepXML files and their consumers. The destination authority is unchanged; no additional tenant, service, datastore or environment exposure is established by the inspected delta.

Trust Boundaries and Controls

  • inferred — The existing caller-to-file serialization boundary is preserved. Conditional specificity emission does not introduce a new trust transition or bypass an identified security control. Schema conformance alone does not prove downstream semantic compatibility.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The incremental change adds a special case that omits specificity for unspecific cleavage and changes IDFileConverter_25_output.pep.xml. This enzyme previously produced a schema-valid cut="A";… Revert the unspecific cleavage special case and its expected-output change, or add an active linked requirement that covers this semantic change.
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 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: writing schema-valid enzyme specificity and placing search_engine on the correct pepXML element.
Linked Issues check ✅ Passed Issue #10345 requires the writer to omit empty specificity for unknown enzymes and remove search_engine from msms_run_summary. PepXMLFile::store emits specificity only when cut is nonempty…
Full details: Out of Scope Changes check

Explanation

The incremental change adds a special case that omits specificity for unspecific cleavage and changes IDFileConverter_25_output.pep.xml. This enzyme previously produced a schema-valid cut="A"; the change is not needed to meet issue #10345’s unknown-enzyme or search_engine requirements. The current PR description also identifies this semantic change as separate and says it was left unchanged.

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 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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 tags in line,
The run summary looks just fine.
The cut must hold a letter true,
The search engine stays in view.
The fixtures match the writer’s way,
And bounce along to schema day!

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

@timosachsenberg

Copy link
Copy Markdown
Contributor

the unspecific cleavage case should be fixed in the same PR.

…c cleavage

'unspecific cleavage' cuts after every residue (RegEx "(?<=[A-Z])"). The
regex parsing that extracts a single cut residue from an enzyme's RegEx
read that pattern as cutting only after alanine ('A', the first letter
the character class happens to contain), writing cut="A" - schema-valid,
but semantically wrong. Treated the same as an enzyme with no cleavage
rule (e.g. unknown_enzyme): no <specificity> element at all, which the
reader already accepts as valid for any named enzyme (it only falls back
to parsing <specificity> when the enzyme name is 'unknown_enzyme').
@ManasBagul23

Copy link
Copy Markdown
Contributor Author

Done. unspecific cleavage is now treated the same as an enzyme with no cleavage rule: no <specificity> element at all (its RegEx (?<=[A-Z]) has no single cut residue to express; the previous code read it as cutting only after alanine, which is schema-valid but wrong). The reader already handles this correctly either way — it only falls back to parsing <specificity> when the enzyme name is unknown_enzyme, and unspecific cleavage is a named enzyme resolved straight from ProteaseDB.

Updated IDFileConverter_25_output.pep.xml to match, and verified in Docker: TOPP_IDFileConverter_25/_out1 and PepXMLFile_test pass with the fix, and a red check (reverting PepXMLFile.cpp) confirms the fixture catches a regression.

@timosachsenberg timosachsenberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Checked: search_engine is no longer written on <msms_run_summary>, and <specificity> is omitted when no cut can be derived (unknown enzyme, no/unspecific cleavage). All 8 reference changes follow from that, the output for every other enzyme in Enzymes.xml is unchanged, and the files still read back correctly with develop's reader. It also merges cleanly with current develop.

Non-blocking follow-ups:

  • Please add a CHANGELOG FIX: entry, since the pepXML output changes.
  • The output is not fully schema-valid yet (e.g. spectrum_query index="0", X in cut="KRX"), so the title overstates it a little. The description still says unspecific cleavage is written as cut="A".
  • Consider EnzymaticDigestion::UnspecificCleavage instead of the string literal.

Generated by Claude Code

@timosachsenberg
timosachsenberg merged commit dbddf36 into OpenMS:develop Oct 15, 2026
31 checks passed
timosachsenberg pushed a commit that referenced this pull request Oct 15, 2026
…ersion, #10583, #10492, #10525, #10524, #10346, #9782)

Conflicts in ConversionHelper and its test: develop removes
MapConversion::convert(PeakMap -> ConsensusMap) and moves its peak
selection tests to MapAlignmentAlgorithmPoseClustering_test; this branch
keeps the identification data handling of the remaining conversions
(convertIdentifications() and its test section). FileConverter: develop's
comment about OMS input is dropped, as this branch removes .oms.

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

PepXMLFile writes pepXML that does not validate against its own schema

3 participants