Skip to content

Commit 7469978

Browse files
committed
add global var, minor fixes
can add WORDLIST later, as needed. @AbhirupaGhosh @epbrenner @eboyer221
1 parent 41d4fa0 commit 7469978

File tree

6 files changed

+67
-57
lines changed

6 files changed

+67
-57
lines changed

NAMESPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(launchAMRDashboard)
4+
import(shiny)
45
importFrom(ComplexHeatmap,Heatmap)
56
importFrom(ComplexHeatmap,draw)
67
importFrom(DBI,dbConnect)
@@ -14,11 +15,14 @@ importFrom(dplyr,all_of)
1415
importFrom(dplyr,arrange)
1516
importFrom(dplyr,bind_rows)
1617
importFrom(dplyr,c_across)
18+
importFrom(dplyr,case_when)
1719
importFrom(dplyr,collect)
20+
importFrom(dplyr,count)
1821
importFrom(dplyr,desc)
1922
importFrom(dplyr,distinct)
2023
importFrom(dplyr,filter)
2124
importFrom(dplyr,group_by)
25+
importFrom(dplyr,join_by)
2226
importFrom(dplyr,left_join)
2327
importFrom(dplyr,mutate)
2428
importFrom(dplyr,n)
@@ -27,8 +31,10 @@ importFrom(dplyr,rowwise)
2731
importFrom(dplyr,select)
2832
importFrom(dplyr,slice_head)
2933
importFrom(dplyr,slice_max)
34+
importFrom(dplyr,summarise)
3035
importFrom(dplyr,summarize)
3136
importFrom(dplyr,ungroup)
37+
importFrom(dplyr,where)
3238
importFrom(duckdb,duckdb)
3339
importFrom(ggplot2,aes)
3440
importFrom(ggplot2,coord_cartesian)

R/globals.R

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Global variables for NSE (Non-Standard Evaluation)
2+
# These are column names used in dplyr/data.table operations
3+
# Declaring them here silences R CMD check notes about "no visible binding"
4+
5+
utils::globalVariables(c(
6+
7+
# Column names used across the package
8+
"ARG_name",
9+
"COG_name",
10+
"Gene",
11+
12+
"Importance",
13+
"Variable",
14+
"accession",
15+
"bal_acc",
16+
"configurations",
17+
"count",
18+
"data_type",
19+
"drug.antibiotic_name",
20+
"drug_class",
21+
"drug_classes",
22+
"drug_count",
23+
"drug_level",
24+
"drug_or_class_name",
25+
"drug_or_drug_class",
26+
"feature_type",
27+
"genome.collection_year",
28+
"genome.host_common_name",
29+
"genome.isolation_country",
30+
"genome.isolation_source",
31+
"genome.isolation_source_",
32+
"genome_drug.antibiotic",
33+
"genome_drug.resistant_phenotype",
34+
"group",
35+
"max_imp",
36+
"nmcc",
37+
"predicted_drug",
38+
"proteinID",
39+
"source_file",
40+
"species",
41+
"species_count",
42+
"tested_country",
43+
"tested_year",
44+
"trained_country",
45+
"trained_year",
46+
47+
# data.table operator
48+
":="
49+
))

R/utils.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#' @importFrom shinydashboard box tabBox
22
#' @importFrom dplyr filter mutate select group_by summarize ungroup arrange
33
#' @importFrom dplyr pull distinct left_join bind_rows slice_max slice_head
4-
#' @importFrom dplyr collect desc n c_across all_of rowwise
4+
#' @importFrom dplyr collect desc n c_across all_of rowwise case_when join_by
5+
#' @importFrom dplyr count summarise where
56
#' @importFrom ggplot2 ggplot aes geom_col geom_line geom_point geom_boxplot
67
#' @importFrom ggplot2 theme_bw theme_minimal theme element_text labs
78
#' @importFrom ggplot2 scale_fill_brewer scale_color_brewer coord_cartesian

