Skip to content

Viewer: identification diagnostics, why a run has few PrSMs - #303

Open
t0mdavid-m wants to merge 7 commits into
developfrom
claude/project-thread-l92o2z
Open

t0mdavid-m wants to merge 7 commits into
developfrom
claude/project-thread-l92o2z

Conversation

@t0mdavid-m

@t0mdavid-m t0mdavid-m commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Requested by Tom · project thread

Depends on OpenMS/streamlit-template#611, which adds the table component to the visualization library. This branch merges that change. Merge the template PR first; the next template sync then brings the same file.

What it does

A new Quality control component, Identification diagnostics (why few PrSMs), follows the MS2 spectra of an identified run through each step on the way to a PrSM:

  1. MS2 spectra
  2. with deconvolved masses
  3. with a precursor mass
  4. with sequence tags
  5. matched to a proteoform
  6. PrSMs at q ≤ 0.01

Each row gives its number of spectra and its share of the run's MS2 spectra. Where a step loses more spectra than is usual, the row also names the likely cause and the setting to check. At most three causes are named, most telling first. A line above the table gives the run's PrSM rate.

Step Likely cause it names
deconvolution spectra not centroided, or MS2 charge and mass ranges that miss the fragments
precursor mass no MS1 spectra in the run, or no mass found in the isolation window
tags minimum tag length or tolerance
matching database (organism, isoforms) or modifications searched
FDR no decoys searched, or decoys scoring like targets
calibration median fragment error of the matches that is large against the tolerance

Everything is computed from results the workflow already stores: the scan table, PrSMs, tags and annotation settings. Nothing is run again.

The component needs identification. It is part of the Lysate view, and the editor's palette offers it for any view.

Implementation

  • src/render/id_diagnosis.py is Streamlit-free. It is the source that turns FLASHApp's results into the table's columns:
    • steps() counts the spectra and leaves decoys out.
    • diagnose() builds the table.
    • headline() writes the line above it.
  • render.py::_render_id_diagnostics draws the table with the library component src/viz/identification/identification_steps.py (from the template PR).
  • catalog.py holds the catalog entry and the Lysate layout row.
  • tests/test_id_diagnosis.py has 10 tests:
    • one per cause;
    • a good run;
    • a run that was deconvolved only;
    • the cap of three causes;
    • the lysate example workspace.
  • pylint (errors only) is clean on the changed files.

Screenshots and video

Native example (one MS2 spectrum, no MS1): the missing precursor mass and the calibration offset are named.

native

Lysate example: no step loses more spectra than usual.

lysate

Video (Viewer → native run → Lysate view → diagnostics): https://github.com/OpenMS/FLASHApp/blob/claude/project-thread-l92o2z-media/id-diagnostics/id-diagnostics.mp4

Moving the columns into the library did not change the table's look; the constructor arguments are the same.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FkEGenPuCZm1euuvRbgjQh

A new Quality control component follows the run's MS2 spectra step by
step to a PrSM (with deconvolved masses, with a precursor mass, with
sequence tags, matched to a proteoform, within q <= 0.01) and names, for
the steps that lose more spectra than is usual, the likely cause and the
setting to look at: spectra not centroided or charge/mass ranges, no MS1
spectra, minimum tag length, database or modifications, no decoys, and a
fragment calibration offset against the tolerance. Everything comes from
results the workflow already stores. It is part of the Lysate view and
needs identification.

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

coderabbitai Bot commented Nov 18, 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: 0e7fbc33-d1f7-4fe9-965b-ab9fdc68f42e
  • 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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGenPuCZm1euuvRbgjQh
…xed spectrum count

The example runs were cut to where they differ, so the test checks the
order of the steps instead of 164 MS2 spectra.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGenPuCZm1euuvRbgjQh
One row per step from acquisition to the identifications kept, with the MS2
spectra left, their share and the likely cause where a step loses more than
usual.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGenPuCZm1euuvRbgjQh
… steps table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGenPuCZm1euuvRbgjQh
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