Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple scda #214

Merged
merged 3 commits into from
Jul 6, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
_R_CHECK_EXAMPLE_TIMING_THRESHOLD_=10
_R_CHECK_EXAMPLE_TIMING_THRESHOLD_=5
additional-r-cmd-check-params: --as-cran
enforce-note-blocklist: true
note-blocklist: |
Expand Down
6 changes: 1 addition & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Imports:
lifecycle,
logger (>= 0.2.0),
shinyvalidate,
teal.code (>= 0.2.0),
teal.code (>= 0.3.0),
teal.logger (>= 0.1.1),
teal.reporter (>= 0.1.1),
teal.transform (>= 0.3.0),
Expand All @@ -43,15 +43,11 @@ Suggests:
knitr,
nestcolor (>= 0.1.0),
rmarkdown,
scda (>= 0.1.5),
scda.2022 (>= 0.1.3),
teal.data (>= 0.1.2),
testthat (>= 2.0)
Remotes:
insightsengineering/osprey@*release,
insightsengineering/osprey@*release,
insightsengineering/scda.2022@*release,
insightsengineering/scda@*release,
insightsengineering/teal.code@*release,
insightsengineering/teal.data@*release,
insightsengineering/teal.logger@*release,
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# teal.osprey 0.1.15.9013

* Examples now use `scda.2022` instead of `scda.2021`.
* Removed `scda` package dependency from examples.
* Fixed crash in `tm_g_heat_bygrade` when not plotting `Conmed`.
* Added validation to `tm_g_spiderplot.R` that checks if there are duplicates in X and Y facet variables.
* Improved input validation and used the `teal::validate_inputs` mechanism to send validation messages to the output panel.
Expand All @@ -10,7 +10,7 @@
### Breaking changes

* Replaced `chunks` with simpler `qenv` class.
* Replaced `datasets` argument containing `FilteredData` with the new arguments `data` (`tdata` object) and `filter_panel_api` (`FilterPanelAPI`).
* In all `tm_xyz_srv` modules `datasets` argument containing `FilteredData` have been replaced with the new argument `data` (`tdata` object) and `filter_panel_api` (`FilterPanelAPI`).

Check notice on line 13 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L13

"been replaced" may be passive voice
* Updated `arm_var` to point to the factor column in `ANL`. It can't be a character column anymore.
* Removed redundant formal arguments from `tm_g_patient_profile`.

Expand All @@ -21,7 +21,7 @@

### Enhancements
* Added `teal.reporter` to all modules.
* Updated `shiny::validate` calls to `shinyvalidate` for better `UI` overview.

Check notice on line 24 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L24

"validate" is wordy or unneeded
* Implemented `nestcolor` with slight refactoring to `tm_g_swimlane`. Added `nestcolor` in examples.

### Miscellaneous
Expand All @@ -44,7 +44,7 @@
* The label of the select input widget to choose the `paramcd` is no longer hard coded to `ADTR` in `tm_g_spiderplot`.

### Miscellaneous
* Rewrote module to use `moduleServer` and updated calls to `teal.devel` modules which have also been written to use `moduleServer`.

Check notice on line 47 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L47

"been written" may be passive voice
* Replaced calls to `teal::root_modules` with `teal::modules` following deprecation of `teal::root_modules`.
* Adjusted package imports to take into account changes to the `teal` framework.
* Functions from imported packages are now fully specified.
Expand All @@ -62,7 +62,7 @@
* Fixed a bug in `tm_g_waterfall` so that the `Tumor Burden Parameter` `UI` element is now respected.

### Miscellaneous
* Updated R version requirement to `R >= 3.6`.

Check notice on line 65 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L65

"requirement" is wordy or unneeded
* Removed the function `teal::keys` in the examples of `tm_g_spiderplot` and `tm_g_waterfall` modules.
* Removed dependency on `test.nest` package.
* Removed dependency on `utils.nest` package and replaced its functions with equivalents from the `checkmate` package.
Expand All @@ -79,14 +79,14 @@
# teal.osprey 0.1.10

### Enhancements
* Added a Shiny feature to `tm_g_swimlane` that will prevent needless re-render of the output when the user has not completely provided inputs to the vertical lines widget.

Check notice on line 82 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L82

"completely" is a weasel word and can weaken meaning

