Skip to content

[FIX,TOPP,ID] PSMFeatureExtractor: remove the multi-search-engine mode - #9896

Merged
timosachsenberg merged 2 commits into
developfrom
remove-psmfe-multi-search-engine-mode
Aug 9, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
remove-psmfe-multi-search-engine-mode

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removes PSMFeatureExtractor's multi-search-engine mode: the flags -multiple_search_engines, -concat, -skip_db_check, -impute and -limit_imputation. -in now takes a single file.

Both code paths silently corrupted data, and a search of public code turned up no users — only OpenMS's own two TOPP tests, the auto-generated Galaxy CTD wrapper (exposure, not usage), and three KNIME workflows that set both flags to false. No repository anywhere sets them true.

-concat never worked

Running it on OpenMS's own multi-engine test data aborts with exit 8:

PSMFeatureExtractor -in MSGFPlusAdapter_1_out.idXML XTandemAdapter_1_out.idXML \
  -multiple_search_engines -skip_db_check -concat -out out.idXML
→ exit 8: "Could not convert non-string DataValue of type 'Empty'"
  • X!Tandem aborts. The branch reads getMetaValue("XTandem_score"), a MetaValue no OpenMS X!Tandem path writes (only PepXMLFile reads it). CONCAT:XTandem becomes an empty DataValue and the idXML writer throws, after a partial file has been written.
  • MS-GF+ yields NaN. evalue = toDouble(getMetaValue("MS:1002049")) takes the raw score despite the // evalue comment (MS-GF+'s E-value is MS:1002053). Raw scores are routinely negative, so log() gives NaN. The shipped fixture combined.concat.perco.in.idXML has 4 of 29 CONCAT:lnEvalue values baked in as nan — which is why the class test passed on the bug.
  • Only 4 of the 7 supported engines (MS-GF+, Mascot, Comet, X!Tandem) had a branch at all; MSFragger/andes/Sage got no CONCAT:<engine> value and a constant lnEvalue = log(1000) while extra_features still advertised the feature. Only Comet's branch was correct.

The merge path silently discarded most spectra

getScanMergeKey_ parses a scan number out of scan= or index= native IDs and otherwise leaves it at its initialiser 0 — the same key for every spectrum, so the std::map kept only the last one. No warning: the existing "no known spectrum identifiers" message only fires when the reference is empty, not when it is unparseable.

On OpenMS's own test data (3 spectra, both engines agreeing on all 3), changing nothing but the native-ID form:

spectrum_reference input spectra output PeptideIdentifications
spectrum=0/1/2 (shipped test data) 3 1
scan=0/1/2 3 3, each MULTI:numHits=2

This is not a corner case: in our own shipped idXML fixtures the prefixes run spectrum= 211×, scan= 33×, index= 11×. spectrum= is PSI MS:1000777, and MzMLHandler.cpp:4071 shows OpenMS itself falls back to writing it when input native IDs are invalid. Sciex WIFF (sample=1 period=1 cycle=…) and file= single-peak-list IDs collapse the same way. The reference PSMFeatureExtractor_1_out.idXML enshrined the loss, so TOPP tests 1 and 2 passed green.

Library / pyOpenMS

The now-unused statics concatMULTISEPeptideIds, mergeMULTISEPeptideIds, addMULTISEFeatures, addCONCATSEFeatures and getScanMergeKey_ are removed from PercolatorFeatureSetHelper and from the pyOpenMS bindings. mergeMULTISEProteinIds stays — PercolatorAdapter.cpp:761 uses it.

⚠️ Breaking for pyOpenMS callers of those four statics. No public usage was found.

PercolatorAdapter's mixed-engine error message now points at ConsensusID instead of PSMFeatureExtractor.

Tests

  • TOPP tests 1 and 2 become single-engine idXML/mzid runs. Old test 3's reference carries over byte-identical as the new _1_out.idXML, so the surviving single-engine path is provably unchanged.
  • The new mzid reference was cross-validated against that independent idXML reference (same feature set, hit count, feature_extractor tag) rather than simply regenerated.
  • mergeMULTISEProteinIds and checkExtraFeatures had been covered only via the removed functions (checkExtraFeatures was literally NOT_TESTABLE). Both now get direct tests asserting the real contract; the union-by-accession expectation is computed in-test from the inputs, so there are no magic numbers.
  • Both new assertions were verified to fail on purpose (28 vs 29, 1 vs 3) before being trusted.

