Skip to content

fix: ms exact mass (M+)#298

Open
Nicolass67 wants to merge 3 commits intomasterfrom
fix/ms-exact-mass-m-plus
Open

fix: ms exact mass (M+)#298
Nicolass67 wants to merge 3 commits intomasterfrom
fix/ms-exact-mass-m-plus

Conversation

@Nicolass67
Copy link
Copy Markdown
Contributor

Summary

  • show Exact mass (M+) instead of neutral M in the MS info panel
  • calculate the displayed value by subtracting the electron mass from the exact mass
  • add a focused test for the M to M+ conversion

Test plan

  • open an MS spectrum and check that the info panel shows Exact mass (M+)
  • verify the displayed value is slightly lower than the neutral exact mass
  • run the InfoPanel test

@PiTrem PiTrem requested a review from Copilot April 30, 2026 07:34
@PiTrem PiTrem changed the title Fix: ms exact mass (M+) fix: ms exact mass (M+) Apr 30, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the MS info panel to display the charged-species exact mass (M+) rather than the neutral exact mass, aligning the UI with typical MS reporting by subtracting the electron mass, and adds a focused unit test to validate the conversion.

Changes:

  • Add MS-specific exact mass formatting that converts neutral mass M to M+ by subtracting electron mass and formatting to 6 decimals.
  • Update the InfoPanel label to Exact mass (M+) and display the converted value.
  • Add a unit test asserting the displayed M+ value for MS layout.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/panel/info.js Introduces M→M+ conversion for MS layout and updates the displayed label/value in the InfoPanel.
src/__tests__/units/components/panel/info.test.js Adds a unit test verifying the M+ exact mass display for MS layout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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