### Miscellaneous
* Altered the `Choose Up To 2:` inputs widget from the Encoding Panel to be independent of the Filtering Panel in `tm_g_butterfly`.
* Updated warning message when Tumor Burden Parameter is not selected in `tm_g_waterfall`.

### Bug fixes
* Fixed a bug in `tm_g_butterfly` that displays the filtering and faceting widgets despite not being provided in the arguments.

Check notice on line 89 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L89

"being provided" may be passive voice

# teal.osprey 0.1.9

Expand All @@ -95,8 +95,8 @@
* Added new `teal` module `tm_g_ae_sub` for an `AE` by subgroups plot.

### Bug fixes
* Fixed misleading validate message in `tm_g_ae_oview` when either Control or Treatment variable is filtered out.

Check notice on line 98 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L98

"validate" is wordy or unneeded

Check notice on line 98 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L98

"is filtered" may be passive voice
* Added a validate statement to output a better error message when both the left and right dichotomization values are filtered out of data.

Check notice on line 99 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L99

"validate" is wordy or unneeded

Check notice on line 99 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L99

"are filtered" may be passive voice

### Miscellaneous
* Improved reactivity dependencies across modules.
Expand All @@ -104,33 +104,33 @@
# teal.osprey 0.1.8

* Added validation message if the dataset does not contain subjects from both the control and treatment arms in `tm_g_events_term_id`.
* Improved validation message if subject has been filtered out of dataset when used with `tm_g_patient_profile`.

Check notice on line 107 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L107

"been filtered" may be passive voice
* Fixed modules due to changes to `plot_with_settings` in latest `teal.devel` release.
* Updated study day and duration derivation in `tm_g_patient_profile`.

# teal.osprey 0.1.7

### Enhancements
* Added additional validation for horizontal and vertical reference lines in `tm_g_spider_plot`.

Check notice on line 114 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L114

"additional" is wordy or unneeded

### Bug Fixes
* Fixed `tm_g_patient_profile` when adverse event line color variable is not selected.
* Fixed the issue of unknown date format and established minimum number of observation threshold in `tm_g_patient_profile`.

Check notice on line 118 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L118

"minimum" is wordy or unneeded

### Miscellaneous
* Retired the following `teal` modules due to duplication in `teal.modules.clinical`:
- Teal module for `AE` overview summary table - can be replaced with `teal.modules.clinical::tm_t_events_summary`.

Check notice on line 122 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L122

"be replaced" may be passive voice
- Teal module for `AE` summary table by preferred terms - can be replaced with `teal.modules.clinical::tm_t_events`.

Check notice on line 123 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L123

"be replaced" may be passive voice
- Teal module for `AE` summary table by highest `NCI-CTCAE` grade - can be replaced with `teal.modules.clinical::tm_t_events_by_grade`.

Check notice on line 124 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L124

"be replaced" may be passive voice
- Teal module for Disposition table - can be replaced with `teal.modules.clinical::tm_t_summary`.

Check notice on line 125 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L125

"be replaced" may be passive voice
* Moved `code` argument to `cdisc_dataset` (from `cdisc_data`) in examples.

# teal.osprey 0.1.6

* All graph modules now accept a `plot_width` argument which specifies the plot width and renders a slider to adjust the width interactively in the module.
* Replaced `plot_with_height` with `plot_with_settings` module throughout package.
* Show R Code now produces code generating only the datasets needed for the current module, not all datasets included in the data argument of `teal::init`.

Check notice on line 132 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L132

"only" can weaken meaning
* Evaluate chunks with `chunks_safe_eval` rather than `chunks_eval`.

Check notice on line 133 in NEWS.md

View workflow job for this annotation

GitHub Actions / grammar

NEWS.md#L133

"Evaluate" is wordy or unneeded

# teal.osprey 0.1.5