Full build green including pyOpenMS; 151 related ctests pass; pyOpenMS 5693 passed / 79 skipped. TOPP_PercolatorAdapter_1_subprocess_out fails locally with identical numbers on a pristine tree (local percolator binary numerics), unrelated to this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S7QNzj4dhRnX5htcHZFmDm

Summary by CodeRabbit

  • Updated

    • PSM feature extraction now processes one search-result file at a time.
    • Use TOPP_ConsensusID to combine results from different search engines.
    • Protein identification merging now combines search parameters and unifies protein hits by accession.
  • Removed

    • Legacy multi-search-engine concatenation, merging, imputation, limiting, and database-check options.
    • Related library and Python bindings for obsolete feature-processing workflows.

timosachsenberg and others added 2 commits August 9, 2026 08:54
Both multi-engine code paths silently corrupted data and had no users.

-concat aborted while writing X!Tandem input: it read a "XTandem_score"
MetaValue that no OpenMS X!Tandem path ever writes, so CONCAT:XTandem became an
empty DataValue and the idXML writer threw after a partial file. For MS-GF+ it
took log() of the raw score instead of the E-value (MS:1002049 rather than
MS:1002053); raw scores are routinely negative, so CONCAT:lnEvalue came out NaN.
The shipped fixture combined.concat.perco.in.idXML had 4 of 29 lnEvalue values
baked in as "nan", which is why the class test passed on the bug. Only 4 of the
7 supported engines had a branch at all.

The default merge path keyed spectra via getScanMergeKey_, which parses a scan
number out of "scan=" or "index=" native IDs and otherwise leaves it at 0. For
"spectrum=" (PSI MS:1000777 - 211 occurrences vs 33 "scan=" in our own idXML
fixtures, and what MzMLHandler falls back to writing), Sciex "sample=..." and
"file=" IDs, every spectrum therefore got the same key and the std::map kept
only the last one. On our own multi-engine test data 3 spectra collapsed to 1,
with no warning; rewriting only "spectrum=N" to "scan=N" restores all 3. The
reference PSMFeatureExtractor_1_out.idXML enshrined that loss.

Removed the flags -multiple_search_engines, -concat, -skip_db_check, -impute
and -limit_imputation; -in now takes a single file. Use ConsensusID to combine
results from several search engines - PercolatorAdapter's mixed-engine error
message now says so.

The correspondingly unused PercolatorFeatureSetHelper statics
concatMULTISEPeptideIds, mergeMULTISEPeptideIds, addMULTISEFeatures,
addCONCATSEFeatures and getScanMergeKey_ are removed from the library and from
pyOpenMS. mergeMULTISEProteinIds stays, PercolatorAdapter uses it.

Tests: TOPP tests 1 and 2 become single-engine idXML/mzid runs; old test 3's
reference carries over unchanged as the new _1_out.idXML, so the surviving
single-engine path is byte-identical. The new mzid reference was cross-checked
against that independent idXML reference (same feature set, hit count and
feature_extractor tag). mergeMULTISEProteinIds and checkExtraFeatures had been
covered only via the removed functions and now get direct tests; both were
verified to fail on purpose before being trusted. Also fixed the docstrings in
the pyOpenMS bindings, which were each attached to the preceding function.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01S7QNzj4dhRnX5htcHZFmDm
@timosachsenberg
timosachsenberg enabled auto-merge (squash) August 9, 2026 07:02
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 85629e1f-682b-4733-abc0-3947d5b98c88

📥 Commits

Reviewing files that changed from the base of the PR and between 0b0b7bb and e123b36.

📒 Files selected for processing (3)
  • CHANGELOG
  • src/pyOpenMS/bindings/bind_analysis.cpp
  • src/tests/topp/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (3)
  • CHANGELOG
  • src/pyOpenMS/bindings/bind_analysis.cpp
  • src/tests/topp/CMakeLists.txt

📝 Walkthrough

Walkthrough

PSMFeatureExtractor now accepts one search result and removes legacy multi-search processing. Related helper APIs and bindings were removed, while protein merging remains. Tests now cover single-engine MSGF+ extraction and retained helper behavior.

Changes

Single-search extraction

