Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# teal.modules.clinical 0.8.16.9095

### Breaking Changes
+ Adapted all modules to use `teal_data` objects.
* Adapted all modules to use `teal_data` objects.
* Module arguments that previously accepted inputs from `teal.transform::choices_selected()` or `teal.transform::data_extract_spec()` now only accept input from `teal.transform::choices_selected()`. The affected modules are: `tm_a_gee`, `tm_a_mmrm`, `tm_g_ci`, `tm_g_forest_rsp`, `tm_g_forest_tte`, `tm_g_ipp`, `tm_g_km`, `tm_g_lineplot`, `tm_g_pp_adverse_events`, `tm_g_pp_patient_timeline`, `tm_g_pp_therapy`, `tm_g_pp_vitals`, `tm_t_abnormality`, `tm_t_abnormality_by_worst_grade`, `tm_t_ancova`, `tm_t_binary_outcome`, `tm_t_coxreg`, `tm_t_events`, `tm_t_events_by_grade`, `tm_t_events_patyear`, `tm_t_events_summary`, `tm_t_exposure`, `tm_t_logistic`, `tm_t_mult_events`, `tm_t_pp_basic_info`, `tm_t_pp_laboratory`, `tm_t_pp_medical_history`, `tm_t_pp_prior_medication`, `tm_t_shift_by_arm`, `tm_t_shift_by_arm_by_worst`, `tm_t_shift_by_grade`, `tm_t_smq`, `tm_t_summary`, `tm_t_summary_by`, and `tm_t_tte`

### Enhancements
* Updated the documentation and vignettes to demonstrate method to pass `teal_data` object to `teal::init()`.
Expand Down
52 changes: 26 additions & 26 deletions R/argument_convention.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,34 +120,34 @@ NULL
#' with delayed [teal.transform::variable_choices()] or delayed [teal.transform::value_choices()]
#' with the elements named `ref` and `comp` that the defined the default
#' reference and comparison arms when the arm variable is changed.
#' @param arm_var ([`teal.transform::choices_selected()`] or [`teal.transform::data_extract_spec()`])\cr object with all
#' @param arm_var ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for variable names that can be used as `arm_var`.
#' It defines the grouping variable(s) in the results table.
#' If there are two elements selected for `arm_var`,
#' second variable will be nested under the first variable.
#' @param atirel ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param atirel ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `ATIREL` variable from `dataname`.
#' @param aval_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param aval_var ([teal.transform::choices_selected()])\cr object with
#' all available choices and pre-selected option for the analysis variable.
#' @param avalu_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param avalu_var ([teal.transform::choices_selected()])\cr object with
#' all available choices and preselected option for the analysis unit variable.
#' @param avisit ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr value of analysis
#' @param avisit ([teal.transform::choices_selected()])\cr value of analysis
#' visit `AVISIT` of interest.
#' @param baseline_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param baseline_var ([teal.transform::choices_selected()])\cr object with
#' all available choices and preselected option for variable values that can be used as `baseline_var`.
#' @param by_vars ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param by_vars ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for variable names used to split the summary by rows.
#' @param cmdecod ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param cmdecod ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `CMDECOD` variable from `dataname`.
#' @param cmindc ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param cmindc ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `CMINDC` variable from `dataname`.
#' @param cmstdy ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param cmstdy ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `CMSTDY` variable from `dataname`.
#' @param cnsr_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param cnsr_var ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the censoring variable.
#' @param conf_level ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param conf_level ([teal.transform::choices_selected()])\cr object with
#' all available choices and pre-selected option for the confidence level, each within range of (0, 1).
#' @param cov_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param cov_var ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the covariates variables.
#' @param dataname (`character`)\cr analysis data used in teal module.
#' @param default_responses (`list` or `character`)\cr defines
Expand All @@ -159,19 +159,19 @@ NULL
#' @param fixed_symbol_size (`logical`)\cr When (`TRUE`), the same symbol size is used for plotting each estimate.
#' Otherwise, the symbol size will be proportional to the sample size in each each subgroup.
#' @param font_size (`numeric`)\cr numeric vector of length 3 of current, minimum and maximum font size values.
#' @param hlt ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr name of the variable
#' @param hlt ([teal.transform::choices_selected()])\cr name of the variable
#' with high level term for events.
#' @param id_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object specifying
#' @param id_var ([teal.transform::choices_selected()])\cr object specifying
#' the variable name for subject id.
#' @param interact_var (`character`)\cr name of the variable that should have interactions
#' with arm. If the interaction is not needed, the default option is `NULL`.
#' @param interact_y (`character`)\cr a selected item from the interact_var column which will be used
#' to select the specific `ANCOVA` results when interact_var is discrete. If the interaction is not
#' needed, the default option is `FALSE`.
#' @param label (`character`)\cr menu item label of the module in the teal app.
#' @param llt ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr name of the variable
#' @param llt ([teal.transform::choices_selected()])\cr name of the variable
#' with low level term for events.
#' @param paramcd ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param paramcd ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the parameter code variable from `dataname`.
#' @param parentname (`character`)\cr parent analysis data used in teal module, usually this refers to `ADSL`.
#' @param patient_col (`character`)\cr name of patient ID variable.
Expand All @@ -183,27 +183,27 @@ NULL
#' For example the [shiny::helpText()] elements are useful.
#' @param pre_output optional, (`shiny.tag`)\cr with text placed before the output to put the output into context.
#' For example a title.
#' @param strata_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr names of
#' @param strata_var ([teal.transform::choices_selected()])\cr names of
#' the variables for stratified analysis.
#' @param summarize_vars ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr names of
#' @param summarize_vars ([teal.transform::choices_selected()])\cr names of
#' the variables that should be summarized.
#' @param subgroup_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param subgroup_var ([teal.transform::choices_selected()])\cr object with
#' all available choices and preselected option for variable names that can be used as the default subgroups.
#' @param time_points ([teal.transform::choices_selected()])\cr object with all available choices and preselected option
#' for time points that can be used in [tern::surv_timepoint()].
#' @param time_unit_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object
#' @param time_unit_var ([teal.transform::choices_selected()])\cr object
#' with all available choices and pre-selected option for the time unit variable.
#' @param treatment_flag ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr value
#' @param treatment_flag ([teal.transform::choices_selected()])\cr value
#' indicating on treatment records in `treatment_flag_var`.
#' @param treatment_flag_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr on
#' @param treatment_flag_var ([teal.transform::choices_selected()])\cr on
#' treatment flag variable.
#' @param useNA (`character`)\cr whether missing data (`NA`) should be displayed as a level.
#' @param visit_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param visit_var ([teal.transform::choices_selected()])\cr object with
#' all available choices and preselected option for variable names that can be used as `visit` variable.
#' Must be a factor in `dataname`.
#' @param worst_flag_indicator ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr
#' @param worst_flag_indicator ([teal.transform::choices_selected()])\cr
#' value indicating worst grade.
#' @param worst_flag_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object
#' @param worst_flag_var ([teal.transform::choices_selected()])\cr object
#' with all available choices and preselected option for variable names that can be used as worst flag variable.
#'
#' @return a `teal_module` object.
Expand Down
6 changes: 6 additions & 0 deletions R/tm_a_gee.R
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ tm_a_gee <- function(label,
checkmate::assert_string(label)
checkmate::assert_string(dataname)
checkmate::assert_string(parentname)
checkmate::assert_class(aval_var, "choices_selected")
checkmate::assert_class(id_var, "choices_selected")
checkmate::assert_class(arm_var, "choices_selected")
checkmate::assert_class(visit_var, "choices_selected")
checkmate::assert_class(cov_var, "choices_selected")
checkmate::assert_class(paramcd, "choices_selected")
checkmate::assert_class(conf_level, "choices_selected")
checkmate::assert_class(pre_output, classes = "shiny.tag", null.ok = TRUE)
checkmate::assert_class(post_output, classes = "shiny.tag", null.ok = TRUE)
Expand Down
8 changes: 7 additions & 1 deletion R/tm_a_mmrm.R
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ template_mmrm_plots <- function(fit_name,
#' @inheritParams module_arguments
#' @inheritParams template_mmrm_tables
#' @inheritParams template_mmrm_plots
#' @param method ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param method ([teal.transform::choices_selected()])\cr object with
#' all available choices and pre-selected option for the adjustment method.
#' @param ggplot2_args (`ggplot2_args`) \cr optional, object created by [`teal.widgets::ggplot2_args()`]
#' with settings for all the plots or named list of `ggplot2_args` objects for plot-specific settings.
Expand Down Expand Up @@ -544,6 +544,12 @@ tm_a_mmrm <- function(label,
checkmate::assert_string(label)
checkmate::assert_string(total_label)
checkmate::assert_string(dataname)
checkmate::assert_class(aval_var, "choices_selected")
checkmate::assert_class(id_var, "choices_selected")
checkmate::assert_class(arm_var, "choices_selected")
checkmate::assert_class(visit_var, "choices_selected")
checkmate::assert_class(cov_var, "choices_selected")
checkmate::assert_class(paramcd, "choices_selected")
checkmate::assert_class(method, "choices_selected")
checkmate::assert_class(conf_level, "choices_selected")
checkmate::assert_numeric(plot_height, len = 3, any.missing = FALSE, finite = TRUE)
Expand Down
5 changes: 5 additions & 0 deletions R/tm_g_forest_rsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ tm_g_forest_rsp <- function(label,
checkmate::assert_string(dataname)
checkmate::assert_string(parentname)
checkmate::assert_flag(fixed_symbol_size)
checkmate::assert_class(arm_var, "choices_selected")
checkmate::assert_class(paramcd, "choices_selected")
checkmate::assert_class(aval_var, "choices_selected")
checkmate::assert_class(subgroup_var, "choices_selected")
checkmate::assert_class(strata_var, "choices_selected")
checkmate::assert_class(conf_level, "choices_selected")
checkmate::assert_multi_class(default_responses, c("list", "character", "numeric"), null.ok = TRUE)
checkmate::assert_numeric(plot_height, len = 3, any.missing = FALSE, finite = TRUE)
Expand Down
7 changes: 7 additions & 0 deletions R/tm_g_forest_tte.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,14 @@ tm_g_forest_tte <- function(label,
checkmate::assert_string(label)
checkmate::assert_string(dataname)
checkmate::assert_string(parentname)
checkmate::assert_class(arm_var, "choices_selected")
checkmate::assert_class(subgroup_var, "choices_selected")
checkmate::assert_class(paramcd, "choices_selected")
checkmate::assert_class(strata_var, "choices_selected")
checkmate::assert_class(aval_var, "choices_selected")
checkmate::assert_class(cnsr_var, "choices_selected")
checkmate::assert_class(conf_level, "choices_selected")
checkmate::assert_class(time_unit_var, "choices_selected")
checkmate::assert_flag(fixed_symbol_size)
checkmate::assert_numeric(plot_height, len = 3, any.missing = FALSE, finite = TRUE)
checkmate::assert_numeric(plot_height[1], lower = plot_height[2], upper = plot_height[3], .var.name = "plot_height")
Expand Down
9 changes: 8 additions & 1 deletion R/tm_g_ipp.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ template_g_ipp <- function(dataname = "ANL",
#'
#' @inheritParams module_arguments
#' @inheritParams template_g_ipp
#' @param arm_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param arm_var ([teal.transform::choices_selected()])\cr object with
#' all available choices and preselected option for variable values that can be used as arm variable.
#'
#' @inherit module_arguments return seealso
Expand Down Expand Up @@ -302,6 +302,13 @@ tm_g_ipp <- function(label,
}

logger::log_info("Initializing tm_g_ipp")
checkmate::assert_class(arm_var, "choices_selected")
checkmate::assert_class(paramcd, "choices_selected")
checkmate::assert_class(id_var, "choices_selected")
checkmate::assert_class(visit_var, "choices_selected")
checkmate::assert_class(aval_var, "choices_selected")
checkmate::assert_class(avalu_var, "choices_selected")
checkmate::assert_class(baseline_var, "choices_selected")
checkmate::assert_string(label)
checkmate::assert_string(dataname)
checkmate::assert_string(parentname)
Expand Down
9 changes: 8 additions & 1 deletion R/tm_g_km.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ template_g_km <- function(dataname = "ANL",
#'
#' @inheritParams module_arguments
#' @inheritParams template_g_km
#' @param facet_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
#' @param facet_var ([teal.transform::choices_selected()])\cr object with
#' all available choices and preselected option for names of variable that can be used for plot faceting.
#'
#' @inherit module_arguments return seealso
Expand Down Expand Up @@ -331,6 +331,13 @@ tm_g_km <- function(label,
checkmate::assert_string(label)
checkmate::assert_string(dataname)
checkmate::assert_string(parentname)
checkmate::assert_class(arm_var, "choices_selected")
checkmate::assert_class(paramcd, "choices_selected")
checkmate::assert_class(strata_var, "choices_selected")
checkmate::assert_class(facet_var, "choices_selected")
checkmate::assert_class(time_unit_var, "choices_selected")
checkmate::assert_class(aval_var, "choices_selected")
checkmate::assert_class(cnsr_var, "choices_selected")
checkmate::assert_class(conf_level, "choices_selected")
checkmate::assert_numeric(plot_height, len = 3, any.missing = FALSE, finite = TRUE)
checkmate::assert_numeric(plot_height[1], lower = plot_height[2], upper = plot_height[3], .var.name = "plot_height")
Expand Down
1 change: 1 addition & 0 deletions R/tm_g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ tm_g_lineplot <- function(label,
checkmate::assert_string(mid)
checkmate::assert_string(interval, null.ok = TRUE)
whiskers <- match.arg(whiskers)
checkmate::assert_class(paramcd, "choices_selected")
checkmate::assert_class(conf_level, "choices_selected")
checkmate::assert_numeric(plot_height, len = 3, any.missing = FALSE, finite = TRUE)
checkmate::assert_numeric(plot_height[1], lower = plot_height[2], upper = plot_height[3], .var.name = "plot_height")
Expand Down
21 changes: 14 additions & 7 deletions R/tm_g_pp_adverse_events.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,19 @@ template_adverse_events <- function(dataname = "ANL",
#'
#' @inheritParams module_arguments
#' @inheritParams template_adverse_events
#' @param aeterm ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param aeterm ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `AETERM` variable from `dataname`.
#' @param tox_grade ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param tox_grade ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `AETOXGR` variable from `dataname`.
#' @param causality ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param causality ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `AEREL` variable from `dataname`.
#' @param outcome ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param outcome ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `AEOUT` variable from `dataname`.
#' @param action ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param action ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `AEACN` variable from `dataname`.
#' @param time ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param time ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `ASTDY` variable from `dataname`.
#' @param decod ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with all
#' @param decod ([teal.transform::choices_selected()])\cr object with all
#' available choices and preselected option for the `AEDECOD` variable from `dataname`.
#'
#' @inherit module_arguments return
Expand Down Expand Up @@ -264,6 +264,13 @@ tm_g_pp_adverse_events <- function(label,
checkmate::assert_string(dataname)
checkmate::assert_string(parentname)
checkmate::assert_string(patient_col)
checkmate::assert_class(aeterm, "choices_selected", null.ok = TRUE)
checkmate::assert_class(tox_grade, "choices_selected", null.ok = TRUE)
checkmate::assert_class(causality, "choices_selected", null.ok = TRUE)
checkmate::assert_class(outcome, "choices_selected", null.ok = TRUE)
checkmate::assert_class(action, "choices_selected", null.ok = TRUE)
checkmate::assert_class(time, "choices_selected", null.ok = TRUE)
checkmate::assert_class(decod, "choices_selected", null.ok = TRUE)
checkmate::assert_numeric(font_size, len = 3, any.missing = FALSE, finite = TRUE)
checkmate::assert_numeric(font_size[1], lower = font_size[2], upper = font_size[3], .var.name = "font_size")
checkmate::assert_numeric(plot_height, len = 3, any.missing = FALSE, finite = TRUE)
Expand Down
Loading