Expand Down
10 changes: 4 additions & 6 deletions R/tm_g_ae_oview.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
#' @export
#'
#' @examples
#' library(scda)
#' library(nestcolor)
#'
#' latest_data <- synthetic_cdisc_data("latest")
#' ADSL <- latest_data$adsl
#' ADAE <- latest_data$adae
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE
#'
#' # Add additional dummy causality flags.
#' add_event_flags <- function(dat) {
Expand All @@ -47,10 +45,10 @@
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADAE", ADAE,
#' code =
#' "ADAE <- synthetic_cdisc_data('latest')$adae
#' "ADAE <- osprey::rADAE
#' add_event_flags <- function(dat) {
#' dat <- dat %>%
#' dplyr::mutate(
Expand Down
10 changes: 4 additions & 6 deletions R/tm_g_ae_sub.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
#'
#' @examples
#' # Example using stream (ADaM) dataset
#' library(scda)
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADAE <- synthetic_cdisc_data("latest")$adae
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
#' cdisc_dataset("ADAE", ADAE, code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae"),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"),
#' check = TRUE
#' ),
#' modules = modules(
Expand Down
9 changes: 4 additions & 5 deletions R/tm_g_butterfly.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@
#'
#' # Example using stream (ADaM) dataset
#' library(dplyr)
#' library(scda)
#' library(nestcolor)
#'
#' set.seed(23)
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADAE <- synthetic_cdisc_data("latest")$adae
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE
#' ADSL <- mutate(ADSL, DOSE = paste(sample(1:3, n(), replace = TRUE), "UG"))
#' ADAE <- mutate(
#' ADAE,
Expand All @@ -61,12 +60,12 @@
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL,
#' code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl
#' code = "ADSL <- osprey::rADSL
#' set.seed(23)
#' ADSL <- mutate(ADSL, DOSE = paste(sample(1:3, n(), replace = TRUE), 'UG'))"
#' ),
#' cdisc_dataset("ADAE", ADAE,
#' code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae
#' code = "ADAE <- osprey::rADAE
#' ADAE <- mutate(ADAE,
#' flag1 = ifelse(AETOXGR == 1, 1, 0),
#' flag2 = ifelse(AETOXGR == 2, 1, 0),
Expand Down
9 changes: 4 additions & 5 deletions R/tm_g_events_term_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@
#' @author Molly He (hey59) \email{hey59@gene.com}
#'
#' @examples
#' library(scda)
#' library(nestcolor)
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADAE <- synthetic_cdisc_data("latest")$adae
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
#' cdisc_dataset("ADAE", ADAE, code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae"),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"),
#' check = TRUE
#' ),
#' modules = modules(
Expand Down
19 changes: 8 additions & 11 deletions R/tm_g_heat_bygrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@
#' @export
#'
#' @examples
#' library(scda)
#' library(dplyr)
#' library(nestcolor)
#' latest_data <- synthetic_cdisc_data("latest")
#' ADSL <- latest_data$adsl %>% slice(1:30)
#' ADEX <- latest_data$adex %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- latest_data$adae %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- latest_data$adcm %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADSL <- osprey::rADSL %>% slice(1:30)
#' ADEX <- osprey::rADEX %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- osprey::rADAE %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- osprey::rADCM %>% filter(USUBJID %in% ADSL$USUBJID)
#'
#' # This preprocess is only to force legacy standard on ADCM
#' ADCM <- ADCM %>%
Expand Down Expand Up @@ -80,11 +78,10 @@
#' cdisc_dataset("ADAE", ADAE),
#' cdisc_dataset("ADCM", ADCM, keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD")),
#' code = "
#' latest_data <- synthetic_cdisc_data('latest')
#' ADSL <- latest_data$adsl %>% slice(1:30)
#' ADEX <- latest_data$adex %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- latest_data$adae %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- latest_data$adcm %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADSL <- osprey::rADSL %>% slice(1:30)
#' ADEX <- osprey::rADEX %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- osprey::rADAE %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- osprey::rADCM %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique()
#' ADEX <- ADEX %>%
#' filter(PARCAT1 == 'INDIVIDUAL') %>%
Expand Down
32 changes: 12 additions & 20 deletions R/tm_g_patient_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,15 @@
#' @export
#'
#' @examples
#' library(scda)
#' library(nestcolor)
#'
#' latest_data <- synthetic_cdisc_data("latest")
#'
#' ADSL <- latest_data$adsl
#' ADAE <- latest_data$adae %>%
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
#' )
#' ADCM <- latest_data$adcm %>%
#' ADCM <- osprey::rADCM %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
Expand All @@ -84,47 +81,42 @@
#' select(-starts_with("ATC")) %>%
#' unique()
#'
#' ADRS <- latest_data$adrs %>%
#' ADRS <- osprey::rADRS %>%
#' mutate(ADT = as.Date(ADTM))
#' ADEX <- latest_data$adex %>%
#' ADEX <- osprey::rADEX %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
#' )
#' ADLB <- latest_data$adlb %>%
#' ADLB <- osprey::rADLB %>%
#' mutate(
#' ADT = as.Date(ADTM),
#' LBSTRESN = as.numeric(LBSTRESC)
#' )
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL,
#' code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"
#' ),
#' cdisc_dataset("ADRS", ADRS,
#' code = "ADRS <- synthetic_cdisc_data(\"latest\")$adrs %>%
#' mutate(ADT = as.Date(ADTM))"
#' ),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADRS", ADRS, code = "ADRS <- osprey::rADRS %>% mutate(ADT = as.Date(ADTM))"),
#' cdisc_dataset("ADAE", ADAE,
#' code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae %>%
#' code = "ADAE <- osprey::rADAE %>%
#' mutate(ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM))"
#' ),
#' cdisc_dataset("ADCM", ADCM,
#' code = "ADCM <- synthetic_cdisc_data(\"latest\")$adcm %>%
#' code = "ADCM <- osprey::rADCM %>%
#' mutate(ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM))
#' ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique()",
#' keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD")
#' ),
#' cdisc_dataset("ADLB", ADLB,
#' code = "ADLB <- synthetic_cdisc_data(\"latest\")$adlb %>%
#' code = "ADLB <- osprey::rADLB %>%
#' mutate(ADT = as.Date(ADTM),
#' LBSTRESN = as.numeric(LBSTRESC))"
#' ),
#' cdisc_dataset("ADEX", ADEX,
#' code = "ADEX <- synthetic_cdisc_data(\"latest\")$adex %>%
#' code = "ADEX <- osprey::rADEX %>%
#' mutate(ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM))"
#' ),
Expand Down
9 changes: 4 additions & 5 deletions R/tm_g_spiderplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@
#'
#' # Example using stream (ADaM) dataset
#' library(dplyr)
#' library(scda)
#' library(nestcolor)
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADTR <- synthetic_cdisc_data("latest")$adtr
#' ADSL <- osprey::rADSL
#' ADTR <- osprey::rADTR
#'
#' app <- teal::init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADTR", ADTR,
#' code = "ADTR <- synthetic_cdisc_data(\"latest\")$adtr",
#' code = "ADTR <- osprey::rADTR",
#' keys = c("STUDYID", "USUBJID", "PARAMCD", "AVISIT")
#' ),
#' check = TRUE
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
<!-- end badges -->