Layer / File(s) Summary
Single-input extraction flow
src/topp/PSMFeatureExtractor.cpp, src/topp/PercolatorAdapter.cpp
PSMFeatureExtractor accepts one input file and removes multi-engine, concatenation, imputation, and database-check options. Multi-engine workflows now reference TOPP_ConsensusID.
Helper API and binding cleanup
src/openms/include/OpenMS/ANALYSIS/ID/PercolatorFeatureSetHelper.h, src/openms/source/ANALYSIS/ID/PercolatorFeatureSetHelper.cpp, src/pyOpenMS/bindings/bind_analysis.cpp, CHANGELOG
Legacy peptide merging, concatenation, feature aggregation, and scan-key APIs were removed. mergeMULTISEProteinIds remains available.
Updated validation coverage
src/tests/class_tests/openms/source/PercolatorFeatureSetHelper_test.cpp, src/tests/topp/CMakeLists.txt, src/tests/topp/PSMFeatureExtractor_1_out.idXML, src/tests/topp/PSMFeatureExtractor_2_out.mzid
Tests now verify protein-hit unioning, extra-feature filtering, and single-engine MSGF+ extraction outputs.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant PSMFeatureExtractor
  participant PercolatorFeatureSetHelper
  participant Output
  User->>PSMFeatureExtractor: Provide one input file
  PSMFeatureExtractor->>PercolatorFeatureSetHelper: Apply single-engine features
  PercolatorFeatureSetHelper-->>PSMFeatureExtractor: Return extracted features
  PSMFeatureExtractor->>Output: Write converted identifications
Loading

Possibly related PRs

  • OpenMS/OpenMS#9643: Both PRs modify PercolatorFeatureSetHelper and PSMFeatureExtractor feature handling.
  • OpenMS/OpenMS#9892: Both PRs address concatenated or multi-search-engine identification results.

Poem

One file hops into the run,
Old search paths are left undone.
Protein hits unite by name,
MSGF+ guards the test domain.
ConsensusID points the way—
A tidy burrow ends the day.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 identifies the removal of PSMFeatureExtractor's multi-search-engine mode, which is the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-psmfe-multi-search-engine-mode

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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/topp/PSMFeatureExtractor.cpp (1)

130-145: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Add a guard for an empty protein_ids before the merge call.

The code checks protein_ids.size() > 1 and throws, but it does not check for protein_ids.size() == 0. If the loaded file yields zero ProteinIdentification runs (for example, a valid mzid/idparquet file that legitimately reports no protein-detection results, or a type-detection mismatch that leaves protein_ids empty), PercolatorFeatureSetHelper::mergeMULTISEProteinIds(all_protein_ids, protein_ids) calls new_protein_ids.front() as its very first statement. This is undefined behavior on an empty vector and can crash the tool with no diagnostic message.

PercolatorAdapter.cpp guards against exactly this case in its analogous readInputFiles_ function (see lines 632-639: if (protein_ids.empty()) { throw Exception::ElementNotFound(...); } before its own call to mergeMULTISEProteinIds). PSMFeatureExtractor.cpp should apply the same guard.

🛡️ Proposed fix to guard against empty protein_ids
       //check and warn if merged from multiple runs
       if (protein_ids.size() > 1)
       {
         throw Exception::InvalidValue(
             __FILE__,
             __LINE__,
             OPENMS_PRETTY_FUNCTION,
             "File '" + in + "' has more than one ProteinIDRun. This is currently not correctly handled."
             "Please use the merge_proteins_add_psms option if you used IDMerger. Alternatively, feed the"
             " original single-run idXML inputs into this tool one by one.",
             "# runs: " + StringUtils::toStr(protein_ids.size()));
       }
+      else if (protein_ids.empty())
+      {
+        throw Exception::ElementNotFound(
+            __FILE__,
+            __LINE__,
+            OPENMS_PRETTY_FUNCTION,
+            "File '" + in + "' has no ProteinIDRun.");
+      }

       all_peptide_ids.insert(all_peptide_ids.end(), peptide_ids.begin(), peptide_ids.end());
       PercolatorFeatureSetHelper::mergeMULTISEProteinIds(all_protein_ids, protein_ids);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/topp/PSMFeatureExtractor.cpp` around lines 130 - 145, In the
input-processing flow before PercolatorFeatureSetHelper::mergeMULTISEProteinIds,
add an empty protein_ids guard matching the existing
PercolatorAdapter::readInputFiles_ behavior: throw an appropriate
Exception::ElementNotFound with a diagnostic message when no
ProteinIdentification runs are loaded. Keep the existing size-greater-than-one
validation and merge behavior unchanged for non-empty protein_ids.
src/pyOpenMS/bindings/bind_analysis.cpp (1)

2227-2300: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Expose addANDESFeatures and addMSFRAGGERFeatures in the pyOpenMS binding.

PercolatorFeatureSetHelper.addANDESFeatures(peptide_ids, feature_set) and PercolatorFeatureSetHelper.addMSFRAGGERFeatures(feature_set) are not bound in src/pyOpenMS/bindings/bind_analysis.cpp, but the C++ side uses both methods for the andes search engine and for MSFragger output. Add bindings matching those signatures to keep the pyOpenMS API parity with the existing search-engine feature helpers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pyOpenMS/bindings/bind_analysis.cpp` around lines 2227 - 2300, Add static
pyOpenMS bindings for OpenMS::PercolatorFeatureSetHelper::addANDESFeatures and
addMSFRAGGERFeatures alongside the existing addMSGFFeatures, addXTANDEMFeatures,
addCOMETFeatures, and addMASCOTFeatures bindings. Match each C++ method’s
signature and wrapper behavior, including the appropriate peptide_ids and
feature_set arguments and returning the updated feature_set, with documentation
consistent with the neighboring helpers.
🧹 Nitpick comments (2)
src/tests/class_tests/openms/source/PercolatorFeatureSetHelper_test.cpp (1)

