Skip to content

Package name change from amRshiny to amRviz + New Visualizations#20

Open
eboyer221 wants to merge 7 commits into
mainfrom
amRviz-name-change
Open

Package name change from amRshiny to amRviz + New Visualizations#20
eboyer221 wants to merge 7 commits into
mainfrom
amRviz-name-change

Conversation

@eboyer221
Copy link
Copy Markdown
Contributor

@eboyer221 eboyer221 commented May 14, 2026

Supersedes #19. This PR was branched off additional-plots-2, so it includes all the visualization work from #19 plus the package rename. #19 should be closed.

⚠️ Action required from a repo admin

This PR renames the package from amRshiny to amRviz (in DESCRIPTION, code, tests, docs, and the .Rproj file). However, the GitHub repository itself is still named amRshiny and needs to be renamed manually by someone with admin access (I, eboyer221, do not have admin privileges to rename the repo):

  1. Go to https://github.com/JRaviLab/amRshiny/settings
  2. Under Repository name, change amRshinyamRviz
  3. Click Rename

Summary

Renames the package from amRshiny to amRviz and adds several new visualizations and dashboard fixes.

Package rename

  • Renamed package: amRshinyamRviz (DESCRIPTION, all system.file() calls, tests, README, vignettes, docs)
  • Renamed project file: amRshiny.RprojamRviz.Rproj

New visualizations

  • Network tab (new): force-directed graph linking drugs/drug classes to their top predictive features. Optional cluster and COG annotation tiers via checkboxes.
  • Drug-feature ego network on Feature Importance tab: click a row in the importance table to see that feature's cluster and COG connections.
  • COG bar chart on Feature Importance tab: shows the most common COG categories among the currently displayed features.
  • Metadata Sankey on Metadata tab: 6-tier flow diagram (phenotype → drug class → drug → country → host → isolation source).
  • Accuracy distributions tab on Model Holdouts: box plots of balanced accuracy by drug class for cross-country and cross-time models.

Annotations

  • Feature Importance table now includes cluster (with BVBRC link) and COG (with NCBI COG link) columns when cluster_feature_COG.parquet is available.
  • Heatmap row labels can be enriched with human-readable gene/protein/domain names from gene_names.parquet, protein_names.parquet, or domain_names.parquet (located in amrdata_root/<species>/).

Dashboard fixes

  • Converted remaining ComplexHeatmap plots to plotly (Feature Importance, Cross-model Top features) — fixes legend crash on single-value matrices.
  • Fixed Bug selector on Feature Importance tab that was hardcoded to ESKAPE pathogens; now uses species present in the loaded data.
  • Model Holdouts: split single radio-controlled heatmap into side-by-side country/time heatmaps.
  • Default Drug Class to "all" on Model Performance tab with sync between Drug and Drug Class selectors.
  • Cross-model heatmap legend no longer crashes when matrix has a single unique value.

New parameter

  • launchAMRDashboard(results_root, amrdata_root): amrdata_root defaults to ~/amRdata/data if present and is used to locate annotation parquets for name lookup.

Demo data

  • Added inst/extdata/Shigella_flexneri/cluster_feature_COG.parquet so annotation-based visualizations work.

Test plan

  1. Install and launch:
    devtools::document()
    devtools::install(".")
    library(amRviz)
    launchAMRDashboard()
    

To approve - verify each tab renders without errors:

  • Home: abstract mentions amRviz
  • Metadata: stat cards, all 4 plots, and the new Sankey at the bottom render
  • Model Performance: defaults to Drug Class = "all"; Drug ↔ Drug Class selectors stay in sync
  • Bug/Drug feature comparison: heatmap renders, table shows cluster/COG links, COG bar chart and ego network populate (click a table row for the ego network)
  • Model holdouts: all 3 sub-tabs (Accuracy distributions, Model performance, Top features)
  • Network: graph renders; toggle "Show clusters" / "Show COGs"
  • Query Data: column selector and download button work

@eboyer221 eboyer221 changed the title Package name change from amRshiny to amRviz Package name change from amRshiny to amRviz + New Visualizations May 14, 2026
@amcim
Copy link
Copy Markdown
Contributor

amcim commented May 15, 2026

@eboyer221 I reviewed it. I got the model performance to default to "all", removed ComplexHeatmap dependencies since everything is plotly now, removed some dead code and observers, and it should be passing R CMD CHECK again because I added param for amrdata_root. Everything looked good. I'll approve merging when the repo name is changed by an admin

@jananiravi @epbrenner @AbhirupaGhosh Please change the name of the repo as Emily specified above

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