Skip to content

[FIX] ProSE: a search in which no PSM passes the FDR no longer aborts (empty protein-inference graph) - #10677

Merged
jpfeuffer merged 4 commits into
developfrom
claude/prose-empty-result
Oct 21, 2026
Merged

jpfeuffer merged 4 commits into
developfrom
claude/prose-empty-result

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Bug

A ProSE search in which no PSM passes the PSM FDR aborts when the protein FDR is on:

Building graph on 2309 spectra and 0 proteins.
Error: Unexpected internal error (Graph empty. Build it first.)

(exit code 8, no outputs). Example: a TMT run of Erwinia searched against the human reference proteome alone
(-Search:FDR:PSM 0.01 -Search:FDR:protein 0.01). Such a search (e.g. the wrong database) should report 0 PSMs, as a
search without any PSM already does.

Cause

The PSM FDR filter (IDFilter::filterHitsByScore) leaves the peptide identifications without hits, so ProSE's
!peptide_ids.empty() check passes and ProSEAlgorithm::applyCompleteSetProteinFDR runs
BasicProteinInferenceAlgorithm::run. Its indistinguishable-group annotation builds an IDBoostGraph from the run;
with no PSM mapping to a protein the graph is empty, and IDBoostGraph::calculateAndAnnotateIndistProteins
(IDBoostGraph.cpp:772) throws MissingInformation("Graph empty. Build it first."). The same happens for the pooled
inference of -out_merged and with greedy_group_resolution (clusterIndistProteinsAndPeptides throws there).

Fix

BasicProteinInferenceAlgorithm::run (both overloads, PeptideIdentification and ConsensusMap) skips the graph steps
when the graph has no connected component: there is nothing to group or resolve. The rest is unchanged (with resolution, the unreferenced
proteins are still removed and singleton groups filled). ProSE then skips the picked-protein FDR as it already does
when no decoy protein remains, and writes empty outputs with exit code 0.

Why here and not in ProSE: the empty graph is a valid input of the inference (a run without identifications), and the
fix covers every caller (the single-file protein FDR, the -out_merged pooling, ProSEAlgorithm::search(), the
ProteinInference tool on such an idXML or consensusXML). IDBoostGraph itself keeps throwing on an empty graph, which
annotateIndistinguishableGroups() documents and tests.

Tests

  • BasicProteinInferenceAlgorithm_test: a run whose spectra keep no PSM, and a consensus map whose features and
    unassigned peptide identifications keep none, each for grouping, grouping + resolution and resolution alone: no
    exception, no groups (both fail on develop with the exception above).
  • TOPP_ProSE_15_empty*: a database whose decoys (DECOY_, reused by decoys=auto) are the real
    DatabaseSuitability proteins and whose targets are their reversed sequences, so that no target passes the FDR. One
    input with the protein FDR: exit code 0, valid idXML with 0 peptide hits, QPX psm table valid against the schema,
    QPX and OpenMS psm/proteins tables without rows, summary YAML with matched_spectra: 0 and no failed file. Two
    inputs with -out_merged: exit code 0, merged idXML with 0 peptide hits, listed in the summary. On develop the two
    ProSE runs fail (exit code 8; the merged run has already written its summary YAML, without the merged output) and
    so do the checks of their outputs; the steps that clean the output folders and copy the inputs pass.
  • ctest -R "ProSE|ProteinInference|IDBoostGraph": passing.

🤖 Generated with Claude Code

timosachsenberg and others added 4 commits October 21, 2026 04:23
…ps instead of an exception

When no PSM of a run maps to one of its proteins (e.g. none passed the PSM FDR, which leaves the
peptide identifications without hits), the graph of the indistinguishable-group annotation and the
greedy resolution is empty and IDBoostGraph throws "Graph empty. Build it first.". ProSE's protein
FDR runs this inference, so a search in which no PSM passed the FDR aborted instead of writing empty
results. An empty graph has nothing to group or resolve: skip the graph steps; the protein filtering
of the resolution runs as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, empty outputs

TOPP_ProSE_15_empty: a database whose decoys are the real proteins and whose targets are their
reversed sequences, so that no target passes the FDR. One input with the protein FDR (idXML, QPX and
OpenMS Parquet, summary YAML) and two inputs with -out_merged: exit code 0, no PSM or protein rows,
a valid QPX psm table, a summary without failed files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…skips an empty graph

The ConsensusMap overload of run() has the same graph steps as the PeptideIdentification overload and
threw "Graph empty. Build it first." on a map whose features and unassigned peptide identifications
keep no PSM. Same guard, and a class-test section for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The same file as the empty-result test of the -out_psm_spectra sidecar (#10676) uses, so that the two
branches add one file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@timosachsenberg
timosachsenberg marked this pull request as ready for review October 21, 2026 06:17
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a7d4041f-af29-4451-83cf-6d6fdd741c33
📥 Commits

Reviewing files that changed from the base of the PR and between 8d0afe1 and 9e1487b.

📒 Files selected for processing: 4
  • src/openms/source/ANALYSIS/ID/BasicProteinInferenceAlgorithm.cpp
  • src/tests/class_tests/openms/source/BasicProteinInferenceAlgorithm_test.cpp
  • src/tests/topp/CMakeLists.txt
  • src/tests/topp/ProSE_empty.fasta
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@timosachsenberg
timosachsenberg enabled auto-merge (squash) October 21, 2026 07:32
@jpfeuffer
jpfeuffer disabled auto-merge October 21, 2026 08:25
@jpfeuffer
jpfeuffer merged commit b15249f into develop Oct 21, 2026
32 checks passed
@jpfeuffer
jpfeuffer deleted the claude/prose-empty-result branch October 21, 2026 08:25
timosachsenberg pushed a commit that referenced this pull request Oct 21, 2026
…#10677, ...)

Conflicts:
- ConsensusMap::appendColumns: develop shifts the map indices of match-between-runs transfers
  (#10672); the identification data of the branch keeps its own map index shift.
- FileTypes: .raw is compressed-readable (#10647); .oms stays a removed format.
- CHANGELOG: both entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
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.

2 participants