Skip to content

Mark the precursor m/z on the PSM spectrum - #180

Open
t0mdavid-m wants to merge 1 commit into
mainfrom
claude/precursor-marker
Open

t0mdavid-m wants to merge 1 commit into
mainfrom
claude/precursor-marker

Conversation

@t0mdavid-m

Copy link
Copy Markdown
Member

Before: the annotated spectrum of a picked PSM showed its fragments, but nothing showed where the precursor sits. To check for a co-isolated peak or a leftover precursor near the fragments, you had to read the m/z off the PSM table.

After: the spectrum draws a dotted guide at the precursor m/z, labelled with its charge (for example "precursor 3+"). It is there in the Identification view and in the spectrum below the database search and filtered PSM tables, and it follows the PSM you pick.

The marker uses the x_markers option of the openms-insight LinePlot (0.7.6). An older openms-insight leaves the option out, and the spectrum looks as before (precursor_marker checks what the installed component takes, as precursor_window already does). The spectrum mirrored against the prediction also passes the marker. It appears there once MirrorPlot takes x_markers.

How: src/common/precursor_window.py gets precursor_marker(mz, charge, component). show_spectrum takes precursor_mz, and both callers pass the PSM's m/z. Tests in tests/test_precursor_window.py cover the label, the missing or non-positive m/z, and a component without the option. pytest test_gui.py tests/ passes (1349 passed, 6 skipped), and pylint --errors-only is clean.

Screenshots

Light Dark
light dark

Picking other PSMs moves the guide (mp4):

picking PSMs


Generated by Claude Code

The annotated spectrum of a picked PSM draws a dotted guide at the
precursor m/z, labelled with its charge ("precursor 2+"), when the
installed openms-insight LinePlot takes x_markers; older builds show
the spectrum as before.

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 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: 32069837-4f43-4431-85f0-203d64092991
  • 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