89-90: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add braces to each range-for body.

Lines 89-90 and Line 111 use range-for statements without braces. The C++ formatting rules require braces for all blocks.

As per coding guidelines, “always use braces for blocks.”

Also applies to: 111-111

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tests/class_tests/openms/source/PercolatorFeatureSetHelper_test.cpp`
around lines 89 - 90, Add braces around the bodies of both range-for loops
iterating over msgf_pods.front().getHits() and comet_pods.front().getHits(), and
apply the same brace style to the range-for statement at line 111. Preserve the
existing loop statements and body logic.

Source: Coding guidelines

src/topp/PSMFeatureExtractor.cpp (1)

143-145: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider simplifying the single-run merge.

-in now accepts exactly one file, so all_protein_ids is empty on the only call to mergeMULTISEProteinIds. In that state the helper does more work than the single-run case needs: it sorts the incoming ProteinHits for a union merge that has nothing to unite, and it stamps a freshly generated "TopPerc_" + date identifier onto the run instead of preserving whatever run identifier the input file already carried. A direct move of protein_ids.front() into all_protein_ids (with the existing search_engine/search-parameter setup inlined) would be clearer for a single-input tool and would avoid discarding the input run's own identifier and date metadata.

This is a code-clarity improvement, not a correctness fix, since the current behavior matches the pre-existing multi-run merge semantics.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/topp/PSMFeatureExtractor.cpp` around lines 143 - 145, In the single-input
aggregation block, replace the first-call use of
PercolatorFeatureSetHelper::mergeMULTISEProteinIds with a direct move of
protein_ids.front() into all_protein_ids, preserving the input run’s identifier
and date metadata. Inline the existing search_engine and search-parameter setup
needed for that assignment, while leaving peptide aggregation and multi-run
merge behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/tests/topp/CMakeLists.txt`:
- Around line 4745-4749: Add a TOPP regression test near the existing
PSMFeatureExtractor tests that invokes PSMFeatureExtractor with a multi-run
ProteinIdentification idXML input and asserts the command fails. Use the
existing test-data and temporary-directory conventions, and do not add a
reference-output comparison; ensure the test specifically exercises rejection of
multiple ProteinIdentification runs.

---

Outside diff comments:
In `@src/pyOpenMS/bindings/bind_analysis.cpp`:
- Around line 2227-2300: Add static pyOpenMS bindings for
OpenMS::PercolatorFeatureSetHelper::addANDESFeatures and addMSFRAGGERFeatures
alongside the existing addMSGFFeatures, addXTANDEMFeatures, addCOMETFeatures,
and addMASCOTFeatures bindings. Match each C++ method’s signature and wrapper
behavior, including the appropriate peptide_ids and feature_set arguments and
returning the updated feature_set, with documentation consistent with the
neighboring helpers.

In `@src/topp/PSMFeatureExtractor.cpp`:
- Around line 130-145: In the input-processing flow before
PercolatorFeatureSetHelper::mergeMULTISEProteinIds, add an empty protein_ids
guard matching the existing PercolatorAdapter::readInputFiles_ behavior: throw
an appropriate Exception::ElementNotFound with a diagnostic message when no
ProteinIdentification runs are loaded. Keep the existing size-greater-than-one
validation and merge behavior unchanged for non-empty protein_ids.

---

Nitpick comments:
In `@src/tests/class_tests/openms/source/PercolatorFeatureSetHelper_test.cpp`:
- Around line 89-90: Add braces around the bodies of both range-for loops
iterating over msgf_pods.front().getHits() and comet_pods.front().getHits(), and
apply the same brace style to the range-for statement at line 111. Preserve the
existing loop statements and body logic.

In `@src/topp/PSMFeatureExtractor.cpp`:
- Around line 143-145: In the single-input aggregation block, replace the
first-call use of PercolatorFeatureSetHelper::mergeMULTISEProteinIds with a
direct move of protein_ids.front() into all_protein_ids, preserving the input
run’s identifier and date metadata. Inline the existing search_engine and
search-parameter setup needed for that assignment, while leaving peptide
aggregation and multi-run merge behavior unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ed277f8-9ff2-4401-8f2e-3c1b82421682

📥 Commits

Reviewing files that changed from the base of the PR and between 1131d8f and 0b0b7bb.

📒 Files selected for processing (13)
  • CHANGELOG
  • src/openms/include/OpenMS/ANALYSIS/ID/PercolatorFeatureSetHelper.h
  • src/openms/source/ANALYSIS/ID/PercolatorFeatureSetHelper.cpp
  • src/pyOpenMS/bindings/bind_analysis.cpp
  • src/tests/class_tests/openms/data/combined.concat.perco.in.idXML
  • src/tests/class_tests/openms/data/combined.merge.perco.in.idXML
  • src/tests/class_tests/openms/source/PercolatorFeatureSetHelper_test.cpp
  • src/tests/topp/CMakeLists.txt
  • src/tests/topp/PSMFeatureExtractor_1_out.idXML
  • src/tests/topp/PSMFeatureExtractor_2_out.mzid
  • src/tests/topp/PSMFeatureExtractor_3_out.idXML
  • src/topp/PSMFeatureExtractor.cpp
  • src/topp/PercolatorAdapter.cpp
💤 Files with no reviewable changes (4)
  • src/tests/class_tests/openms/data/combined.concat.perco.in.idXML
  • src/tests/topp/PSMFeatureExtractor_3_out.idXML
  • src/tests/class_tests/openms/data/combined.merge.perco.in.idXML
  • src/openms/source/ANALYSIS/ID/PercolatorFeatureSetHelper.cpp

Comment on lines +4745 to +4749
add_test("TOPP_PSMFeatureExtractor_1" ${TOPP_BIN_PATH}/PSMFeatureExtractor -test -in ${DATA_DIR_TOPP}/THIRDPARTY/MSGFPlusAdapter_1_out.idXML -out_type idXML -out ${TESTS_TEMP_DIR}/PSMFeatureExtractor_1_out.tmp.idXML)
add_test("TOPP_PSMFeatureExtractor_1_out" ${DIFF} -whitelist "InferenceEngineVersion" "spectra_data" "MS-GF+:" "db=" "date=" "UserParam type=\"string\" name=\"MSGFPlusAdapter:1" -in1 ${TESTS_TEMP_DIR}/PSMFeatureExtractor_1_out.tmp.idXML -in2 ${DATA_DIR_TOPP}/PSMFeatureExtractor_1_out.idXML)
set_tests_properties("TOPP_PSMFeatureExtractor_1_out" PROPERTIES DEPENDS "TOPP_PSMFeatureExtractor_1")

add_test("TOPP_PSMFeatureExtractor_2" ${TOPP_BIN_PATH}/PSMFeatureExtractor -test -in ${DATA_DIR_TOPP}/THIRDPARTY/MSGFPlusAdapter_1_out.idXML ${DATA_DIR_TOPP}/THIRDPARTY/XTandemAdapter_1_out.idXML -multiple_search_engines -skip_db_check -out_type mzid -out ${TESTS_TEMP_DIR}/PSMFeatureExtractor_2_out.tmp.mzid)
add_test("TOPP_PSMFeatureExtractor_2" ${TOPP_BIN_PATH}/PSMFeatureExtractor -test -in ${DATA_DIR_TOPP}/THIRDPARTY/MSGFPlusAdapter_1_out.idXML -out_type mzid -out ${TESTS_TEMP_DIR}/PSMFeatureExtractor_2_out.tmp.mzid)

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Locate relevant files/text =="
rg -n "PSMFeatureExtractor|multi.?run|ProteinIdentification|multiple" src/tests/topp src -g '*.{cpp,h,cxx,hpp,txt}' | head -n 200

echo
echo "== PSMFeatureExtractor implementation candidates =="
fd -i 'PSMFeatureExtractor' . | sort

echo
echo "== CMake top relevant section =="
sed -n '4720,4770p' src/tests/topp/CMakeLists.txt

Repository: OpenMS/OpenMS

Length of output: 41305


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== PSMFeatureExtractor source outline =="
ast-grep outline src/topp/PSMFeatureExtractor.cpp --view expanded || true

echo
echo "== PSMFeatureExtractor relevant source =="
wc -l src/topp/PSMFeatureExtractor.cpp
sed -n '1,260p'

echo
echo "== Exact multiple ProteinIdentification references in src/topp/PSMFeatureExtractor.cpp =="
rg -n -C 4 "ProteinIdentification|multiple|size|at most|only run|too many" src/topp/PSMFeatureExtractor.cpp

echo
echo "== Existing rejection tests in src/tests/topp/CMakeLists.txt =="
sed -n '460,475p;1330,1355p' src/tests/topp/CMakeLists.txt

echo
echo "== Negative/rejection test syntax examples =="
rg -n -C 2 'add_test\(.*-.*expect|expect=|return_code|exit' src/tests/topp/CMakeLists.txt | head -n 160

Repository: OpenMS/OpenMS

Length of output: 891


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Full PSMFeatureExtractor source =="
cat -n src/topp/PSMFeatureExtractor.cpp

echo
echo "== Source branch count =="
wc -l src/topp/PSMFeatureExtractor.cpp

echo
echo "== Search exact identifiers in PSMFeatureExtractor =="
rg -n -C 3 '"ProteinIdentification"|getProteinIdentifications|setProteinIdentifications|throw|at\(|size\(\)|for\s*\(' src/topp/PSMFeatureExtractor.cpp

Repository: OpenMS/OpenMS

Length of output: 12530


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== TOPP test file size and last lines =="
wc -l src/tests/topp/THIRDPARTY/MSGGPlusAdapter_1_out.idXML src/tests/topp/THIRDPARTY/MSGFPlusAdapter_1_out.idXML 2>/dev/null || true
sed -n '1,80p' src/tests/topp/THIRDPARTY/MSGFPlusAdapter_1_out.idXML 2>/dev/null || true
sed -n '1,80p' src/tests/topp/PSMFeatureExtractor_1_out.idXML 2>/dev/null || true

echo
echo "== ProteinIDRun occurrences in available inputs =="
rg -n "ProteinIDRun|<ProteinIdentification" src/tests/topp/src/tests/topp/THIRDPARTY/MSGFPlusAdapter_1_out.idXML src/tests/topp/PSMFeatureExtractor_1_out.idXML 2>/dev/null || true

echo
echo "== Search for IDMerger test data with multiple ProteinIDRun =="
rg -n "merge_proteins_add_psms|IDMerger|ProteinIDRun" src/tests/topp -g '*.idXML' -g '*.mzid' | head -n 200

Repository: OpenMS/OpenMS

Length of output: 15513


Add coverage for multi-run ProteinIdentification rejection.

PSMFeatureExtractor rejects inputs with more than one ProteinIdentification run, but the current TOPP tests only use the single-run MSGFPlusAdapter_1_out.idXML. Add a small TOPP regression that passes an idXML file with multiple ProteinIdentification runs and asserts failure; this covers the new guard and does not require the tool output to match a reference file.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tests/topp/CMakeLists.txt` around lines 4745 - 4749, Add a TOPP
regression test near the existing PSMFeatureExtractor tests that invokes
PSMFeatureExtractor with a multi-run ProteinIdentification idXML input and
asserts the command fails. Use the existing test-data and temporary-directory
conventions, and do not add a reference-output comparison; ensure the test
specifically exercises rejection of multiple ProteinIdentification runs.

Source: Coding guidelines

@timosachsenberg
timosachsenberg merged commit 9dce983 into develop Aug 9, 2026
34 checks passed
@timosachsenberg
timosachsenberg deleted the remove-psmfe-multi-search-engine-mode branch August 9, 2026 09:49
timosachsenberg added a commit that referenced this pull request Aug 11, 2026
Audited PRs merged since the last CHANGELOG update (#9881): most of
them (#9879, #9880, #9882, #9884, #9886, #9892, #9896, #9898, #9900,
#9901, #9888) already carried their own CHANGELOG entries. Only the
Docker library-stage fix (#9891) was missing one.


Claude-Session: https://claude.ai/code/session_01Jgrv6mFL3oawgLdYs1efPH

Co-authored-by: Claude <[email protected]>
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