diff --git a/DESCRIPTION b/DESCRIPTION index 100b1a56..9108208a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,7 +30,7 @@ Depends: ggplot2, R (>= 3.6), shiny, - teal (>= 0.14.0) + teal (>= 0.14.0.9019) Imports: checkmate, DT, @@ -47,7 +47,7 @@ Imports: stats, stringr, SummarizedExperiment, - teal.data (>= 0.3.0), + teal.data (>= 0.3.0.9010), teal.logger (>= 0.1.1), teal.reporter (>= 0.2.0), teal.widgets (>= 0.4.0), diff --git a/NEWS.md b/NEWS.md index d1fa9c93..fd6a1a7b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,10 @@ * Added placeholders for `assaySpec`, `adtteSpec` and `geneSpec` inputs when no option is selected. * Disabled the select input for `assaySpec` and `adtteSpec` when there are no options available. +### Enhancements + +* Updated the documentation and vignettes with the new way of specifying data for `teal::init()`. The `data` argument accepts `teal_data` object. + # teal.modules.hermes 0.1.5 ### Bug Fixes diff --git a/R/adtteSpec.R b/R/adtteSpec.R index 5feca2a3..1d1d97aa 100644 --- a/R/adtteSpec.R +++ b/R/adtteSpec.R @@ -208,19 +208,15 @@ adtteSpecInput <- function(inputId, # nolint #' } #' #' my_app <- function() { -#' mae <- hermes::multi_assay_experiment -#' adtte <- teal.modules.hermes::rADTTE %>% -#' dplyr::mutate(is_event = .data$CNSR == 0) -#' -#' data <- teal_data( -#' dataset( -#' "ADTTE", -#' adtte, -#' code = "adtte <- teal.modules.hermes::rADTTE -#' dplyr::mutate(is_event = .data$CNSR == 0)" -#' ), -#' dataset("MAE", mae) -#' ) +#' data <- teal_data() +#' data <- within(data, { +#' ADTTE <- teal.modules.hermes::rADTTE %>% +#' dplyr::mutate(is_event = .data$CNSR == 0) +#' MAE <- hermes::multi_assay_experiment +#' }) +#' datanames <- c("ADTTE", "MAE") +#' datanames(data) <- datanames +#' join_keys(data) <- default_cdisc_join_keys[datanames] #' #' app <- init( #' data = data, diff --git a/R/assaySpec.R b/R/assaySpec.R index 9c72ab7d..df4122ce 100644 --- a/R/assaySpec.R +++ b/R/assaySpec.R @@ -83,10 +83,7 @@ assaySpecInput <- function(inputId, # nolint #' } #' #' my_app <- function() { -#' mae <- hermes::multi_assay_experiment -#' mae_name <- "MAE" -#' mae_data <- dataset(mae_name, mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( diff --git a/R/barplot.R b/R/barplot.R index 02b92944..a9946174 100644 --- a/R/barplot.R +++ b/R/barplot.R @@ -12,9 +12,7 @@ #' @export #' #' @examples -#' mae <- hermes::multi_assay_experiment -#' mae_data <- dataset("MAE", mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( @@ -246,9 +244,7 @@ srv_g_barplot <- function(id, #' sample_tm_g_barplot() #' } sample_tm_g_barplot <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- teal.data::dataset("MAE", mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/R/boxplot.R b/R/boxplot.R index cbc8e397..ac703eee 100644 --- a/R/boxplot.R +++ b/R/boxplot.R @@ -12,9 +12,7 @@ #' @export #' #' @examples -#' mae <- hermes::multi_assay_experiment -#' mae_data <- dataset("MAE", mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( @@ -247,9 +245,7 @@ srv_g_boxplot <- function(id, #' sample_tm_g_boxplot() #' } sample_tm_g_boxplot <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- teal.data::dataset("MAE", mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/R/experimentSpec.R b/R/experimentSpec.R index 73640e1c..8963578c 100644 --- a/R/experimentSpec.R +++ b/R/experimentSpec.R @@ -183,19 +183,16 @@ h_gene_data <- function(object, name_annotation) { #' } #' #' my_app <- function() { -#' mae <- hermes::multi_assay_experiment -#' mae_name <- "MAE" -#' mae_data <- dataset(mae_name, mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( #' module( #' label = "experimentSpec example", #' server = server, -#' server_args = list(mae_name = mae_name), +#' server_args = list(mae_name = "MAE"), #' ui = ui, -#' ui_args = list(mae_name = mae_name), +#' ui_args = list(mae_name = "MAE"), #' datanames = "all" #' ) #' ) diff --git a/R/forestplot.R b/R/forestplot.R index d4cda342..3b9c0625 100644 --- a/R/forestplot.R +++ b/R/forestplot.R @@ -11,19 +11,16 @@ #' @export #' #' @examples -#' mae <- hermes::multi_assay_experiment -#' adtte <- teal.modules.hermes::rADTTE %>% -#' dplyr::mutate(is_event = (.data$CNSR == 0)) +#' data <- teal_data() +#' data <- within(data, { +#' ADTTE <- teal.modules.hermes::rADTTE %>% +#' dplyr::mutate(is_event = .data$CNSR == 0) +#' MAE <- hermes::multi_assay_experiment +#' }) +#' datanames <- c("ADTTE", "MAE") +#' datanames(data) <- datanames +#' join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") #' -#' data <- teal_data( -#' dataset( -#' "ADTTE", -#' adtte, -#' code = "adtte <- teal.modules.hermes::rADTTE %>% -#' dplyr::mutate(is_event = (.data$CNSR == 0))" -#' ), -#' dataset("MAE", mae) -#' ) #' app <- init( #' data = data, #' modules = modules( @@ -286,20 +283,15 @@ srv_g_forest_tte <- function(id, #' sample_tm_g_forest_tte() #' } sample_tm_g_forest_tte <- function() { # nolint - - mae <- hermes::multi_assay_experiment - adtte <- teal.modules.hermes::rADTTE %>% - dplyr::mutate(is_event = .data$CNSR == 0) - - data <- teal.data::teal_data( - teal.data::dataset( - "ADTTE", - adtte, - code = "adtte <- teal.modules.hermes::rADTTE %>% - dplyr::mutate(is_event = .data$CNSR == 0)" - ), - teal.data::dataset("MAE", mae) - ) + data <- teal_data() + data <- within(data, { + ADTTE <- teal.modules.hermes::rADTTE %>% # nolint + dplyr::mutate(is_event = .data$CNSR == 0) + MAE <- hermes::multi_assay_experiment # nolint + }) + datanames <- c("ADTTE", "MAE") + datanames(data) <- datanames + join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") app <- teal::init( data = data, diff --git a/R/geneSpec.R b/R/geneSpec.R index f6ea0b9f..77239bc8 100644 --- a/R/geneSpec.R +++ b/R/geneSpec.R @@ -266,9 +266,7 @@ h_parse_genes <- function(words, choices) { #' } #' funs <- list(mean = colMeans) #' my_app <- function() { -#' mae <- hermes::multi_assay_experiment -#' mae_data <- dataset("MAE", mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( diff --git a/R/km.R b/R/km.R index 23de5f87..0da8f8b5 100644 --- a/R/km.R +++ b/R/km.R @@ -12,19 +12,16 @@ #' @export #' #' @examples -#' mae <- hermes::multi_assay_experiment -#' adtte <- teal.modules.hermes::rADTTE %>% -#' dplyr::mutate(is_event = (.data$CNSR == 0)) +#' data <- teal_data() +#' data <- within(data, { +#' ADTTE <- teal.modules.hermes::rADTTE %>% +#' dplyr::mutate(is_event = .data$CNSR == 0) +#' MAE <- hermes::multi_assay_experiment +#' }) +#' datanames <- c("ADTTE", "MAE") +#' datanames(data) <- datanames +#' join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") #' -#' data <- teal_data( -#' dataset( -#' "ADTTE", -#' adtte, -#' code = "adtte <- teal.modules.hermes::rADTTE %>% -#' dplyr::mutate(is_event = (.data$CNSR == 0))" -#' ), -#' dataset("MAE", mae) -#' ) #' #' modules <- modules( #' tm_g_km( @@ -278,20 +275,15 @@ srv_g_km <- function(id, #' sample_tm_g_km() #' } sample_tm_g_km <- function() { # nolint - - mae <- hermes::multi_assay_experiment - adtte <- teal.modules.hermes::rADTTE %>% - dplyr::mutate(is_event = (.data$CNSR == 0)) - - data <- teal.data::teal_data( - teal.data::dataset( - "ADTTE", - adtte, - code = "adtte <- teal.modules.hermes::rADTTE %>% - dplyr::mutate(is_event = (.data$CNSR == 0))" - ), - teal.data::dataset("MAE", mae) - ) + data <- teal_data() + data <- within(data, { + ADTTE <- teal.modules.hermes::rADTTE %>% # nolint + dplyr::mutate(is_event = .data$CNSR == 0) + MAE <- hermes::multi_assay_experiment # nolint + }) + datanames <- c("ADTTE", "MAE") + datanames(data) <- datanames + join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") modules <- teal::modules( tm_g_km( diff --git a/R/pca.R b/R/pca.R index fb1dbcfa..787c015e 100644 --- a/R/pca.R +++ b/R/pca.R @@ -12,9 +12,7 @@ #' @export #' #' @examples -#' mae <- hermes::multi_assay_experiment -#' mae_data <- dataset("MAE", mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( @@ -451,9 +449,7 @@ srv_g_pca <- function(id, #' sample_tm_g_pca() #' } sample_tm_g_pca <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- teal.data::dataset("MAE", mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/R/quality.R b/R/quality.R index 31c32624..ddae3b69 100644 --- a/R/quality.R +++ b/R/quality.R @@ -66,9 +66,7 @@ heatmap_plot <- function(object, assay_name) { #' @export #' #' @examples -#' mae <- hermes::multi_assay_experiment -#' mae_data <- dataset("MAE", mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( @@ -418,9 +416,7 @@ srv_g_quality <- function(id, #' sample_tm_g_quality() #' } sample_tm_g_quality <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- teal.data::dataset("MAE", mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/R/sampleVarSpec.R b/R/sampleVarSpec.R index 35430607..bfd371fc 100644 --- a/R/sampleVarSpec.R +++ b/R/sampleVarSpec.R @@ -245,9 +245,7 @@ validate_n_levels <- function(x, name, n_levels) { #' }) #' } #' my_app <- function() { -#' mae <- hermes::multi_assay_experiment -#' mae_data <- dataset("MAE", mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( @@ -419,9 +417,9 @@ sampleVarSpecServer <- function(id, # nolint old_values <- names(assign_lists[[experiment_name]][[sample_var]]) if (!is.null(old_values) && - length(old_values) == length(sample_var_levels) && - all(sort(old_values) == sort(sample_var_levels))) { - selected_groups <- assign_lists[[experiment_name]][[sample_var]] + length(old_values) == length(sample_var_levels) && # nolint + all(sort(old_values) == sort(sample_var_levels))) { # nolint + selected_groups <- assign_lists[[experiment_name]][[sample_var]] # nolint } showModal(combModal( diff --git a/R/scatterplot.R b/R/scatterplot.R index 0ea51c93..e98beff0 100644 --- a/R/scatterplot.R +++ b/R/scatterplot.R @@ -12,9 +12,7 @@ #' @export #' #' @examples -#' mae <- hermes::multi_assay_experiment -#' mae_data <- dataset("MAE", mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( @@ -245,9 +243,7 @@ srv_g_scatterplot <- function(id, #' sample_tm_g_scatterplot() #' } sample_tm_g_scatterplot <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- teal.data::dataset("MAE", mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/R/volcanoplot.R b/R/volcanoplot.R index 6b316b4e..3617575c 100644 --- a/R/volcanoplot.R +++ b/R/volcanoplot.R @@ -12,9 +12,7 @@ #' @export #' #' @examples -#' mae <- hermes::multi_assay_experiment -#' mae_data <- dataset("MAE", mae) -#' data <- teal_data(mae_data) +#' data <- teal_data(MAE = hermes::multi_assay_experiment) #' app <- init( #' data = data, #' modules = modules( @@ -267,9 +265,7 @@ srv_g_volcanoplot <- function(id, #' sample_tm_g_volcanoplot() #' } sample_tm_g_volcanoplot <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- teal.data::dataset("MAE", mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/man/adtteSpecServer.Rd b/man/adtteSpecServer.Rd index 33411090..0cd4bdcb 100644 --- a/man/adtteSpecServer.Rd +++ b/man/adtteSpecServer.Rd @@ -134,19 +134,15 @@ server <- function(id, data, filter_panel_api) { } my_app <- function() { - mae <- hermes::multi_assay_experiment - adtte <- teal.modules.hermes::rADTTE \%>\% - dplyr::mutate(is_event = .data$CNSR == 0) - - data <- teal_data( - dataset( - "ADTTE", - adtte, - code = "adtte <- teal.modules.hermes::rADTTE - dplyr::mutate(is_event = .data$CNSR == 0)" - ), - dataset("MAE", mae) - ) + data <- teal_data() + data <- within(data, { + ADTTE <- teal.modules.hermes::rADTTE \%>\% + dplyr::mutate(is_event = .data$CNSR == 0) + MAE <- hermes::multi_assay_experiment + }) + datanames <- c("ADTTE", "MAE") + datanames(data) <- datanames + join_keys(data) <- default_cdisc_join_keys[datanames] app <- init( data = data, diff --git a/man/assaySpecServer.Rd b/man/assaySpecServer.Rd index 7846df46..192807eb 100644 --- a/man/assaySpecServer.Rd +++ b/man/assaySpecServer.Rd @@ -62,10 +62,7 @@ server <- function(id, data, filter_panel_api) { } my_app <- function() { - mae <- hermes::multi_assay_experiment - mae_name <- "MAE" - mae_data <- dataset(mae_name, mae) - data <- teal_data(mae_data) + data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/man/experimentSpecServer.Rd b/man/experimentSpecServer.Rd index 782755f4..5b4554ac 100644 --- a/man/experimentSpecServer.Rd +++ b/man/experimentSpecServer.Rd @@ -107,19 +107,16 @@ server <- function(id, } my_app <- function() { - mae <- hermes::multi_assay_experiment - mae_name <- "MAE" - mae_data <- dataset(mae_name, mae) - data <- teal_data(mae_data) + data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "experimentSpec example", server = server, - server_args = list(mae_name = mae_name), + server_args = list(mae_name = "MAE"), ui = ui, - ui_args = list(mae_name = mae_name), + ui_args = list(mae_name = "MAE"), datanames = "all" ) ) diff --git a/man/geneSpecServer.Rd b/man/geneSpecServer.Rd index 25f64229..ba91c62c 100644 --- a/man/geneSpecServer.Rd +++ b/man/geneSpecServer.Rd @@ -83,9 +83,7 @@ server <- function(id, } funs <- list(mean = colMeans) my_app <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- dataset("MAE", mae) - data <- teal_data(mae_data) + data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/man/sampleVarSpecServer.Rd b/man/sampleVarSpecServer.Rd index 840bf718..11dc042f 100644 --- a/man/sampleVarSpecServer.Rd +++ b/man/sampleVarSpecServer.Rd @@ -102,9 +102,7 @@ server <- function(id, }) } my_app <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- dataset("MAE", mae) - data <- teal_data(mae_data) + data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/man/tm_g_barplot.Rd b/man/tm_g_barplot.Rd index 583e142a..a70d2927 100644 --- a/man/tm_g_barplot.Rd +++ b/man/tm_g_barplot.Rd @@ -81,9 +81,7 @@ analysis. }} \examples{ -mae <- hermes::multi_assay_experiment -mae_data <- dataset("MAE", mae) -data <- teal_data(mae_data) +data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/man/tm_g_boxplot.Rd b/man/tm_g_boxplot.Rd index 9d9dc603..3da1f6fe 100644 --- a/man/tm_g_boxplot.Rd +++ b/man/tm_g_boxplot.Rd @@ -81,9 +81,7 @@ analysis. }} \examples{ -mae <- hermes::multi_assay_experiment -mae_data <- dataset("MAE", mae) -data <- teal_data(mae_data) +data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/man/tm_g_forest_tte.Rd b/man/tm_g_forest_tte.Rd index e12c6f80..03af5e88 100644 --- a/man/tm_g_forest_tte.Rd +++ b/man/tm_g_forest_tte.Rd @@ -119,19 +119,16 @@ This module provides an interactive survival forest plot. }} \examples{ -mae <- hermes::multi_assay_experiment -adtte <- teal.modules.hermes::rADTTE \%>\% - dplyr::mutate(is_event = (.data$CNSR == 0)) - -data <- teal_data( - dataset( - "ADTTE", - adtte, - code = "adtte <- teal.modules.hermes::rADTTE \%>\% - dplyr::mutate(is_event = (.data$CNSR == 0))" - ), - dataset("MAE", mae) -) +data <- teal_data() +data <- within(data, { + ADTTE <- teal.modules.hermes::rADTTE \%>\% + dplyr::mutate(is_event = .data$CNSR == 0) + MAE <- hermes::multi_assay_experiment +}) +datanames <- c("ADTTE", "MAE") +datanames(data) <- datanames +join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") + app <- init( data = data, modules = modules( diff --git a/man/tm_g_km.Rd b/man/tm_g_km.Rd index 9bad0da5..9ffcf7f0 100644 --- a/man/tm_g_km.Rd +++ b/man/tm_g_km.Rd @@ -102,19 +102,16 @@ This teal module produces a grid style \code{Kaplan-Meier} plot for data with }} \examples{ -mae <- hermes::multi_assay_experiment -adtte <- teal.modules.hermes::rADTTE \%>\% - dplyr::mutate(is_event = (.data$CNSR == 0)) - -data <- teal_data( - dataset( - "ADTTE", - adtte, - code = "adtte <- teal.modules.hermes::rADTTE \%>\% - dplyr::mutate(is_event = (.data$CNSR == 0))" - ), - dataset("MAE", mae) -) +data <- teal_data() +data <- within(data, { + ADTTE <- teal.modules.hermes::rADTTE \%>\% + dplyr::mutate(is_event = .data$CNSR == 0) + MAE <- hermes::multi_assay_experiment +}) +datanames <- c("ADTTE", "MAE") +datanames(data) <- datanames +join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") + modules <- modules( tm_g_km( diff --git a/man/tm_g_pca.Rd b/man/tm_g_pca.Rd index 803be026..d0a95518 100644 --- a/man/tm_g_pca.Rd +++ b/man/tm_g_pca.Rd @@ -68,9 +68,7 @@ variables. }} \examples{ -mae <- hermes::multi_assay_experiment -mae_data <- dataset("MAE", mae) -data <- teal_data(mae_data) +data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/man/tm_g_quality.Rd b/man/tm_g_quality.Rd index cd2a888f..f3020027 100644 --- a/man/tm_g_quality.Rd +++ b/man/tm_g_quality.Rd @@ -68,9 +68,7 @@ for RNA-seq gene expression quality control. }} \examples{ -mae <- hermes::multi_assay_experiment -mae_data <- dataset("MAE", mae) -data <- teal_data(mae_data) +data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/man/tm_g_scatterplot.Rd b/man/tm_g_scatterplot.Rd index 90872e7f..5160aeae 100644 --- a/man/tm_g_scatterplot.Rd +++ b/man/tm_g_scatterplot.Rd @@ -81,9 +81,7 @@ analysis. }} \examples{ -mae <- hermes::multi_assay_experiment -mae_data <- dataset("MAE", mae) -data <- teal_data(mae_data) +data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/man/tm_g_volcanoplot.Rd b/man/tm_g_volcanoplot.Rd index a99f21b3..cbf83332 100644 --- a/man/tm_g_volcanoplot.Rd +++ b/man/tm_g_volcanoplot.Rd @@ -74,9 +74,7 @@ analysis. }} \examples{ -mae <- hermes::multi_assay_experiment -mae_data <- dataset("MAE", mae) -data <- teal_data(mae_data) +data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( diff --git a/tests/testthat/adtteSpec/app.R b/tests/testthat/adtteSpec/app.R index 6d4e3bf6..2c5c618b 100644 --- a/tests/testthat/adtteSpec/app.R +++ b/tests/testthat/adtteSpec/app.R @@ -62,18 +62,15 @@ server <- function(id, } my_app <- function() { - mae <- hermes::multi_assay_experiment adtte <- teal.modules.hermes::rADTTE %>% - dplyr::mutate(is_event = .data$CNSR == 0) + dplyr::mutate(is_event = (.data$CNSR == 0)) - data <- teal.data::teal_data( - teal.data::dataset( - "ADTTE", - adtte, - code = "adtte <- teal.modules.hermes::rADTTE %>% - dplyr::mutate(is_event = .data$CNSR == 0)" - ), - teal.data::dataset("MAE", mae) + data <- teal_data( + ADTTE = adtte, + MAE = hermes::multi_assay_experiment, + code = + "adtte <- teal.modules.hermes::rADTTE %>% + dplyr::mutate(is_event = (.data$CNSR == 0))" ) app <- teal::init( diff --git a/tests/testthat/assaySpec/app.R b/tests/testthat/assaySpec/app.R index 295af277..7d264a36 100644 --- a/tests/testthat/assaySpec/app.R +++ b/tests/testthat/assaySpec/app.R @@ -43,10 +43,7 @@ server <- function(id, } my_app <- function() { - mae <- hermes::multi_assay_experiment - mae_name <- "MAE" - mae_data <- teal.data::dataset(mae_name, mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/tests/testthat/experimentSpec/app.R b/tests/testthat/experimentSpec/app.R index 4fdb319b..801758f1 100644 --- a/tests/testthat/experimentSpec/app.R +++ b/tests/testthat/experimentSpec/app.R @@ -56,10 +56,7 @@ server <- function(id, } my_app <- function() { - mae <- hermes::multi_assay_experiment - mae_name <- "MAE" - mae_data <- teal.data::dataset(mae_name, mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/tests/testthat/geneSpec/app.R b/tests/testthat/geneSpec/app.R index e73584ce..bbcbdb42 100644 --- a/tests/testthat/geneSpec/app.R +++ b/tests/testthat/geneSpec/app.R @@ -49,9 +49,7 @@ server <- function(id, funs <- list(mean = colMeans) my_app <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- teal.data::dataset("MAE", mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( diff --git a/tests/testthat/sampleVarSpec/app.R b/tests/testthat/sampleVarSpec/app.R index 6e5aa08c..1e61ff0a 100644 --- a/tests/testthat/sampleVarSpec/app.R +++ b/tests/testthat/sampleVarSpec/app.R @@ -39,9 +39,7 @@ server <- function(id, } my_app <- function() { - mae <- hermes::multi_assay_experiment - mae_data <- teal.data::dataset("MAE", mae) - data <- teal.data::teal_data(mae_data) + data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment) app <- teal::init( data = data, modules = teal::modules( @@ -53,7 +51,7 @@ my_app <- function() { ) ) ) - runApp(app) + shinyApp(app$ui, app$server) } my_app()