Skip to content

Fix Fragment Map#3

Merged
t0mdavid-m merged 3 commits intodevelopfrom
fix_fragment_map
Apr 24, 2025
Merged

Fix Fragment Map#3
t0mdavid-m merged 3 commits intodevelopfrom
fix_fragment_map

Conversation

@t0mdavid-m
Copy link
Copy Markdown
Member

@t0mdavid-m t0mdavid-m commented Apr 23, 2025

This PR fixes an issue were fragment data was not loaded if the internal fragment map was operated standalone and adds a download option.

Summary by CodeRabbit

  • Refactor
    • Updated internal data handling to use a more descriptive key for fragment ion data in the viewer.
  • Chores
    • Updated the subproject reference for improved compatibility and maintenance.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 23, 2025

Walkthrough

This update modifies the sendDataToJS function in FLASHTnTViewer.py by renaming the key used in the per_scan_contents dictionary from 'sequence_view' to 'fragment_ions' and adjusting the associated flag-setting and data concatenation logic accordingly. Additionally, the subproject reference for openms-streamlit-vue-component is updated to a new commit. No changes were made to the signatures or declarations of exported or public entities.

Changes

File(s) Change Summary
content/FLASHTnT/FLASHTnTViewer.py Renamed per_scan_contents dictionary key from 'sequence_view' to 'fragment_ions' and updated related flag logic and data concatenation.
openms-streamlit-vue-component (subproject reference) Updated subproject commit reference from f564caf7... to 00232c9....

Poem

In the code where ions and views reside,
A key renamed, old terms set aside.
Fragments now shine where sequence once stood,
With submodules updated, all is good.
A hop and a skip, the changes are neat—
More clarity now, a rabbit’s small treat! 🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between af05ec2 and ec1f0a6.

