Skip to content

Conversation

@t0mdavid-m
Copy link
Member

@t0mdavid-m t0mdavid-m commented Aug 17, 2025

Bidirectional Mass Selection for Fragment Table
Filtering stays applied if table content is changed
Add selenocystein

Summary by CodeRabbit

  • New Features

    • Added support for selenocysteine (U) in sequence handling, delivering accurate mass calculations and fragment analysis for peptides containing U. Improves result fidelity and prevents errors when working with sequences that include this residue.
  • Chores

    • Updated the embedded UI component to the latest revision to stay current with upstream changes. No functional or behavioral changes for end-users.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 17, 2025

Walkthrough

Updated the openms-streamlit-vue-component submodule reference to a new commit and added selenocysteine ('U') with mass 150.953633405 to the amino acid mass table in src/render/sequence.py. No changes to functions, control flow, or public APIs.

Changes

Cohort / File(s) Summary
Submodule bump: openms-streamlit-vue-component
openms-streamlit-vue-component
Updated submodule pointer from 1a1b43b to 427dac2. No code changes in this repo.
Amino acid mass table update
src/render/sequence.py
Added 'U': 150.953633405 to aa_masses for selenocysteine support. No functional logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • update vue #22 — Also updates the openms-streamlit-vue-component submodule pointer, indicating alignment across projects.

Poem

I hop through code, ears tuned to cues,
A ‘U’ now joins the massy news.
Submodules shift, the hashes gleam,
Proteins hum a richer theme.
With whiskers twitch and tiny cheer,
Seleno-songs are crystal clear. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch new_version

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
src/render/sequence.py (1)

266-273: Fix: 'cy' → 'cz' (ion-type mismatch in internal fragment code)

Short: Verified — the codebase uses 'cz' elsewhere but the loop at src/render/sequence.py iterates ['by','bz','cy']. getInternalFragmentMassesWithSeq and other places explicitly check/expect 'cz', so the current 'cy' will take the wrong branch and produce incorrect shifts/fragment masses.

Locations to fix (found via repo search):

  • src/render/sequence.py:40-42 — branch checks res_type == 'cz'
  • src/render/sequence.py:108-110 — earlier loop uses ['ax', 'by', 'cz']
  • src/render/sequence.py:203-206 — getInternalFragmentMassesWithSeq: shift = ... res_type == 'cz'
  • src/render/sequence.py:211-214 — tmp code: czp, czs = getFragmentMassesWithSeq(..., 'cz')
  • src/render/sequence.py:266-273 — current loop (the problematic snippet):
      • for ion_type in ['by', 'bz', 'cy']: # by cz are the same.

Suggested fixes (choose one):

  • Non-breaking (recommended if consumers rely on 'cy' keys in output):
    Replace the call with an internal mapping so output keys remain "cy" but computation uses "cz":

    for ion_type in ['by', 'bz', 'cy']:
        internal_type = 'cz' if ion_type == 'cy' else ion_type
        ions, start_indices, end_indices = getInternalFragmentMassesWithSeq(
            sequence, internal_type, modifications
        )
        out_object[f'fragment_masses_{ion_type}'] = ions
        ...
    
  • Simple/safe fix (if you can change output keys):

    - for ion_type in ['by', 'bz', 'cy']:
    + for ion_type in ['by', 'bz', 'cz']:
    

This is a functional bug — please apply one of the fixes above.

🧹 Nitpick comments (3)
src/render/sequence.py (3)

215-216: Nit: typos and naming (“termianl” → “terminal”, comments spelling)

Renaming improves readability, and comment spelling fixes reduce friction for future maintenance. No behavioral changes.

-    termianl_masses = byp + bys + czp + czs#tmp code
-    termianl_masses.sort()#tmp code
+    terminal_masses = byp + bys + czp + czs  # tmp code
+    terminal_masses.sort()  # tmp code
-            # Only conside fragments of at least length 5
+            # Only consider fragments of at least length 5
-                # TODO: Should be adressed in component
-                if isMatchWithTolerance(termianl_masses, mass, 10.0): #tmp code
+                # TODO: Should be addressed in component
+                if isMatchWithTolerance(terminal_masses, mass, 10.0):  # tmp code

Also applies to: 233-233, 248-249


253-253: Nit: use the H20 constant instead of a hardcoded literal

Keeps constants centralized and avoids magic numbers.

-                masses.append(mass + 18.010564683 + shift)
+                masses.append(mass + H20 + shift)

165-167: Align selenocysteine mass precision and document source

To keep all entries at six-decimal precision and cite the upstream definition, update in src/render/sequence.py:

• Line 166:

-    'U': 150.953633405,
+    'U': 150.953633,  # source: Unimod (mod 162)/OpenMS monoisotopic mass 150.9536334 Da
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5c3f5c8 and 334e4b7.

⛔ Files ignored due to path filters (3)
  • js-component/dist/assets/index-7cc3fbf2.css is excluded by !**/dist/**
  • js-component/dist/assets/index-871c0fa8.js is excluded by !**/dist/**
  • js-component/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (2)
  • openms-streamlit-vue-component (1 hunks)
  • src/render/sequence.py (1 hunks)
🔇 Additional comments (1)
openms-streamlit-vue-component (1)

1-1: Ensure CI Can Fetch the Submodule and Verify Host-App Contracts

I ran the recommended submodule-init script and saw clone failures due to SSH not being available in this environment. Please:

  • Update the submodule remote in .gitmodules to use an HTTPS URL (or ensure your CI agents have SSH set up and keys loaded).
  • Add a step in your CI config to run:
    git submodule update --init --recursive
    
    before any build or test commands.
  • Double-check that the bumped commit in openms-streamlit-vue-component doesn’t introduce breaking UI prop or event name changes in the host Streamlit integration.

@t0mdavid-m t0mdavid-m merged commit 54864c0 into develop Aug 17, 2025
5 checks passed
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