11
22<!-- README.md is generated from README.Rmd. Please edit that file -->
33
4- # NewShinyPackage
4+ # amR_shiny
55
66<!-- badges: start -->
77
@@ -12,97 +12,217 @@ status](https://www.r-pkg.org/badges/version/NewShinyPackage)](https://CRAN.R-pr
1212[ ![ R-CMD-check] ( https://github.com/JRaviLab/NewShinyPackage/actions/workflows/R-CMD-check.yaml/badge.svg )] ( https://github.com/JRaviLab/NewShinyPackage/actions/workflows/R-CMD-check.yaml )
1313<!-- badges: end -->
1414
15- The goal of NewShinyPackage is to … \< * your awesome package description
16- here! * \>
15+ ** amR_shiny ** is an interactive Shiny dashboard for exploring
16+ antimicrobial resistance (AMR) data and machine learning model results.
1717
18- ## GitHub Setup
18+ Part of the ** AMR package suite** : - ** amR_data** : Data (and metadata)
19+ preparation from BV-BRC - ** amR_ml** : ML modeling and analysis -
20+ ** amR_shiny** : Interactive visualization (this package)
1921
20- ### Repository
22+ ## Features
2123
22- Initial Repository Configuration:
24+ - ** Metadata exploration** : Geographic distribution, temporal trends,
25+ host analysis
26+ - ** Model performance** : Compare ML models across species, drugs, and
27+ molecular scales (genes, proteins, domains, structures)
28+ - ** Feature importance** : Identify key predictive features with
29+ interactive heatmaps
30+ - ** Cross-model analysis** : Compare models trained on different
31+ stratifications (country, year)
32+ - ** Publication-quality exports** : Download plots and tables
33+ - ** Modular design** : Extensible UI components
2334
24- - Enable Git: ` usethis::use_git() `
25- - Configure Remote:
26- ` usethis::use_github(organisation = "JRaviLab", private = TRUE, protocol = "https") `
27- - Contributor Code of Conduct:
28- ` usethis::use_code_of_conduct(contact = "janani.ravi@cuanschutz.edu") `
35+ ## Installation
2936
30- ### GitHub Actions
37+ ### Current (development version)
3138
32- These functions will enable common package development GitHub Actions is
33- desired:
39+ The package is currently available via GitHub and will be submitted to
40+ Bioconductor.
3441
35- - R CMD Check (multiplatform):
36- ` usethis::use_github_action("check_standard") `
37- - Build Pkgdown: ` use_github_action("pkgdown") `
38- - lint code: ` use_github_action("lint") `
39- - style code: ` use_github_action("style") `
42+ ``` r
43+ # Install BiocManager if needed
44+ if (! requireNamespace(" BiocManager" , quietly = TRUE ))
45+ install.packages(" BiocManager" )
4046
41- Example GitHub Actions workflows have been incorporated into this
42- template. Modify workflows in ` .github/workflows/ ` or delete if these
43- are not required.
47+ # Install Bioconductor dependencies
48+ BiocManager :: install(" ComplexHeatmap" )
4449
45- ## Development
50+ # Install amR_shiny from GitHub
51+ if (! requireNamespace(" devtools" , quietly = TRUE ))
52+ install.packages(" devtools" )
4653
47- Some initial guidance on developing a Shiny Application can be found in
48- the top level ` dev ` folder. Step through the included .R files,
49- beginning with ` 01_start.R `
50-
51- - new function: ` usethis::use_r("hello") `
52- - new shiny module: ` golem::add_module() `
53- - add package dependency: ` usethis::use_package("rlang") `
54- - render documentation/update NAMESPACE: ` devtools::document() `
55- - load changes without install: ` devtools::load_all() `
56- - Local R CMD Check: ` devtools::check() `
57- - Test App: ` NewShinyPackage::run_app() `
54+ devtools :: install_github(" JRaviLab/amR_shiny" )
55+ ```
5856
59- ## Installation
57+ ### Future (Bioconductor release)
6058
61- You can install the development version of NewShinyPackage like so :
59+ Once submitted to Bioconductor, installation will be :
6260
6361``` r
64- # GitHub
65- devtools :: install_github( " JRaviLab/NewShinyPackage " , auth_token = " <PersonalAccessToken> " )
66- # If Bioconductor Dependencies
67- BiocManager :: install(" JRaviLab/NewShinyPackage " , auth_token = " <PersonalAccessToken> " )
62+ if ( ! requireNamespace( " BiocManager " , quietly = TRUE ))
63+ install.packages( " BiocManager " )
64+
65+ BiocManager :: install(" amR_shiny " )
6866```
6967
70- ## Example
68+ ### Optional dependencies
69+
70+ ``` r
71+ # For Sankey diagrams (if available for your R version)
72+ install.packages(" sankeyD3" )
73+
74+ # For enhanced data processing
75+ BiocManager :: install(" arrow" )
76+ ```
7177
72- This is a basic example which shows you how to solve a common problem:
78+ ## Quick start
7379
7480``` r
75- library(NewShinyPackage )
76- # # basic example code
81+ library(amR_shiny )
82+
83+ # Launch the dashboard
84+ launch_dashboard()
7785```
7886
79- What is special about using ` README.Rmd ` instead of just ` README.md ` ?
80- You can include R chunks like so:
87+ The dashboard will open in your default web browser.
88+
89+ ## Usage
90+
91+ ### Dashboard navigation
92+
93+ The dashboard includes several tabs:
94+
95+ 1 . ** Home** : Overview and project information
96+ 2 . ** Metadata** : Explore geographic, temporal, and host metadata
97+ - Interactive maps and treemaps
98+ - Temporal trends
99+ - Host distribution
100+ 3 . ** Model performance** : Compare ML model metrics
101+ - Filter by species, drug, molecular scale
102+ - View confusion matrices
103+ - Compare performance across models
104+ 4 . ** Feature importance** : Analyze predictive features
105+ - Top features by importance
106+ - Cross-species/drug comparisons
107+ - Heatmaps and bar plots
108+ 5 . ** Cross-model comparison** : Compare models across stratifications
109+ - Country-based models
110+ - Year-based models
111+ - Performance and feature consistency
112+ 6 . ** Query data** : Custom data queries
113+ - Filter by multiple criteria
114+ - Export filtered results
115+
116+ ### Example: Exploring model performance
81117
82118``` r
83- summary( cars )
84- # > speed dist
85- # > Min. : 4.0 Min. : 2.00
86- # > 1st Qu.:12.0 1st Qu.: 26.00
87- # > Median :15.0 Median : 36.00
88- # > Mean :15.4 Mean : 42.98
89- # > 3rd Qu.:19.0 3rd Qu.: 56.00
90- # > Max. :25.0 Max. :120.00
119+ launch_dashboard( )
120+
121+ # In the dashboard:
122+ # 1. Navigate to "Model Performance" tab
123+ # 2. Select species: "Campylobacter jejuni"
124+ # 3. Select drug: "ciprofloxacin"
125+ # 4. Select molecular scale: "genes"
126+ # 5. View performance metrics and confusion matrix
91127```
92128
93- You’ll still need to render ` README.Rmd ` regularly, to keep ` README.md `
94- up-to-date. ` devtools::build_readme() ` is handy for this.
129+ ### Data requirements
130+
131+ The dashboard works with pre-computed data files located in
132+ ` inst/app/data/ ` :
133+
134+ - ` amr_filtered_tbls.db ` : DuckDB database with AMR data
135+ - ` all_performances.tsv ` : Model performance metrics
136+ - ` drug_class_map.tsv ` : Drug classification mapping
137+ - ` metadata/ ` : Species-specific metadata files
138+
139+ To use your own data, structure files following the same schema.
140+
141+ ## Data Schema
142+
143+ ### Performance metrics
144+
145+ Required columns: - ` bug ` : Species code - ` antibiotic ` : Drug name -
146+ ` scale ` : Molecular scale (gene, protein, domain, struct) - ` type ` : Count
147+ or binary features - ` bal_acc ` : Balanced accuracy - ` f1 ` : F1 score -
148+ ` nmcc ` : Normalized Matthews correlation coefficient - Additional columns
149+ for other metrics
150+
151+ ### Metadata files
152+
153+ Location: ` inst/app/data/metadata/{species}.parquet `
154+
155+ Required columns: - ` genome_id ` : Unique genome identifier -
156+ ` genome.isolation_country ` : Country of isolation -
157+ ` genome.collection_year ` : Collection year - ` genome.host_name ` : Host
158+ organism - Additional metadata columns as needed
159+
160+ ## Development
161+
162+ ### Package structure
163+
164+ amR_shiny/
165+ ├── R/
166+ │ └── launch_dashboard.R # Main launch function
167+ ├── inst/
168+ │ └── app/
169+ │ ├── app.R # Main Shiny app
170+ │ ├── utils.R # Utility functions
171+ │ ├── modules/ # UI modules
172+ │ ├── data/ # Dashboard data files
173+ │ └── www/ # Static assets (CSS, images)
174+ ├── man/ # Documentation
175+ └── DESCRIPTION
176+
177+ ## Citation
178+
179+ If you use ` amR_shiny ` in your research, please cite:
180+
181+ Boyer E, Lesiyon R, Mayer D, Brenner E, Ghosh A, Vang C, Ravi J. (2025).
182+ amR_shiny: Interactive dashboard for AMR data and model visualization.
183+ R package version 0.99.0.
184+ https://github.com/JRaviLab/amR_shiny
185+
186+ ## For Bioconductor submission
187+
188+ This package is being prepared for Bioconductor submission. It includes:
189+
190+ - ** biocViews** : GUI, MicrobialGenomics, Pathogen, Visualization
191+ - ** Bioconductor dependencies** : ComplexHeatmap
192+ - ** R version requirement** : R \> = 4.1.0
193+ - ** Documentation** : Comprehensive function documentation with examples
194+ - ** Data** : Pre-computed AMR model results included in ` inst/app/data/ `
195+
196+ ## Contributing
197+
198+ We welcome contributions! Please see our [ Contributing
199+ Guidelines] ( CONTRIBUTING.md ) for details.
200+
201+ ### Reporting Issues
202+
203+ Report bugs and request features at:
204+ < https://github.com/JRaviLab/amR_shiny/issues >
205+
206+ ## Related projects
207+
208+ - [ amR_data] ( https://github.com/JRaviLab/amR_data ) : Data preparation
209+ pipeline
210+ - [ amR_ml] ( https://github.com/JRaviLab/amR_ml ) : ML modeling framework
211+ - [ BV-BRC] ( https://www.bv-brc.org/ ) : Bacterial and Viral Bioinformatics
212+ Resource Center
213+
214+ ## Code of conduct
215+
216+ Please note that the amR_shiny project is released with a [ Contributor
217+ Code of Conduct] ( CODE_OF_CONDUCT.md ) . By contributing to this project,
218+ you agree to abide by its terms.
95219
96- You can also embed plots, for example:
220+ ## License
97221
98- < img src = " man/figures/README-pressure-1.png " width = " 100% " />
222+ BSD 3-Clause License. See [ LICENSE ] ( LICENSE ) for details.
99223
100- In that case, don’t forget to commit and push the resulting figure
101- files, so they display on GitHub and CRAN.
224+ ## Contact
102225
103- ## Code of Conduct
226+ ** Corresponding author ** : Janani Ravi (< janani.ravi@cuanschutz.edu >)
104227
105- Please note that the NewShinyPackage project is released with a
106- [ Contributor Code of
107- Conduct] ( https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html ) .
108- By contributing to this project, you agree to abide by its terms.
228+ ** JRaviLab** : < https://jravilab.github.io >
0 commit comments