Skip to content

[FIX] IDFileConverter/PepXMLFile: select pepXML runs by file name, separator-agnostic (#3502) - #10309

Merged
timosachsenberg merged 2 commits into
developfrom
claude/great-planck-cd6t0d
Sep 29, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
claude/great-planck-cd6t0d

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #3502. IDFileConverter -in <file>.pepXML -mz_file <path> failed with "Found no experiment with name ..." whenever the run's base_name in the pepXML did not end with exactly the path given as -mz_file:

  • Without -mz_name, IDFileConverter passed the full -mz_file path as the experiment name.
  • PepXMLFile::load then selected runs with a raw hasSuffix(base_name, experiment_name).

The TPP writes base_name with / even on Windows (e.g. src/tests/topp/IDFileConverter_10_input.pepXML: c:/Inetpub/...), so a native D:\... path, as in the report, could never match. The same happened for moved data and for any -mz_file with a directory part against OpenMS' own pepXML output, which stores only the file stem (e.g. PepXMLFile_test.pepxml with the absolute path of PepXMLFile_test.mzML). At the same time the raw suffix test was too loose: LN1 selected both L_LN1 and H_LN1 and merged their PSMs.

Changes:

  • PepXMLFile::load: the experiment name has to form whole trailing path components of base_name, with / and \ treated alike. A name that matches runs with different base_names (e.g. equally named spectra files in different folders) is now an error instead of silently merging them. The not-found error lists the base_names in the file. lookup_ is reset at the start of load(), so a PepXMLFile can be reused after a failed load (previously it kept pointing to the caller's destroyed lookup).
  • IDFileConverter: without -mz_name, the run is selected by the file name of -mz_file, since base_name records where the spectra were at search time, often on another machine. -mz_name can still give more of the path. Documentation and parameter description updated.

Behavior changes to be aware of:

  • A partial name that is not a whole path component (e.g. LN1 for L_LN1) no longer matches.
  • If several runs in one pepXML share the file name of -mz_file (in different folders), IDFileConverter now stops and asks for -mz_name instead of relying on the full path.

Tests:

  • New PepXMLFile_test section with a minimal TPP-style file (light/run1, heavy/run1, light/prerun1): Windows paths, whole-component matching, runs of equally named files, error messages, reusing the object after an error.
  • New TOPP test TOPP_IDFileConverter_2_mz_file: the existing IDFileConverter_2 conversion without -mz_name (failed before this change), compared against the same expected output.
  • New TOPP test TOPP_IDFileConverter_2_mz_file_spectrast: real SpectraST output (THIRDPARTY/SpectrastAdapter_1_output.pep.xml, whose base_name is the path of the spectra on the machine the search ran on), converted with -mz_file pointing to the shipped THIRDPARTY/spectra_spectrast.mzXML. It fails with "Found no experiment with name" when IDFileConverter's old default (the full -mz_file path) is restored.

Local validation (Linux, GCC 13, Release, dependencies from conda-forge): PepXMLFile_test, PepXMLFileMascot_test and all 72 TOPP_IDFileConverter_* tests pass (74/74), including the three new ones. The old behavior, checked with pyopenms 3.5.0: on the new class-test file, Windows paths fail while run1 and un1 silently load all three runs; PepXMLFile_test.pepxml with the absolute path of PepXMLFile_test.mzML fails with "Found no experiment with name".

Not included: for unknown enzymes the reader requires no_cut on <specificity>, although the pepXML schema marks it optional and OpenMS' own writer omits it, so OpenMS cannot read back its own pepXML in that case. That is a separate issue.

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_01LeAQtCyY6D6UdA1Jb8HGCz


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • pepXML run selection now matches complete trailing path components and treats / and \ as equivalent, preventing partial path matches.
    • IDFileConverter can select a run using the mz_file filename without requiring mz_name. Additional path details can distinguish runs with the same filename.
    • Conversion reports an error when no run matches or when multiple distinct runs match, and includes available run names to help identify the correct selection.

…parator-agnostic (#3502)

IDFileConverter with pepXML input and 'mz_file' failed with "Found no
experiment with name" unless the run's 'base_name' ended with exactly the
path given: without 'mz_name' the full 'mz_file' path was the experiment
name, and PepXMLFile compared it as a raw string suffix. The TPP writes
'base_name' with '/' even on Windows, so native 'C:\...' paths never
matched; moved data and OpenMS' own pepXML (file stem only) failed too.
The raw suffix was also too loose ('LN1' selected 'L_LN1' and 'H_LN1').

- PepXMLFile::load: the experiment name has to form whole trailing path
  components of 'base_name', '/' and '\' treated alike. Matching runs with
  different 'base_name's is an error instead of merging them; the
  not-found error lists the 'base_name's in the file. Reset lookup_ at
  the start of load() so the object can be reused after a failed load.
- IDFileConverter: without 'mz_name', match the file name of 'mz_file'.
- Tests: PepXMLFile_test section with a TPP-style file; TOPP test
  converting PepXMLFile_test.pepxml with 'mz_file' only.

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

Copy link
Copy Markdown
Contributor Author

build-wheels-linux-arm failed before anything was built: in the "Build and install OpenMS in container" step, yum install -y cmake ninja-build libcurl-devel libicu could not download the AlmaLinux 9.8 AppStream metadata for aarch64 (HTTP 404 on every mirror), so ninja was missing and CMake could not configure. That is an AlmaLinux mirror-sync outage, not this PR's change (which does not touch CI or packaging); the same job passed on #10248 about an hour earlier. No fix exists yet; the step could retry yum (e.g. yum makecache in a loop) to ride out such outages. I'll re-run the failed job once when this workflow run has finished.


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Sep 28, 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: dd54836d-928e-43fd-a4f8-4fe96c2df8c8

📥 Commits

Reviewing files that changed from the base of the PR and between 346c79a and c4cc4a0.

📒 Files selected for processing (1)
  • src/tests/topp/CMakeLists.txt

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

PepXML run selection now matches normalized, complete trailing path components and reports missing or ambiguous matches. IDFileConverter uses the mz_file basename when mz_name is empty. Tests cover separator handling, partial matches, ambiguity, parser reuse, and conversion.

Changes

pepXML experiment selection

Layer / File(s) Summary
Path-component matching
src/openms/include/OpenMS/FORMAT/PepXMLFile.h, src/openms/source/FORMAT/PepXMLFile.cpp
PepXMLFile normalizes slash styles and matches experiment names at complete trailing path components. It tracks distinct run base names for later validation.
Run validation and regression coverage
src/openms/source/FORMAT/PepXMLFile.cpp, src/tests/class_tests/openms/data/PepXMLFile_test_base_names.pepxml, src/tests/class_tests/openms/source/PepXMLFile_test.cpp, CHANGELOG
The loader reports missing or ambiguous matches with relevant base names. Tests cover matching, error cases, loading all runs, and reuse after a failed load.
IDFileConverter selection and conversion test
src/topp/IDFileConverter.cpp, src/tests/topp/CMakeLists.txt
An empty mz_name defaults to the mz_file basename. The added tests convert pepXML without mz_name and compare the output with an existing reference.

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to c4cc4

No actionable merge-blocking risk is evident in the reviewed changes; the added coverage exercises the updated pepXML run-selection behavior.

Architecture Summary

Architecture risk: 🔵 Low · up to c4cc4

The change affects 2 systems.

Changed systems: src, CHANGELOG

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 6 changed files map to changed impact.
  • observed — CHANGELOG (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG: The changelog adds an IDFileConverter pepXML input change: mz_file matches by file name, while mz_name can supply more path detail. PepXMLFile compares whole trailing path components with either slash style, rejects matches across different base_name values, and lists available base_name values when no match is found.
  • observed — Modified behavior in src/openms/include/OpenMS/FORMAT/PepXMLFile.h: The load documentation now describes experiment_name as an input used to select runs, specifies trailing path-component matching after removing its extension with / and \ treated alike, and documents ParseError for no matches or matches with different base_names.
  • observed — Modified behavior in src/openms/include/OpenMS/FORMAT/PepXMLFile.h: Adds the private isExperimentOfInterest_(std::string base_name) declaration and documents that it checks whether a run belongs to the selected experiment while recording its base_name.
  • observed — Modified behavior in src/openms/include/OpenMS/FORMAT/PepXMLFile.h: Updates the exp_name_ comment to specify that the experiment filename has its extension removed and its path separator normalized to /.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 4 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #3502 requires IDFileConverter to select the spectra run for PeptideProphet pepXML. IDFileConverter uses the -mz_file basename when -mz_name is absent. PepXMLFile matches complete traili…
Out of Scope Changes check ✅ Passed The changes support issue #3502 by improving pepXML run selection, reporting missing or ambiguous matches, resetting loader state, and adding related tests and documentation. The incremental change ad…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: separator-agnostic pepXML run selection in IDFileConverter and PepXMLFile by file name.
Full details: Docstring Coverage

Explanation

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

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • 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 each path with care,
Through slashes, names, and folders there.
The matching runs now come to light,
And missing names are reported right.
Then carrots crunch: the tests pass bright!

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

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@claude was this validated on true files

Copy link
Copy Markdown
Contributor Author

Partly. On real tool output from the repo's test data, the new IDFileConverter against the old matching (pyopenms 3.5.0 loading with the full -mz_file path, which is what the old default passed):

pepXML (real tool output) selected via old new
THIRDPARTY/SpectrastAdapter_1_output.pep.xml: SpectraST; base_name is an absolute path on the machine the search ran on -mz_file .../THIRDPARTY/spectra_spectrast.mzXML Found no experiment 1 of 1 PSM
THIRDPARTY/MSFraggerAdapter_7_opt_out.pepXML: MSFragger, base_name="spectra" -mz_file .../THIRDPARTY/spectra.mzML Found no experiment 3 of 3 PSMs
IDFileConverter_10_input.pepXML: TPP 4.7 on Windows (X!Tandem, PeptideProphet, XPRESS), base_name="c:/Inetpub/.../LN1/L_LN1" -mz_name 'c:\Inetpub\...\LN1\L_LN1.mzXML' (native Windows path) Found no experiment 2 PSMs, only the L_LN1 run (4 in the file)

The same TPP file with -mz_name H_LN1.mzXML, the file name -mz_file now passes, selects the 2 PSMs of H_LN1. The Mascot export (IDFileConverter_6) and the other pepXML inputs of the IDFileConverter tests give unchanged results.

Not covered: the reporter's own files; a TPP file together with its own spectra (the repo has no spectra for the TPP file, so -mz_file there was checked through the file name as above); and the retention time lookup from the spectra file, because all of these pepXMLs carry retention_time_sec (this PR does not change the lookup). The new class-test file is synthetic. I can add the SpectraST pair as a TOPP test if you want the real-file case covered in CI.


Generated by Claude Code

…t via mz_file (#3502)

THIRDPARTY/SpectrastAdapter_1_output.pep.xml is real SpectraST output
whose 'base_name' is the path of the spectra on the machine the search
ran on. Converting it with 'mz_file' pointing to the shipped
THIRDPARTY/spectra_spectrast.mzXML failed with "Found no experiment
with name" before the fix and succeeds now. Uses only files that are
already in the repository.

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

Copy link
Copy Markdown
Contributor Author

build-wheels-windows on c4cc4a0 failed before building anything: its "Download contrib" step (gh release download -R OpenMS/contrib --pattern 'contrib_build-Windows.tar.gz') found no asset matching that name in the latest OpenMS/contrib release ("no assets match the file pattern"). The same step succeeded at 15:54 UTC in the wheel run of #10223 and failed here at 16:10, so the latest contrib release changed in between and currently has no Windows asset. That is not this PR's change, which touches neither CI nor contrib (the new commit only adds a TOPP test). No fix exists in this PR's scope; the asset has to be attached to the contrib release again, or the workflow pinned to a release tag. I'll re-run the failed job once when this workflow run has finished and the Windows asset is downloadable again.


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.

IDFileConverter crashes with PeptideProphet output

2 participants