Repository navigation
[FEATURE] OpenNuXL rescores in process with the built-in Percolator (Percolator::rescorePSMsAsExecutable) - #10837
Closed
timosachsenberg wants to merge 1 commit into
Closed
timosachsenberg wants to merge 1 commit into
timosachsenberg wants to merge 1 commit into
Conversation
…::rescorePSMsAsExecutable) With -percolator_backend builtin (the default), OpenNuXL ran PercolatorAdapter as a subprocess, which rescored the PSMs in process with the Percolator built into OpenMS: idXML written, read by the adapter, written again and read back. OpenNuXL now does that itself, through what PercolatorAdapter's in-process backend does, moved into the library: - Percolator::rescorePSMsAsExecutable(peptide_ids, feature_set, enzyme, min_charge, max_charge, ExecutableOptions): the .pin file (optional), the parameters from the percolator executable's options with PercolatorAdapter's defaults (c_pos 0 by cross-validation, nonparametric PEPs, at most 3 threads, ...) and rescorePSMs(). PercolatorAdapter's in-process backend calls it (no change in behavior); Percolator_test checks it against rescorePSMs() with the parameters set by hand. - OpenNuXL::rescoreInProcess_: what PercolatorAdapter does around it (target/decoy annotations, a decoy, the feature set of the hits' charges and the search's extra_features, the enzyme as OpenNuXL passed it, the weights, the run identifier, the runs marked as post-processed by Percolator). The autotune rescoring works on copies of the PSMs (no _sse_perc_in/_out.idXML any more); the final one on the PSMs of -out, as PercolatorAdapter read them, and still writes _perc.idXML and the .pin file (.tsv). -percolator_backend executable runs PercolatorAdapter as before. So OpenNuXL's builtin rescoring needs no PercolatorAdapter beside it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmXPcqYYZEuE4GfN2xA
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 seconds. View limit details
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. |
4 tasks done
timosachsenberg
added a commit
that referenced
this pull request
Nov 7, 2026
…OpenNuXL share the feature set and run marking (#10843) * Share the feature set and run marking of Percolator rescoring (PercolatorAdapter, ProSE) PercolatorAdapter and ProSE each assembled the .pin feature set of a search run and marked the rescored runs as post-processed by Percolator with their own copy of the code. Two library helpers replace those copies, so that a third tool (OpenNuXL) can rescore in process without another copy and without a second set of Percolator options: - PercolatorInfile::getFeatureSet(search_parameters, min_charge, max_charge): the standard features, the run's 'extra_features' (without them: "score"), Peptide, Proteins. - Percolator::markRescoredRuns(runs, tool, settings, version): search engine "Percolator" (Percolator::VENDORED_VERSION by default), meta value 'percolator' = tool, and the 'Percolator:<name>' search parameters in the order given (an empty value removes one). Percolator itself is still configured only through its Param. Both tools pass their settings in the existing order and with the existing value types (the adapter's flags as int, ProSE's as "true"/"false"), so their output does not change. pyOpenMS binds both helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmYcaEWwX7EQyVSrp2b * OpenNuXL rescores in process with the built-in Percolator With '-percolator_backend builtin' (the default), OpenNuXL ran PercolatorAdapter as a subprocess (idXML out, idXML back), which then rescored in process. OpenNuXL now rescores the PSMs itself: it sets Percolator's Param where PercolatorAdapter's defaults differ from the class's (c_pos 0 by cross-validation, subset_max_train 0, nonparametric PEPs, unitnorm for the final rescoring, at most 3 threads), builds the feature set with PercolatorInfile::getFeatureSet(), calls rescorePSMs(), writes the weights (and the .pin of the final rescoring), and marks the runs with Percolator::markRescoredRuns(). '-percolator_backend executable' still runs the executable through PercolatorAdapter. Based on the OpenNuXL part of #10837, without its Percolator::rescorePSMsAsExecutable() and ExecutableOptions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmYcaEWwX7EQyVSrp2b * Percolator::markRescoredRuns docs: escape <name> for Doxygen Doxygen read 'Percolator:<name>' as an unsupported HTML tag (Doxygen_Warning_test). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmYcaEWwX7EQyVSrp2b * OpenNuXL in-process rescoring: merge the run as PercolatorAdapter merges its input PercolatorAdapter reads its input through PercolatorFeatureSetHelper::mergeMULTISEProteinIds(), which keeps the original search engine and its settings as the search parameters 'SE:OpenNuXL' and 'OpenNuXL:...' (read by ProteinIdentification::getOriginalSearchEngineName() and the mzTab export) and sorts the protein hits by accession. The in-process rescoring did not, so its runs lost that provenance. On a PXD048145 run, the rescored output now equals the former PercolatorAdapter output apart from the Percolator settings and the 'percolator' marker. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmYcaEWwX7EQyVSrp2b --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With
-percolator_backend builtin(the default), OpenNuXL ran PercolatorAdapter as a subprocess, and the adapter rescored the PSMs in process with the Percolator built into OpenMS. Two times per search, the autotune and the final rescoring: OpenNuXL wrote an idXML, the adapter read it, rescored, wrote an idXML, and OpenNuXL read that back. OpenNuXL now rescores the PSMs itself. The part PercolatorAdapter's in-process backend did is moved into the library, so that both share it.Library:
Percolator::rescorePSMsAsExecutable(peptide_ids, feature_set, enzyme, min_charge, max_charge, ExecutableOptions)ExecutableOptionsare the percolator executable's options, with PercolatorAdapter's defaults: c_pos 0 (by cross-validation, instead of the class's 0.1), subset_max_train 0, TDC and train_best_positive off, plus the score type, the threads and an optional .pin file.rescorePSMs(). That is the adapter's former in-process block, unchanged.Percolator_test: a section compares it withrescorePSMs()and the parameters set by hand (scores and q-values of all 600 PSMs). It also checks the parameters (c_pos 0, 8 threads → 3, 0 → 3,uni,nonparametric) and the .pin file (header and 600 rows).OpenNuXL
recalibration_()chooses the backend as before. 'executable' with the percolator executable found runs PercolatorAdapter exactly as before; 'builtin', or 'executable' with the executable not found, now rescores in process (rescoreInProcess_()).rescoreInProcess_()does what PercolatorAdapter did around its rescoring:extra_features, Peptide, Proteins;.weights,_sse_perc.weights);percolator= "OpenNuXL",Percolator:*search parameters, as ProSE marks its in-process rescoring)._sse_perc_in.idXMLand_sse_perc_out.idXMLwere only the adapter's input and output, and are no longer written.-outwith all their hits, as the adapter read them (protein_ids/peptide_idsare filtered by that point). It still writes_perc.idXML(the rescored PSMs) and the .pin file (.tsv).So OpenNuXL's default rescoring needs no PercolatorAdapter beside it (the NuXL desktop app bundles it only for this), and no second process.
Trade-off: a hard crash inside Percolator now ends the search, where before only the adapter process died and OpenNuXL went on without rescoring. Exceptions are caught as before.
Testing
Percolator_test.cpppassg++-13 -std=c++23 -fsyntax-only, against the source tree's headers with stand-in generated headers (OpenNuXL.cpp also with-Wall -Wextra, without warnings).TOPP_OpenNuXLtests have fewer than 1000 PSMs, so they do not reach the rescoring. The in-process path is covered byPercolator_test(the shared function), and will be checked end to end with a larger.rawsearch in the NuXL desktop app's CI once its OpenMS pin includes this.Checklist
rescorePSMsas before)Generated by Claude Code