Skip to content

Rescore all files together: one Percolator model and PSM FDR over the whole study - #181

Open
t0mdavid-m wants to merge 3 commits into
mainfrom
claude/project-thread-dm69w3-pooledfdr
Open

t0mdavid-m wants to merge 3 commits into
mainfrom
claude/project-thread-dm69w3-pooledfdr

Conversation

@t0mdavid-m

Copy link
Copy Markdown
Member

Requested by Tom · project thread

What it does

Right now Percolator rescores each file on its own. Every file gets its own model, and its own q-values and posterior error probabilities. A small or sparse file learns from only a few matches, and the same FDR threshold means slightly different things in different files.

This PR adds Rescore all files together on the Rescoring tab, for both label-free and TMT. The option is off by default.

When it is on and two or more files are processed:

  • PercolatorAdapter runs once, with every file's search result as one -in list. That gives one model, with q-values and PEPs computed over the whole study.
  • src/common/pooled_fdr.py (pyOpenMS glue, no Streamlit) writes that result back into one idXML per file (percolator_results/<file>_per.idXML). PercolatorAdapter marks each match's file as file=<i>,… in its spectrum reference. The split groups the matches by that index, restores the original spectrum reference, and gives each file the protein run of its own search result, plus the annotations Percolator added. FDR filtering, quantification and the result views therefore read the same per-file files as before.
  • The study-wide result is kept in percolator_all_files/all_files_per.idXML, separate from the per-file results, so QC and overview counts don't count a match twice.

With the option off, or with only one file, nothing changes. Each file is rescored on its own, and a file Percolator cannot learn from is left out while the others go on.

Screenshots

Rescoring tab, light and dark. The red box only appears because this container has no TOPP tools installed.

Light Dark
light dark

Tests

  • tests/test_pooled_fdr.py builds idXML files with pyOpenMS shaped like PercolatorAdapter's multi-input output, then checks the split:
    • each file gets its own matches and protein run;
    • spectrum references are restored;
    • the index= fallback goes back to an empty reference;
    • a result without file positions is refused.
  • tests/test_percolator_left_out.py gains two tests:
    • with the option on, execution() makes a single PercolatorAdapter call with all three inputs, and IDFilter gets one result per file;
    • one file is still rescored on its own.
  • Full suite (test_gui.py tests/): 1351 passed. Pylint (errors only) is clean.
  • Not run against a real PercolatorAdapter here, because the container has no TOPP tools. The split follows the OpenMS 3.6.0 PercolatorAdapter source. A run of the example data with the option ticked would confirm it end to end.

Generated by Claude Code

An option on the Rescoring tab runs PercolatorAdapter once over every file's
matches, so the PSM q-values and PEPs are computed over the whole study, and
writes the result back into one idXML per file (src/common/pooled_fdr.py),
so filtering, quantification and the result views are unchanged. Off by
default; with one file each file is rescored on its own as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGepShSG5cNRTqoCXFo1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGepShSG5cNRTqoCXFo1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGepShSG5cNRTqoCXFo1
@t0mdavid-m t0mdavid-m self-assigned this Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 34e2c701-2748-4c44-8f1f-8738ab6aa0e2
  • 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

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