Skip to content

Template-gate the results-table column headers for metabolomics - #224

Merged
tonywu1999 merged 2 commits into
develfrom
MSstatsShiny/work/20260730_metabolomics_terminology_qc_statmodel
Jul 31, 2026
Merged

Template-gate the results-table column headers for metabolomics#224
tonywu1999 merged 2 commits into
develfrom
MSstatsShiny/work/20260730_metabolomics_terminology_qc_statmodel

Conversation

@swaraj-neu

@swaraj-neu swaraj-neu commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Metabolomics templates require user-facing results-table headers to use “Metabolite” instead of “Protein”. The original data must remain unchanged for downstream processing and CSV downloads.

The change adds template-aware display renaming and passes the active application template to relevant table-rendering paths.

Changes

  • Added rename_protein_column_for_display() to rename Protein to Metabolite for metabolomics templates.
  • Preserved the input data during display renaming.
  • Updated significant-proteins table rendering to use template-aware column names.
  • Passed the reactive app_template to render_results_table().
  • Applied display renaming to the QC abundance data table.
  • Kept CSV downloads unchanged.
  • Added a default app_template to render_results_table().
  • Imported updateRadioButtons from shiny.
  • Updated visualizeNetworkServer documentation and signature to accept an optional reactive app_template.

Tests

  • No unit tests were added or modified.

Coding Guidelines

  • No coding guideline violations were identified.

@swaraj-neu
swaraj-neu requested a review from tonywu1999 July 31, 2026 01:29
@swaraj-neu swaraj-neu self-assigned this Jul 31, 2026
@swaraj-neu swaraj-neu added the enhancement New feature or request label Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9a042f42-ee1d-473f-ab48-066befa5d884

📥 Commits

Reviewing files that changed from the base of the PR and between 359152d and 4069da4.

📒 Files selected for processing (1)
  • R/utils.R
🚧 Files skipped from review as they are similar to previous changes (1)
  • R/utils.R

📝 Walkthrough

Walkthrough

The change adds template-aware protein-column display handling for significant-protein and abundance tables, propagates app_template through result rendering, documents the updated server interface, and imports updateRadioButtons into the package namespace.

Changes

Template-aware display

Layer / File(s) Summary
Template-aware display helper and table rendering
R/utils.R, R/statmodel-server-results-table.R, R/qc-server-summary.R
Rendered tables copy their data and rename Protein to Metabolite for the metabolomics template. CSV downloads retain the original data.
Template propagation and interface wiring
R/module-statmodel-server.R, man/visualizeNetworkServer.Rd, NAMESPACE
Statmodel rendering receives app_template. The documented server interface exposes the optional argument with a default. updateRadioButtons is imported.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: tonywu1999

Poem

A rabbit watches columns align,
Protein becomes Metabolite by design.
Templates guide each rendered view,
CSV data stays unchanged and true.
Shiny imports join the queue.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: template-specific column headers for metabolomics results tables.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch MSstatsShiny/work/20260730_metabolomics_terminology_qc_statmodel

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@R/utils.R`:
- Around line 1147-1150: Update the conditional in
rename_protein_column_for_display to wrap the app_template() comparison with
isTRUE(), so NULL or NA values safely preserve the Protein header while the
metabolomics case still renames it to Metabolite.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 09a5ea31-0b1c-4bf9-9a48-f2a5529cf059

📥 Commits

Reviewing files that changed from the base of the PR and between f494440 and 359152d.

📒 Files selected for processing (6)
  • NAMESPACE
  • R/module-statmodel-server.R
  • R/qc-server-summary.R
  • R/statmodel-server-results-table.R
  • R/utils.R
  • man/visualizeNetworkServer.Rd

Comment thread R/utils.R
@tonywu1999
tonywu1999 merged commit 5896704 into devel Jul 31, 2026
2 checks passed
@tonywu1999
tonywu1999 deleted the MSstatsShiny/work/20260730_metabolomics_terminology_qc_statmodel branch July 31, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants