Skip to content

Commit

Permalink
1441 Introduce transformators parameter in modules (#399)
Browse files Browse the repository at this point in the history
insightsengineering/teal#1441

Included `transformators` parameter in modules. This is passed to
`teal::module` that does assertions and checks on this parameter.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
m7pr and github-actions[bot] authored Jan 24, 2025
1 parent f916107 commit 8005f31
Show file tree
Hide file tree
Showing 18 changed files with 95 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
strategy: ${{ matrix.test-strategy }}
additional-env-vars: |
PKG_SYSREQS_DRY_RUN=true
extra-deps: |
teal.slice (>= 0.5.1.9024),teal.code (>= 0.5.0.9022)
branch-cleanup:
if: >
github.event_name == 'schedule' || (
Expand Down
32 changes: 21 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,27 @@ Depends:
ggplot2,
R (>= 4.1),
shiny,
teal (>= 0.15.0)
teal (>= 0.15.2.9103)
Imports:
checkmate,
DT,
edgeR,
forcats,
hermes (>= 1.7.1),
lifecycle,
MultiAssayExperiment,
rtables (>= 0.5.1),
MultiAssayExperiment (>= 1.32.0),
rtables (>= 0.6.11),
S4Vectors,
shinyRadioMatrix (>= 0.2.1),
shinyWidgets,
stats,
stringr,
SummarizedExperiment,
teal.data (>= 0.3.0.9018),
teal.logger (>= 0.3.0.9003),
teal.reporter (>= 0.2.0),
teal.widgets (>= 0.4.0),
tern (>= 0.7.10),
SummarizedExperiment (>= 1.36.0),
teal.data (>= 0.6.0.9025),
teal.logger (>= 0.3.0.9004),
teal.reporter (>= 0.3.1.9023),
teal.widgets (>= 0.4.2.9025),
tern (>= 0.9.7),
utils
Suggests:
BiocStyle,
Expand All @@ -66,14 +66,24 @@ Suggests:
R6,
rmarkdown,
rvest,
shinytest2 (>= 0.2.0),
testthat (>= 2.0)
shinytest2 (>= 0.3.2),
testthat (>= 3.1.5)
VignetteBuilder:
knitr
RdMacros:
lifecycle
biocViews:
Config/Needs/website: insightsengineering/nesttemplate
Config/Needs/verdepcheck: tidyverse/ggplot2, rstudio/shiny,
insightsengineering/teal, insightsengineering/teal.slice, insightsengineering/teal.code,
insightsengineering/teal.transform,
mllg/checkmate, bioc::edgeR, rstudio/DT, tidyverse/forcats, insightsengineering/hermes,
r-lib/lifecycle, bioc::MultiAssayExperiment, insightsengineering/rtables, bioc::S4Vectors,
antonmalko/shinyRadioMatrix, dreamRs/shinyWidgets, tidyverse/stringr, bioc::SummarizedExperiment,
insightsengineering/teal.data, insightsengineering/teal.logger, insightsengineering/teal.reporter,
insightsengineering/teal.widgets, insightsengineering/tern, bioc::BiocStyle, r-lib/covr,
tidyverse/dplyr, futureverse/globals, yihui/knitr, daroczig/logger, HenrikBengtsson/matrixStats,
r-lib/R6, rstudio/rmarkdown, tidyverse/rvest, rstudio/shinytest2, r-lib/testthat
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
Expand Down
5 changes: 4 additions & 1 deletion R/barplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' analysis.
#'
#' @inheritParams module_arguments
#' @inheritParams teal::module
#'
#' @return Shiny module to be used in the teal app.
#'
Expand Down Expand Up @@ -35,7 +36,8 @@ tm_g_barplot <- function(label,
),
pre_output = NULL,
post_output = NULL,
.test = FALSE) {
.test = FALSE,
transformators = list()) {
message("Initializing tm_g_barplot")
assert_string(label)
assert_string(mae_name)
Expand All @@ -62,6 +64,7 @@ tm_g_barplot <- function(label,
post_output = post_output,
.test = .test
),
transformators = transformators,
datanames = mae_name
)
}
Expand Down
5 changes: 4 additions & 1 deletion R/boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' analysis.
#'
#' @inheritParams module_arguments
#' @inheritParams teal::module
#'
#' @return Shiny module to be used in the teal app.
#'
Expand Down Expand Up @@ -36,7 +37,8 @@ tm_g_boxplot <- function(label,
),
pre_output = NULL,
post_output = NULL,
.test = FALSE) {
.test = FALSE,
transformators = list()) {
message("Initializing tm_g_boxplot")
assert_string(label)
assert_string(mae_name)
Expand All @@ -63,6 +65,7 @@ tm_g_boxplot <- function(label,
post_output = post_output,
.test = .test
),
transformators = transformators,
datanames = mae_name
)
}
Expand Down
5 changes: 4 additions & 1 deletion R/forestplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' This module provides an interactive survival forest plot.
#'
#' @inheritParams module_arguments
#' @inheritParams teal::module
#'
#' @return Shiny module to be used in the teal app.
#'
Expand Down Expand Up @@ -54,7 +55,8 @@ tm_g_forest_tte <- function(label,
post_output = NULL,
plot_height = c(600L, 200L, 2000L),
plot_width = c(1360L, 500L, 2000L),
.test = FALSE) {
.test = FALSE,
transformators = list()) {
message("Initializing tm_g_forest_tte")
assert_string(label)
assert_string(adtte_name)
Expand Down Expand Up @@ -88,6 +90,7 @@ tm_g_forest_tte <- function(label,
post_output = post_output,
.test = .test
),
transformators = transformators,
datanames = c(adtte_name, mae_name)
)
}
Expand Down
5 changes: 4 additions & 1 deletion R/km.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' `ADaM` structure.
#'
#' @inheritParams module_arguments
#' @inheritParams teal::module
#'
#' @return Shiny module to be used in the teal app.
#'
Expand Down Expand Up @@ -57,7 +58,8 @@ tm_g_km <- function(label,
),
pre_output = NULL,
post_output = NULL,
.test = FALSE) {
.test = FALSE,
transformators = list()) {
message("Initializing tm_g_km")
assert_string(label)
assert_string(adtte_name)
Expand Down Expand Up @@ -88,6 +90,7 @@ tm_g_km <- function(label,
post_output = post_output,
.test = .test
),
transformators = transformators,
datanames = c(adtte_name, mae_name)
)
}
Expand Down
5 changes: 4 additions & 1 deletion R/pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' variables.
#'
#' @inheritParams module_arguments
#' @inheritParams teal::module
#'
#' @return Shiny module to be used in the teal app.
#' @export
Expand All @@ -30,7 +31,8 @@ tm_g_pca <- function(label,
exclude_assays = character(),
pre_output = NULL,
post_output = NULL,
.test = FALSE) {
.test = FALSE,
transformators = list()) {
message("Initializing tm_g_pca")
assert_string(label)
assert_string(mae_name)
Expand All @@ -52,6 +54,7 @@ tm_g_pca <- function(label,
post_output = post_output,
.test = .test
),
transformators = transformators,
datanames = mae_name
)
}
Expand Down
5 changes: 4 additions & 1 deletion R/quality.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ heatmap_plot <- function(object, assay_name) {
#' for RNA-seq gene expression quality control.
#'
#' @inheritParams module_arguments
#' @inheritParams teal::module
#'
#' @return Shiny module to be used in the teal app.
#'
Expand All @@ -84,7 +85,8 @@ tm_g_quality <- function(label,
exclude_assays = character(),
pre_output = NULL,
post_output = NULL,
.test = FALSE) {
.test = FALSE,
transformators = list()) {
assert_string(label)
assert_string(mae_name)
assert_character(exclude_assays, any.missing = FALSE)
Expand All @@ -106,6 +108,7 @@ tm_g_quality <- function(label,
post_output = post_output,
.test = .test
),
transformators = transformators,
datanames = mae_name
)
}
Expand Down
5 changes: 4 additions & 1 deletion R/scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' analysis.
#'
#' @inheritParams module_arguments
#' @inheritParams teal::module
#'
#' @return Shiny module to be used in the teal app.
#'
Expand Down Expand Up @@ -35,7 +36,8 @@ tm_g_scatterplot <- function(label,
),
pre_output = NULL,
post_output = NULL,
.test = FALSE) {
.test = FALSE,
transformators = list()) {
message("Initializing tm_g_scatterplot")
assert_string(label)
assert_string(mae_name)
Expand All @@ -61,6 +63,7 @@ tm_g_scatterplot <- function(label,
post_output = post_output,
.test = .test
),
transformators = transformators,
datanames = mae_name
)
}
Expand Down
5 changes: 4 additions & 1 deletion R/volcanoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' analysis.
#'
#' @inheritParams module_arguments
#' @inheritParams teal::module
#'
#' @return Shiny module to be used in the teal app.
#'
Expand All @@ -30,7 +31,8 @@ tm_g_volcanoplot <- function(label,
exclude_assays = character(),
pre_output = NULL,
post_output = NULL,
.test = FALSE) {
.test = FALSE,
transformators = list()) {
message("Initializing tm_g_volcanoplot")
assert_string(label)
assert_string(mae_name)
Expand All @@ -53,6 +55,7 @@ tm_g_volcanoplot <- function(label,
post_output = post_output,
.test = .test
),
transformators = transformators,
datanames = mae_name
)
}
Expand Down
6 changes: 5 additions & 1 deletion man/tm_g_barplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/tm_g_boxplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/tm_g_forest_tte.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/tm_g_km.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/tm_g_pca.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8005f31

Please sign in to comment.