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

339 migrate to teal data@78 simplify joinkeys@main #341

Closed
wants to merge 7 commits into from
Closed
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
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 20 additions & 24 deletions design/design_km.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -140,36 +140,32 @@ library(teal)
library(hermes)
library(random.cdisc.data)
library(dplyr)
adsl <- cdisc_dataset("ADSL", radsl(cached = TRUE, na_percentage = 0.2)) %>%
mutate_dataset(
"ADSL$SEX[1:20] <- NA
ADSL$AGE[21:30] <- Inf
ADSL$AGE[31:40] <- NaN
ADSL$EOSDT[51:60] <- NA
ADSL$EOSDT[71:70] <- NA
ADSL$all_na <- NA
ADSL$unknown <- as.list(ADSL$SEX)"
)
adtte <- cdisc_dataset("ADTTE", radtte(cached = TRUE, seed = 1)) %>%
mutate_dataset(
"ADTTE$CNSR <- as.logical(ADTTE$CNSR)
ADTTE$CNSR[100:110] <- NA"
)

mae <- multi_assay_experiment # from hermes
mae <- dataset("MAE", mae)
adsl = radsl(cached = TRUE, na_percentage = 0.2)
adsl$SEX[1:20] <- NA
adsl$AGE[21:30] <- Inf
adsl$AGE[31:40] <- NaN
adsl$EOSDT[51:60] <- NA
adsl$EOSDT[71:70] <- NA
adsl$all_na <- NA
adsl$unknown <- as.list(ADSL$SEX)

adtte = radtte(cached = TRUE, seed = 1)
adtte$CNSR <- as.logical(ADTTE$CNSR)
adtte$CNSR[100:110] <- NA

adtte <- radtte(cached = TRUE, seed = 1) %>%
mutate(
"ADTTE$CNSR <- as.logical(ADTTE$CNSR)
ADTTE$CNSR[100:110] <- NA"
)
mae <- multi_assay_experiment # from hermes

choices_endpoints <- levels(adtte$PARAMCD)

data <- teal_data(MAE = mae, ADSL = adsl, ADTTE = adtte)

datanames <- datanames(data)
data@join_keys <- cdisc_join_keys(!!!datanames)
data@join_keys$mutate(
"MAE", "MAE", c("STUDYID", "USUBJID")
)

data <- teal_data(mae, adsl, adtte) %>%
mutate_join_keys("MAE", "MAE", c("STUDYID", "USUBJID"))
```

## App Launch
Expand Down
17 changes: 10 additions & 7 deletions design/design_survival_forest.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@ We want to design a simple survival forest plot teal module.
## General module workflow

```{r}
# Example ADSL data converted into a CDISCDataset object.
adsl <- cdisc_dataset("ADSL", ex_adsl)
# Example ADSL data
adsl <- ex_adsl

# Example ADTTE data converted into a CDISCDataset object.
adtte <- cdisc_dataset("ADTTE", ex_adtte)
# Example ADTTE data
adtte <- ex_adtte

# Example MAE data and merge datasets.
MAE <- multi_assay_experiment
mae <- dataset("MAE", MAE)
data <- teal_data(mae, adsl, adtte) %>%
mutate_join_keys("MAE", "MAE", c("STUDYID", "USUBJID"))
data <- teal_data(MAE = mae, ADSL = ex_adsl, ADTTE = ex_adtte)
datanames <- datanames(data)
data@join_keys <- cdisc_join_keys(!!!datanames)
data@join_keys$mutate(
"MAE", "MAE", c("STUDYID", "USUBJID")
)

# Get raw ADTTE.
adtte_raw <- get_raw_data(adtte)
Expand Down
34 changes: 17 additions & 17 deletions design/mae_cdisc_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,27 @@ srv_made_up_merge_pr <- function(input, output, session, datasets, dataname) {
library(teal)
library(hermes)
library(random.cdisc.data)
adsl <- cdisc_dataset("ADSL", radsl(cached = TRUE, na_percentage = 0.2)) %>%
mutate_dataset(
"ADSL$SEX[1:20] <- NA
ADSL$AGE[21:30] <- Inf
ADSL$AGE[31:40] <- NaN
ADSL$EOSDT[51:60] <- NA
ADSL$EOSDT[71:70] <- NA
ADSL$all_na <- NA
ADSL$unknown <- as.list(ADSL$SEX)"
)
adtte <- cdisc_dataset("ADTTE", radtte(cached = TRUE)) %>%
mutate_dataset(
"ADTTE$CNSR <- as.logical(ADTTE$CNSR)
ADTTE$CNSR[100:110] <- NA"
)
adsl = radsl(cached = TRUE, na_percentage = 0.2)
adsl$SEX[1:20] <- NA
adsl$AGE[21:30] <- Inf
adsl$AGE[31:40] <- NaN
adsl$EOSDT[51:60] <- NA
adsl$EOSDT[71:70] <- NA
adsl$all_na <- NA
adsl$unknown <- as.list(ADSL$SEX)

adtte = radtte(cached = TRUE)
adtte$CNSR <- as.logical(ADTTE$CNSR)
adtte$CNSR[100:110] <- NA

mae <- multi_assay_experiment # from hermes

data <- cdisc_data(dataset("MAE", mae), adsl, adtte) %>%
mutate_join_keys("MAE", "MAE", c("STUDYID", "USUBJID"))
data <- cdisc_data(MAE = mae, ADSL = adsl, ADTTE = adtte)
datanames <- datanames(data)
data@join_keys <- cdisc_join_keys(!!!datanames)
data@join_keys$mutate(
"MAE", "MAE", c("STUDYID", "USUBJID")
)

app <- init(
data = data,
Expand Down