Skip to content

fix(ProSE): resolve sibling PercolatorAdapter via File::findSiblingTOPPExecutable - #9204

Merged
timosachsenberg merged 1 commit into
developfrom
fix/prose-percolator-sibling-lookup
Apr 22, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
fix/prose-percolator-sibling-lookup

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • ProSE called Percolator rescoring with runExternalProcess_(String("PercolatorAdapter"), ...) — a bare name.
  • runExternalProcess_ → ExternalProcess::run → boost::process only searches $PATH. In dev builds (or any install where the OpenMS bin/ directory is not on $PATH) the adapter isn't found, and rescoring silently falls back to HyperScore with a one-line WARN.
  • Resolve the sibling binary via File::findSiblingTOPPExecutable("PercolatorAdapter") once, before the per-file loop. If resolution throws FileNotFound, skip rescoring once with a clear warning instead of failing silently per file.

Reproduction

Symptom in the run log (pre-fix):

[ProSE] Rescoring DN17_Liver_classI_techRep2.mzML with Percolator...
Standard error: Process 'PercolatorAdapter' failed to start. Does it exist? Is it executable?
Percolator rescoring failed for DN17_Liver_classI_techRep2.mzML. Using original HyperScore results.

PercolatorAdapter lives at <OpenMS-build>/bin/PercolatorAdapter — invoking by absolute path works, but that directory is not on $PATH in 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:

  • Log shows [ProSE] Rescoring ... with Percolator... directly followed by ProSE took — no "failed to start" error, no "Using original HyperScore" fallback.
  • Wall: 1:22:45 (vs. 1:20:35 pre-fix where Percolator silently failed — the ~2 min delta is Percolator actually doing work).
  • Matched spectra unchanged (28,235); unique peptides 23,417 after Percolator q-value filtering (vs. 23,422 when Percolator silently fell back to HyperScore).

Notes

  • The user-supplied -percolator_executable parameter is for the external percolator binary (correctly passed via -percolator_executable arg of PercolatorAdapter) — not for the adapter itself.
  • File::findSiblingTOPPExecutable searches relative to the currently running executable path, so it works in dev builds, bin-installed setups, and macOS .app bundles alike.
  • OpenNuXL has the same pattern at src/topp/OpenNuXL.cpp:4788 and :6410 — out of scope for this PR, worth a follow-up.

Test plan

  • ProSE builds with the change
  • End-to-end ProSE run on immunopeptidomics mzML confirms PercolatorAdapter is found and rescoring succeeds
  • CI green

🤖 Generated with Claude Code

…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]>
@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Added logic to resolve the sibling PercolatorAdapter executable path at runtime using File::findSiblingTOPPExecutable(), with exception handling to gracefully skip Percolator rescoring when the binary is not available. Wrapped the rescoring loop in a conditional block to execute only if the adapter path is resolved successfully.

Changes

Cohort / File(s) Summary
PercolatorAdapter Executable Resolution
src/topp/ProSE.cpp
Added runtime resolution of PercolatorAdapter executable path with try-catch error handling for missing binaries. Wrapped rescoring loop in conditional block to skip processing when adapter cannot be located. Updated process invocation to use resolved path instead of bare executable name.

Poem

🐰 A sibling sought along the path so keen,
When PercolatorAdapter cannot be seen,
We catch the exception with grace and care,
And skip the rescoring with a warning fair,
Robust code hops on, unaware! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: resolving the PercolatorAdapter executable path using File::findSiblingTOPPExecutable, which is the core fix in this PR.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/prose-percolator-sibling-lookup

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 and usage tips.

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

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 | 🟠 Major

Add braces around the for under if (!perc_adapter.empty()) and re-indent the loop body.

The new if on line 320 governs the bare for on line 321 without braces. It is functionally correct today (the for is a single statement), but:

  1. It violates the house style that requires braces even for single-line blocks, and is a maintenance trap — adding any statement below the for will silently fall outside the if.
  2. 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3d85acf3-b476-420f-8951-938b22f638f1

📥 Commits

Reviewing files that changed from the base of the PR and between c162f2d and e06b9bd.

📒 Files selected for processing (1)
  • src/topp/ProSE.cpp

@timosachsenberg
timosachsenberg merged commit 20763e6 into develop Apr 22, 2026
45 checks passed
@timosachsenberg
timosachsenberg deleted the fix/prose-percolator-sibling-lookup branch April 22, 2026 07:01
timosachsenberg pushed a commit that referenced this pull request Apr 23, 2026
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]>
@timosachsenberg timosachsenberg mentioned this pull request Jun 8, 2026
timosachsenberg added a commit that referenced this pull request Jul 9, 2026
… 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]>
timosachsenberg added a commit that referenced this pull request Jul 10, 2026
…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]>
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