Skip to content

Filtered PSMs: fragment mass error plot and b/y ion table for the selected PSM - #44

Open
t0mdavid-m wants to merge 1 commit into
mainfrom
claude/parity-fragment-errors
Open

t0mdavid-m wants to merge 1 commit into
mainfrom
claude/parity-fragment-errors

Conversation

@t0mdavid-m

Copy link
Copy Markdown
Member

Requested by Tom · project thread

Before: the Filtered PSMs page shows the annotated MS2 spectrum and the fragment coverage of the selected PSM. The per-ion evidence exists only as the *_fragment_ions.tsv export, with nothing in the app to look at it.

After: under the spectrum there is a new "Fragment ions" section for the selected PSM. It has a fragment mass error plot (m/z against error, in the fragment tolerance's unit from the Comet settings, with the ±tolerance band shaded, b ions in blue, y ions in orange, and dots sized by intensity) and a b/y ion table (theoretical m/z per position at charge 1+ and, for precursors with charge ≥3, 2+, with matched cells highlighted).

This is ProSE parity items P2 and P4.

How: src/common/fragment_plots.py reads only the selected PSM's rows from the run's fragment ion export with a lazy polars scan. It computes the theoretical b/y ions with pyOpenMS AASequence. Neutral-loss matches such as b4-H2O appear in the plot but don't mark a table cell. content/results_filtered.py reads the selection from the existing state manager and the tolerance from the workflow's params.json (CometAdapter-TMT in TMT mode).

This PR is independent of #42 and #43: it touches neither app.py nor the files those PRs change.

Validation: tests/test_fragment_plots.py adds 5 tests, and the full suite passes (124 tests). pylint --errors-only is clean. I also rendered the page in Chromium on a synthetic workspace.


Generated by Claude Code

…ected PSM

Third step towards feature parity with the ProSE web app's PSM view.

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

coderabbitai Bot commented Oct 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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 37b42e32-73c6-47cf-9704-2d50b2d4feda
  • 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.

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