Skip to content

Show which mass shifts a fragment ion holds in the Identification QC - #372

Open
t0mdavid-m wants to merge 5 commits into
developfrom
claude/project-thread-phbt3o
Open

t0mdavid-m wants to merge 5 commits into
developfrom
claude/project-thread-phbt3o

Conversation

@t0mdavid-m

Copy link
Copy Markdown
Member

Requested by Tom · project thread

Needs OpenMS/streamlit-template#695. The plot is part of that PR's visualization library and is merged into this branch. Merge the template PR first, then the template sync.

What it does

The Identification QC panel gets a plot of how far a run's mass shifts can be placed. It shows three shares:

  • Identified (of MS2): MS2 spectra whose best proteoform hit has a q-value ≤ 0.01.
  • Mass shift (of identified): identified spectra whose hit carries a shift that the search placed only on a window of residues, i.e. a shift with no variable modification behind it.
  • Held by a fragment (of identified): identified spectra where at least one observed fragment ion covers a shift's window whole, so fragmenting that ion further could place the shift on one residue.

The counts come from the run's stored results (src/render/qc_data.py, shift_localization_counts):

  • The MS2 count is read from the scan table.
  • The best hits and their Mod* columns are read from the identifications.
  • A window counts as held when an annotated fragment covers it whole: a terminal ion, or an internal fragment when one was matched.

Nothing is recomputed with a new search. The plot is cached like the other QC plots.

Screenshots

Example lysate run (53 MS2 spectra: 12 identified, 7 of them with a shift, 3 of those held by a fragment).

Light

light

Dark

dark

Tests

  • tests/test_shift_localization_qc.py (new) covers the shift windows, the held check and the counts of the example lysate run.
  • The full tests/ suite passes: 1827 passed, 10 skipped.
  • pylint --errors-only is clean.

Generated by Claude Code

Of the fragmentation spectra per run or group of runs: the share
identified, the share whose hit carries a mass shift placed only on a
window of residues, and the share where one observed fragment ion holds
such a window whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGenYh34qrPtVJyVvtCb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGenYh34qrPtVJyVvtCb
Of a run's MS2 spectra: the share identified at 1 % FDR, the share whose
hit carries a mass shift placed only on a window of residues, and the
share where one observed fragment ion holds such a window whole.

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

coderabbitai Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

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: 40490645-c708-4108-92ec-0b7e657a5a24
  • 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