📒 Files selected for processing (1)
  • content/FLASHTnT/FLASHTnTViewer.py (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • content/FLASHTnT/FLASHTnTViewer.py
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build-openms
  • GitHub Check: build-full-app
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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
Copy Markdown
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

🧹 Nitpick comments (1)
content/FLASHTnT/FLASHTnTViewer.py (1)

163-163: Consider updating initialization of per_scan_contents

While the key changes are effective, the initialization of per_scan_contents dictionary still uses the old 'sequence_view' key which is no longer used in the code.

-per_scan_contents = {'spectrum_view': False, 'sequence_view': False}
+per_scan_contents = {'spectrum_view': False, 'fragment_ions': False}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d5a89ec and af05ec2.

⛔ Files ignored due to path filters (3)
  • js-component/dist/assets/index-7a358364.js is excluded by !**/dist/**
  • js-component/dist/assets/index-d20033af.css is excluded by !**/dist/**
  • js-component/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (2)
  • content/FLASHTnT/FLASHTnTViewer.py (2 hunks)
  • openms-streamlit-vue-component (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
content/FLASHTnT/FLASHTnTViewer.py (1)
src/components.py (1)
  • SequenceView (90-92)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build-full-app
  • GitHub Check: build-openms
🔇 Additional comments (5)
openms-streamlit-vue-component (1)

1-1:

Details

❓ Verification inconclusive

Confirm submodule update commit
Please verify that the referenced commit 00232c916e41a7c7ad7a1610dbfde7312107606f in the openms-streamlit-vue-component submodule exists upstream and contains the necessary support for the renamed 'fragment_ions' key and the new download functionality in standalone mode.

Run this script to validate the commit reference:


🏁 Script executed:

#!/bin/bash
# Verify the commit exists in the submodule remote
git ls-remote https://github.com/OpenMS/openms-streamlit-vue-component.git 00232c916e41a7c7ad7a1610dbfde7312107606f

Length of output: 239


🏁 Script executed:

#!/bin/bash
# Display .gitmodules to confirm the submodule URL
echo "### .gitmodules ###"
if [ -f .gitmodules ]; then
  cat .gitmodules
else
  echo ".gitmodules not found"
fi

# Search codebase for any references to the submodule
echo "### grep for openms-streamlit-vue-component references ###"
grep -R "openms-streamlit-vue-component" -n .

Length of output: 1839


🏁 Script executed:

#!/bin/bash
# Verify the commit exists in the submodule remote at the correct URL(s)

echo "### Checking HTTPS remote ###"
git ls-remote https://github.com/t0mdavid-m/openms-streamlit-vue-component.git 00232c916e41a7c7ad7a1610dbfde7312107606f

echo ""
echo "### Checking SSH remote ###"
git ls-remote git@github.com:t0mdavid-m/openms-streamlit-vue-component.git 00232c916e41a7c7ad7a1610dbfde7312107606f

Length of output: 455


Submodule commit not found upstream
The commit 00232c916e41a7c7ad7a1610dbfde7312107606f does not appear in the t0mdavid-m/openms-streamlit-vue-component repository (using both HTTPS and SSH remotes).

• Please confirm that this commit SHA is correct and has been pushed to the submodule’s upstream branch.
• If it’s from a fork or private repo, ensure the URL in .gitmodules points to the correct remote containing this commit.

content/FLASHTnT/FLASHTnTViewer.py (4)

181-181: Improved semantic naming

The change from per_scan_contents['sequence_view'] to per_scan_contents['fragment_ions'] better represents the actual data that needs to be loaded rather than the component that uses it. This makes the code more intuitive and easier to maintain.


184-185: Key fix for fragment data loading in standalone mode

This addition directly addresses the issue where fragment data wasn't being loaded when the internal fragment map was used without the sequence view component. By setting the 'fragment_ions' flag to True for both components, the code ensures consistent data loading regardless of which component is present.


206-206: Consistent condition check for data loading

This change completes the fix by updating the condition to check for the new 'fragment_ions' key instead of 'sequence_view', ensuring the appropriate data frames are loaded when either component is present in the layout.


1-302:

Details

❓ Verification inconclusive

Verify download feature mentioned in PR description

The PR objectives mention adding a download option for the fragment map, but this isn't evident in the provided code changes. This functionality is likely handled by the frontend component that's updated in the subproject reference (openms-streamlit-vue-component).


🏁 Script executed:

#!/bin/bash
# Check the commits in the subproject reference to verify implementation of download functionality
git ls-tree -r HEAD | grep "openms-streamlit-vue-component" | awk '{print $3}' | xargs git show

Length of output: 267


I’ll search for the grid component implementation and any “download” hooks in our codebase to confirm if the download feature is present.


🏁 Script executed:

#!/bin/bash
# Locate the flash_viewer_grid_component definition
rg -n "def flash_viewer_grid_component" --color never

# Look for any references to "download" in our Python and configuration files
rg -n "download" --color never

Length of output: 69021


I’ll inspect the download handling in content/FLASHTnT/FLASHTnTDownload.py to confirm if the fragment‐map download button is implemented:


🏁 Script executed:

#!/bin/bash
# Show the download logic in FLASHTnTDownload.py
sed -n '1,200p' content/FLASHTnT/FLASHTnTDownload.py

Length of output: 3114


Confirm fragment‐map download integration

The PR description notes adding a “Download” option for the fragment map in FLASHViewer, but:

  • No download button or handler was added in content/FLASHTnT/FLASHTnTViewer.py or in the FlashViewerComponent.
  • The existing download page (FLASHTnTDownload.py) zips experiment outputs (TSVs, mzMLs, JSONs) but does not include the fragment‐map visualization.
  • We found no references to an openms-streamlit-vue-component subproject in this repo.

Please verify:

  • Has the front‑end component (e.g. openms-streamlit-vue-component) been updated to emit a fragment‑map ZIP download?
  • Should the Streamlit viewer code include a download button or API call to expose that functionality?
🧰 Tools
🪛 Ruff (0.8.2)

53-53: Loop control variable i not used within loop body

(B007)


59-59: Use key in dict instead of key in dict.keys()

Remove .keys()

(SIM118)


65-65: Use key in dict instead of key in dict.keys()

Remove .keys()

(SIM118)


154-154: Ambiguous variable name: l

(E741)


195-195: Multiple statements on one line (colon)

(E701)


284-284: Loop control variable exp_layout not used within loop body

Rename unused exp_layout to _exp_layout

(B007)


285-285: Multiple statements on one line (colon)

(E701)

@t0mdavid-m t0mdavid-m merged commit 69006e4 into develop Apr 24, 2025
5 checks passed
@t0mdavid-m t0mdavid-m deleted the fix_fragment_map branch May 7, 2025 10:20
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.

1 participant