README.Rmd

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ knitr::opts_chunk$set(
1717

1818
<!-- badges: start -->
1919
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
20-
[![CRAN status](https://www.r-pkg.org/badges/version/NewShinyPackage)](https://CRAN.R-project.org/package=NewShinyPackage)
21-
[![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)
2220
<!-- badges: end -->
2321

2422
**amRshiny** is an interactive Shiny dashboard for exploring antimicrobial resistance (AMR) data and machine learning model results.
2523

26-
Part of the **AMR package suite**, [JRaviLab/amR](https://github.com/jravilab/amR):
24+
This is the final package in the **AMR package suite**, [JRaviLab/amR](https://github.com/jravilab/amR):
2725

2826
- **amRdata**: Data (and metadata) preparation from BV-BRC
2927
- **amRml**: ML modeling and analysis
@@ -59,24 +57,6 @@ if (!requireNamespace("devtools", quietly = TRUE))
5957
devtools::install_github("JRaviLab/amRshiny")
6058
```
6159

62-
### Future (Bioconductor release)
63-
64-
Once submitted to Bioconductor, installation will be:
65-
66-
```r
67-
if (!requireNamespace("BiocManager", quietly = TRUE))
68-
install.packages("BiocManager")
69-
70-
BiocManager::install("amRshiny")
71-
```
72-
73-
### Optional dependencies
74-
75-
```r
76-
# For enhanced data processing
77-
BiocManager::install("arrow")
78-
```
79-
8060
## Quick start
8161

8262
```r
@@ -118,12 +98,12 @@ The dashboard includes several tabs:
11898
### Example: Exploring model performance
11999

120100
```r
121-
launch_dashboard()
101+
launchAMRDashboard()
122102

123103
# In the dashboard:
124104
# 1. Navigate to "Model Performance" tab
125-
# 2. Select species: "Campylobacter jejuni"
126-
# 3. Select drug: "ciprofloxacin"
105+
# 2. Select species: "Shigella flexneri"
106+
# 3. Select drug: "ampicillin"
127107
# 4. Select molecular scale: "genes"
128108
# 5. View performance metrics and confusion matrix
129109
```

README.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77

88
[![Lifecycle:
99
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
10-
[![CRAN
11-
status](https://www.r-pkg.org/badges/version/NewShinyPackage)](https://CRAN.R-project.org/package=NewShinyPackage)
12-
[![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)
1310
<!-- badges: end -->
1411

1512
**amRshiny** is an interactive Shiny dashboard for exploring
1613
antimicrobial resistance (AMR) data and machine learning model results.
1714

18-
Part of the **AMR package suite**,
15+
This is the final package in the **AMR package suite**,
1916
[JRaviLab/amR](https://github.com/jravilab/amR):
2017

2118
- **amRdata**: Data (and metadata) preparation from BV-BRC
@@ -57,24 +54,6 @@ if (!requireNamespace("devtools", quietly = TRUE))
5754
devtools::install_github("JRaviLab/amRshiny")
5855
```
5956

60-
### Future (Bioconductor release)
61-
62-
Once submitted to Bioconductor, installation will be:
63-
64-
``` r
65-
if (!requireNamespace("BiocManager", quietly = TRUE))
66-
install.packages("BiocManager")
67-
68-
BiocManager::install("amRshiny")
69-
```
70-
71-
### Optional dependencies
72-
73-
``` r
74-
# For enhanced data processing
75-
BiocManager::install("arrow")
76-
```
77-
7857
## Quick start
7958

8059
``` r
@@ -116,12 +95,12 @@ The dashboard includes several tabs:
11695
### Example: Exploring model performance
11796

11897
``` r
119-
launch_dashboard()
98+
launchAMRDashboard()
12099

121100
# In the dashboard:
122101
# 1. Navigate to "Model Performance" tab
123-
# 2. Select species: "Campylobacter jejuni"
124-
# 3. Select drug: "ciprofloxacin"
102+
# 2. Select species: "Shigella flexneri"
103+
# 3. Select drug: "ampicillin"
125104
# 4. Select molecular scale: "genes"
126105
# 5. View performance metrics and confusion matrix
127106
```
@@ -205,8 +184,8 @@ Report bugs and request features at:
205184

206185
## Related projects
207186

208-
- [amRdata](https://github.com/JRaviLab/amRdata): Data preparation
209-
pipeline
187+
- [amRdata](https://github.com/JRaviLab/amRdata): Data preparation for
188+
AMR prediction
210189
- [amRml](https://github.com/JRaviLab/amRml): ML modeling framework
211190
- [BV-BRC](https://www.bv-brc.org/): Bacterial and Viral Bioinformatics
212191
Resource Center

inst/WORDLIST

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)