Repository navigation
fix(ProSE): resolve sibling PercolatorAdapter via File::findSiblingTOPPExecutable - #9204
Conversation
…PPExecutable
ProSE invoked the Percolator rescoring step with the bare name
"PercolatorAdapter". runExternalProcess_ hands that to boost::process,
which only searches $PATH — in a dev build (or any install where the
OpenMS bin/ directory is not on PATH) the adapter is not found and the
rescoring silently falls back to HyperScore with just a WARN line:
Standard error: Process 'PercolatorAdapter' failed to start.
Does it exist? Is it executable?
Percolator rescoring failed for <file>. Using original HyperScore results.
Resolve the sibling binary via File::findSiblingTOPPExecutable before
the per-file loop; on FileNotFound, skip rescoring once with a clear
warning instead of retrying (and failing silently) per file.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
📝 WalkthroughWalkthroughAdded logic to resolve the sibling Changes
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/topp/ProSE.cpp (1)
320-370: 🛠️ Refactor suggestion | 🟠 MajorAdd braces around the
forunderif (!perc_adapter.empty())and re-indent the loop body.The new
ifon line 320 governs the bareforon line 321 without braces. It is functionally correct today (theforis a single statement), but:
- It violates the house style that requires braces even for single-line blocks, and is a maintenance trap — adding any statement below the
forwill silently fall outside theif.- The pre-existing loop body (lines 322–369) now lives one nesting level deeper but was not re-indented, which makes the control flow hard to read and masks the scope of the new guard.
As per coding guidelines: "Braces must be on their own lines and aligned; always use braces even for single-line blocks".
♻️ Proposed fix
- if (!perc_adapter.empty()) - for (Size i = 0; i < in_list.size(); ++i) + if (!perc_adapter.empty()) { - auto& result = mfres.per_file[i]; - if (result.exit_code != ProSEAlgorithm::ExitCodes::EXECUTION_OK) continue; - ... - } - } + for (Size i = 0; i < in_list.size(); ++i) + { + auto& result = mfres.per_file[i]; + if (result.exit_code != ProSEAlgorithm::ExitCodes::EXECUTION_OK) continue; + // ... re-indent the rest of the existing loop body one level deeper ... + } + } + }(Only the brace addition and indentation of lines 322–369 are required; behavior is unchanged.)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/topp/ProSE.cpp` around lines 320 - 370, Add explicit braces around the if (!perc_adapter.empty()) that currently precedes the for loop and re-indent the entire loop body (the block handling mfres.per_file iteration: uses variables/result fields like mfres.per_file, result, tmp_in/tmp_out/tmp_weights, perc_params, runExternalProcess_, percolator_succeeded) so the for loop and its full body are clearly nested inside the if; ensure opening and closing braces are on their own lines and aligned with the if to match project style.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/topp/ProSE.cpp`:
- Around line 320-370: Add explicit braces around the if (!perc_adapter.empty())
that currently precedes the for loop and re-indent the entire loop body (the
block handling mfres.per_file iteration: uses variables/result fields like
mfres.per_file, result, tmp_in/tmp_out/tmp_weights, perc_params,
runExternalProcess_, percolator_succeeded) so the for loop and its full body are
clearly nested inside the if; ensure opening and closing braces are on their own
lines and aligned with the if to match project style.
Restore ProSE/FragmentIndex/File entries dropped by the FeatureFinderCentroided reorganization commit (#9159) and add new entries for commits merged after the last sync: - #9188: ProSE BREAKING: default isotope error range changed to [0,+2] - #9191: ProSE SNES mother-peptide indexing for non-specific searches - #9195: ProSE fix: defer PSM FDR when Percolator enabled; valid .pin output - #9203: FragmentIndex: fixed bucket_size 4096 for tighter candidate lists - #9204: ProSE: resolve PercolatorAdapter via findSiblingTOPPExecutable - #9205: ProSE: per-file output isolation + dangling decoy ref crash fix - #9207: File::rename: cross-device fallback (copy+remove on EXDEV) Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
… external CMakeLists to LF - Remove external tracker/issue references (#9460 §1, #9452, #9204, #9075, Lxx) from added test comments; comments now describe the durable behavior under test. - Normalize src/tests/external/CMakeLists.txt to LF (matches .gitattributes eol=lf), which also clears the trailing-whitespace (CR) that git diff --check flagged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…only config, downstream Qt contract (#9460) (#9603) * [TEST] Infrastructure (§1): non-ASCII paths, exit-code mapping, read-only config, downstream Qt contract (#9460) Close the remaining §1 [AUTO] gaps of the OpenMS 3.6.0 pre-release testing plan (#9460). Tests only. - PathUtils_test: Windows-only UNC + ANSI-codepage to_path() cases under #ifdef _WIN32 (L35). - TOPP FileConverter: read AND write through a non-ASCII (UTF-8) path, materialized at test time via `cmake -E copy` (the permanent #9452 regression) (L37). - File_test: pin the "siblings only, no PATH fallback" contract of findSiblingTOPPExecutable (its TODO / #9204) plus a negative findExecutable case (L40). - THIRDPARTY: assert a present-but-failing external program returns EXTERNAL_PROGRAM_ERROR (9), distinct from the EXTERNAL_PROGRAM_NOTFOUND (14) of a missing binary (L41). - UpdateCheck_test (new): an unwritable config dir logs a warning and returns gracefully -- no network request, no crash (the $HOME-not-writable fix #9075) (L45). - external/: a second downstream target that finds Qt6 itself and links Qt6::Core, proving OpenMS exports no transitive Qt6 (L56). Co-Authored-By: Claude Opus 4.8 <[email protected]> * [TEST] Make CometAdapter failing-executable test portable * [TEST] Address review: drop tracker IDs from test comments, normalize external CMakeLists to LF - Remove external tracker/issue references (#9460 §1, #9452, #9204, #9075, Lxx) from added test comments; comments now describe the durable behavior under test. - Normalize src/tests/external/CMakeLists.txt to LF (matches .gitattributes eol=lf), which also clears the trailing-whitespace (CR) that git diff --check flagged. Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
Summary
runExternalProcess_(String("PercolatorAdapter"), ...)— a bare name.runExternalProcess_→ExternalProcess::run→ boost::process only searches$PATH. In dev builds (or any install where the OpenMSbin/directory is not on$PATH) the adapter isn't found, and rescoring silently falls back to HyperScore with a one-line WARN.File::findSiblingTOPPExecutable("PercolatorAdapter")once, before the per-file loop. If resolution throwsFileNotFound, skip rescoring once with a clear warning instead of failing silently per file.Reproduction
Symptom in the run log (pre-fix):
PercolatorAdapterlives at<OpenMS-build>/bin/PercolatorAdapter— invoking by absolute path works, but that directory is not on$PATHin a typical dev environment.E2E verification
Re-ran ProSE on
DN17_Liver_classI_techRep2.mzML(SNES, 45M mothers, human SwissProt, 7 ppm / 20 ppm, 8 threads) with this fix applied:[ProSE] Rescoring ... with Percolator...directly followed byProSE took— no "failed to start" error, no "Using original HyperScore" fallback.Notes
-percolator_executableparameter is for the external percolator binary (correctly passed via-percolator_executablearg of PercolatorAdapter) — not for the adapter itself.File::findSiblingTOPPExecutablesearches relative to the currently running executable path, so it works in dev builds, bin-installed setups, and macOS .app bundles alike.src/topp/OpenNuXL.cpp:4788and:6410— out of scope for this PR, worth a follow-up.Test plan
PercolatorAdapteris found and rescoring succeeds🤖 Generated with Claude Code