The teal.osprey package provides community contributed `teal` modules of the analysis functions from the [osprey](https://insightsengineering.github.io/osprey/) R package.
This enables `teal` app developers to easily create applications making use of the `osprey` analysis functions.

Check notice on line 25 in README.md

View workflow job for this annotation

GitHub Actions / grammar

README.md#L25

"easily" can weaken meaning

## Installation

For releases from August 2022 it is recommended that you [create and use a GitHub PAT](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) to install the latest version of this package. Once you have the PAT, run the following:

Check notice on line 29 in README.md

View workflow job for this annotation

GitHub Actions / grammar

README.md#L29

"it is" is wordy or unneeded

Check notice on line 29 in README.md

View workflow job for this annotation

GitHub Actions / grammar

README.md#L29

"is recommended" may be passive voice

```r
Sys.setenv(GITHUB_PAT = "your_access_token_here")
Expand All @@ -36,8 +36,6 @@

A stable release of all `NEST` packages from June 2022 is also available [here](https://github.com/insightsengineering/depository#readme).

In order to run many of the examples you will also need to install the [`scda`](https://insightsengineering.github.io/scda/) package.

## Stargazers and Forkers

### Stargazers over time
Expand Down
10 changes: 4 additions & 6 deletions man/tm_g_ae_oview.Rd

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

10 changes: 4 additions & 6 deletions man/tm_g_ae_sub.Rd

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

9 changes: 4 additions & 5 deletions man/tm_g_butterfly.Rd

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

9 changes: 4 additions & 5 deletions man/tm_g_events_term_id.Rd

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

Loading