Skip to content

Conversation

@t0mdavid-m
Copy link
Member

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

This PR adds a filter button to tables.

Summary by CodeRabbit

  • New Features

    • Added MS2 raw and deconvolved heatmaps.
    • Quickstart: introduced responsive download boxes, including a dedicated FLASH CLI tools box.
  • Bug Fixes

    • Trimmed whitespace when saving parameters to prevent invalid values.
    • Improved heatmap selection handling to correctly switch between MS1 and MS2 views.
  • Refactor

    • Reworked the download section into modular, consistently styled components.
  • Chores

    • Updated UI component submodule to latest revision.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 17, 2025

Caution

Review failed

Failed to post review comments.

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 9a261ed and 1d373af.

⛔ Files ignored due to path filters (3)
  • js-component/dist/assets/index-5ed08cb5.js is excluded by !**/dist/**
  • js-component/dist/assets/index-955eea1e.css is excluded by !**/dist/**
  • js-component/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (10)
  • content/FLASHDeconv/FLASHDeconvDownload.py (1 hunks)
  • content/FLASHDeconv/FLASHDeconvLayoutManager.py (2 hunks)
  • content/FLASHTnT/FLASHTnTDownload.py (1 hunks)
  • content/quickstart.py (2 hunks)
  • openms-streamlit-vue-component (1 hunks)
  • src/parse/deconv.py (1 hunks)
  • src/parse/masstable.py (3 hunks)
  • src/render/initialize.py (3 hunks)
  • src/render/update.py (1 hunks)
  • src/workflow/ParameterManager.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
content/quickstart.py

39-40: Use a single with statement with multiple contexts instead of nested with statements

Combine with statements

(SIM117)

🔇 Additional comments (15)
openms-streamlit-vue-component (2)

1-1: Submodule bump: LGTM

Pointer is pinned to a specific commit, ensuring reproducibility. No immediate concerns from this change alone.


1-1: Ensure submodule checkout & Filter Button code are present

Before merging, please confirm the following:

  • .gitmodules is pointing at
    “openms-streamlit-vue-component = git@github.com:t0mdavid-m/openms-streamlit-vue-component.git”
    • Verify your CI environment can clone via SSH, or switch this URL to HTTPS if not.
  • After running
    git submodule update --init --depth 1 openms-streamlit-vue-component
    make sure HEAD in the submodule matches commit 1a1b43ba945dfdc2188a2b81d52a4c480f584bbb`.
  • Inspect the actual Filter Button changes, either by reviewing PR deps: bump plotly from 5.22.0 to 6.0.1 #17 directly:
    https://github.com/t0mdavid-m/openms-streamlit-vue-component/pull/17/files
    or by cloning over HTTPS and checking out that commit locally:
    git clone https://github.com/t0mdavid-m/openms-streamlit-vue-component.git tmp
    cd tmp
    git checkout 1a1b43ba945dfdc2188a2b81d52a4c480f584bbb
    # e.g. look in src/components/FilterButton.vue for your new UI
  • Finally, run your smoke or integration tests against the updated submodule to catch any unintended breakages.
content/FLASHTnT/FLASHTnTDownload.py (1)

63-66: Constant ZIP naming is safe: per-experiment isolation & overwrite behavior confirmed

  • FileManager.store_file writes to cache/files/<experiment>/download_archive.zip, so each experiment’s ZIP lives in its own directory.
  • Repeated calls with the same file_name overwrite the existing file (BytesIO branch opens with wb), and the DB index uses ON CONFLICT … DO UPDATE, ensuring a single reference per artifact.
  • No additional download_archive.zip files accumulate in the same experiment folder.
  • Legacy files with different names (from older code versions) would remain on disk but are not generated by the current logic.

You can proceed with the constant name—no stale ZIPs left behind for current runs.

content/FLASHDeconv/FLASHDeconvDownload.py (1)

63-66: Fixed on-disk ZIP semantics verified: FileManager cleanly overwrites download_archive.zip
FileManager.store_file writes (or copies) to the same path in write/overwrite mode and its _add_entry uses an INSERT … ON CONFLICT(id) DO UPDATE UPSERT. Repeated calls overwrite both the file on disk and the DB entry—no stale per-experiment archives remain.

content/FLASHDeconv/FLASHDeconvLayoutManager.py (1)

11-14: Identifier for MS2 raw heatmap is consistent

The string 'ms2_raw_heatmap' is used in both FLASHDeconvLayoutManager.py and in src/render/initialize.py (and likely update.py), so there is no mismatch. You can ignore the suggestion to rename it.

Likely an incorrect or invalid review comment.

src/parse/masstable.py (2)

179-181: MSLevel propagation to annotateddf: validate alignment

Assigning annotateddf['MSLevel'] = msLevels assumes the list aligns row-wise with annotateddf. Given msLevels is collected per annotated spectrum, this should hold, but a mismatch would raise or silently mislabel rows.

  • Sanity-check with a small dataset that len(msLevels) == len(annotateddf) before assignment (can be an assert in debug paths).

240-244: MSLevel included in ms_df: LGTM; keep dtype small for heatmap-scale data

Including MSLevel in the per-signal DataFrame is the right call for per-level heatmaps. If you adopt the uint8 suggestion above, levels will already be compact.

content/quickstart.py (2)

118-160: Responsive rendering logic reads well

The responsive flow (single vs. two boxes) is clear and keeps content centered. The always-on CLI tools + optional Windows box is a sensible UX.


75-83: Good use of st.link_button for external CLI tools

Consistent with the Windows download box and aligns with the modularized box renderer.

src/render/update.py (2)

113-121: MS1/MS2 deconvolved heatmap selection handling looks correct

Selecting between heatmap_deconv and heatmap_deconv2 based on the component title reduces duplication and aligns with the new MS2 heatmap components.


113-128: Selection‐store keys verified for MS2 heatmaps

I confirmed in js-component/dist/assets/index-*.js that the front-end’s selection_store includes both heatmap_deconv2 and heatmap_raw2 (alongside heatmap_deconv and heatmap_raw), and the component titles “Deconvolved MS2 Heatmap” and “Raw MS2 Heatmap” are defined in src/render/initialize.py. No further changes are needed.

src/parse/deconv.py (1)

25-44: Per-MSLevel heatmap caching is a solid improvement

Filtering by MSLevel, storing full and compressed variants per level, and iteratively downsampling yields a clean cache hierarchy. This aligns with the initialization logic that fetches per-level caches.

src/render/initialize.py (3)

35-56: MS2 deconvolved heatmap initialization mirrors MS1 correctly

Fetching full data, enumerating per-size caches via compute_compression_levels, and exposing the smallest set to the client matches the existing MS1 pattern. Title matches the update/filter logic.


82-103: MS2 raw heatmap branch consistent and correct

Same pattern as MS1 raw; naming and title align with downstream filtering and selection.


117-119: Annotated spectrum now sourced from combined_spectrum

This is a behavior change: anno_spectrum now displays combined_spectrum. If intentional (to show annotations aligned with deconvolved data), great—just ensure any consumers expecting strictly annotated data are updated.

Would you like me to scan for usages assuming the old source (e.g., filter/update logic or tests) to make sure nothing depends on anno_spectrum’s previous shape?

Walkthrough

Standardizes stored ZIP names for downloads, adds MS2 heatmap components and per‑MSLevel heatmap parsing/compression, updates render initialization and update flows for MS2, switches annotated spectrum source, trims string params on save, refactors quickstart download UI into modular boxes, and bumps a submodule pointer.

Changes

Cohort / File(s) Summary of edits
Download archive filename standardization
content/FLASHDeconv/FLASHDeconvDownload.py, content/FLASHTnT/FLASHTnTDownload.py
Store prepared ZIPs with fixed filename download_archive.zip under the same artifact key; user-facing download name remains per-experiment.
Quickstart download UI refactor
content/quickstart.py
Replaces inline Windows-only block with modular download boxes; adds helper functions, responsive rendering, and styling hooks for Windows ZIP and FLASH CLI tools.
MS2 heatmaps and per‑MSLevel pipeline
content/FLASHDeconv/FLASHDeconvLayoutManager.py, src/parse/deconv.py, src/parse/masstable.py, src/render/initialize.py, src/render/update.py
Adds MS2 raw/deconvolved heatmap options and identifiers; propagates MSLevel through parsing; generates per‑MSLevel heatmaps and compressed variants; initializes and caches MS2 heatmaps; updates selection/render logic to handle MS1/MS2 variants (note: one raw branch compares to a list). Also switches annotated spectrum source to combined_spectrum.
Parameter trimming on save
src/workflow/ParameterManager.py
Trims leading/trailing whitespace for string TOPP parameter values before persisting to JSON.
Submodule update
openms-streamlit-vue-component
Advances submodule commit pointer; no code changes in this repo.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UI as Layout Manager
  participant Parser as Parse (deconv/masstable)
  participant Renderer as Render (initialize/update)
  participant Store as Cache/Artifacts
  participant Plot as Plotly Heatmap

  User->>UI: Select MS2 heatmap component
  UI->>Parser: Request per‑MSLevel data (MS2 raw/deconv)
  Parser->>Store: Store ms2_*_heatmap and compressed variants
  UI->>Renderer: Initialize component
  Renderer->>Store: Fetch ms2_*_heatmap (full + compressed)
  Renderer->>UI: Provide initial dataset and cache
  User->>Renderer: Change heatmap level/zoom/selection
  Renderer->>Store: Retrieve selected compression/data
  Renderer->>Plot: Render updated MS2 heatmap
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • update vue #22 — Also updates the openms-streamlit-vue-component submodule to a different commit.
  • Update Front Page #35 — Refactors content/quickstart.py to a modular download UI, similar structure and helpers.
  • New Features #37 — Mirrors the same set of changes: fixed archive name, MS2 heatmaps, per‑MSLevel parsing, quickstart refactor, and parameter trimming.

Poem

A nibble of code, a hop through heatmaps two,
MS1, MS2—now neatly split in view.
Zips renamed, trims on params tight,
Quickstart boxes polished just right.
I thump my paws—deploy tonight!
(_/)< 🥕
(•_•) ) ) )

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.

@t0mdavid-m t0mdavid-m closed this Aug 17, 2025
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