Skip to content

Commit

Permalink
Merge pull request #248 from pharmaverse/247_update_adtr@33_recist@devel
Browse files Browse the repository at this point in the history
Closes #247 update adtr
  • Loading branch information
bundfussr authored Sep 8, 2023
2 parents eaa7607 + 2283675 commit dccb0f2
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 43 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Depends: R (>= 3.5)
Imports:
admiral (>= 0.11.0),
admiral (>= 0.12.0),
admiraldev (>= 0.4.0),
dplyr (>= 0.8.4),
lifecycle (>= 0.1.0),
Expand All @@ -54,7 +54,6 @@ Imports:
tidyselect (>= 1.0.0)
Suggests:
pharmaversesdtm,
admiral.test,
devtools,
diffdf,
lintr,
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
RECIST 1.1, e.g., iRECIST or International Myeloma Working Group (IMWG)
criteria for the diagnosis of multiple myeloma.

- The `ADRS` vignette and template were updated such that test data from
`{pharmaversesdtm}` instead of `{admiral.test}` is used. (#226)

- The "Create `ADTR`" vignette and the `ADTR` template were updated such that
test data from `{pharmaversesdtm}` instead of `{admiral.test}` is used. (#247)

- The confirmed response derivation was fixed in the basic `ADRS` vignette and
template. When calling `derive_param_confirmed_resp()` the `filter_source`
argument has to be set to `PARAMCD == "OVR" & ANL01FL == "Y"` instead of
Expand Down
29 changes: 18 additions & 11 deletions inst/templates/ad_adtr.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Input: adsl, rs, tr, tu
library(admiral)
library(admiralonco)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)
library(stringr)
Expand All @@ -14,16 +14,15 @@ library(stringr)

# Use e.g. haven::read_sas to read in .sas7bdat, or other suitable functions
# as needed and assign to the variables below.
# For illustration purposes read in admiral test data
# For illustration purposes read in pharmaverse test data
data("admiral_adsl")
data("admiral_rs")
data("admiral_tu")
data("admiral_tr")
data("rs_onco_recist")
data("tu_onco_recist")
data("tr_onco_recist")
adsl <- admiral_adsl
adrs <- admiral_adrs
tu <- admiral_tu
tr <- admiral_tr
rs <- admiral_rs
tu <- tu_onco_recist
tr <- tr_onco_recist
rs <- rs_onco_recist

tu <- convert_blanks_to_na(tu) %>%
filter(TUEVAL == "INVESTIGATOR")
Expand Down Expand Up @@ -77,8 +76,16 @@ tr <- derive_vars_dt(
source_vars = exprs(ADT)
) %>%
mutate(
AVISIT = VISIT,
AVISITN = VISITNUM
AVISIT = if_else(
VISIT == "SCREENING",
"BASELINE",
VISIT
),
AVISITN = if_else(
AVISIT == "BASELINE",
0,
VISITNUM
)
)

# Derive parameters for lesion diameters (LDIAMn & NLDIAMn) ----
Expand Down
1 change: 0 additions & 1 deletion inst/templates/ad_adtte.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Input: adsl, adrs, tte_source objects
library(admiral)
library(admiralonco)
library(admiral.test) # Contains example datasets from the CDISC pilot project
library(dplyr)
library(lubridate)

Expand Down
2 changes: 0 additions & 2 deletions staged_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
upstream_repos:
- repo: pharmaverse/admiral
host: https://github.com
- repo: pharmaverse/admiral.test
host: https://github.com
- repo: pharmaverse/pharmaversesdtm
host: https://github.com
- repo: pharmaverse/admiraldev
Expand Down
2 changes: 1 addition & 1 deletion vignettes/adrs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ read into the environment. This will be a company specific process. Some
of the data frames needed may be `ADSL`, `RS` and `TU`.

For example purpose, the SDTM and ADaM datasets (based on CDISC Pilot
test data)---which are included in `{admiral.test}`---are used.
test data)---which are included in `{pharmaversesdtm}`---are used.

```{r message=FALSE}
library(admiral)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/adrs_basic.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ read into the environment. This will be a company specific process. Some
of the data frames needed may be `ADSL`, `RS` and `TU`.

For example purpose, the SDTM and ADaM datasets (based on CDISC Pilot
test data)---which are included in `{admiral.test}`---are used.
test data)---which are included in `{pharmaversesdtm}`---are used.

```{r message=FALSE}
library(admiral)
Expand Down
41 changes: 18 additions & 23 deletions vignettes/adtr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The examples of this vignette require the following packages.
```{r, warning=FALSE, message=FALSE}
library(admiral)
library(dplyr)
library(admiral.test)
library(pharmaversesdtm)
library(lubridate)
library(stringr)
library(admiralonco)
Expand All @@ -104,14 +104,11 @@ To start, all data frames needed for the creation of `ADTR` should be read into
Some of the data frames needed may be `ADSL`, `ADRS` ,`RS`, `TU`, `TR`, `SUPPTU` `SUPPTR`.

For example purposes, the SDTM and ADaM datasets (based on CDISC Pilot test
data)---which are included in `{admiral.test}`---are used [^1]. Also, see
data)---which are included in `{pharmaversesdtm}`---are used. Also, see
[Handling of Missing
Values](https://pharmaverse.github.io/admiral/cran-release/articles/admiral.html#handling-of-missing-values)
explains why we need to use the `convert_blanks_to_na()` function.

[^1]: In this vignette we use only data for subjects "01-701-1015",
"01-701-1023", "01-701-1440". This avoids that the vignette takes a long time to load.

On the `TR` domain we filter on where tumor assessment short name `TRTESTCD` is
`"LDIAM"` or `"LPERP"`. Depending on your data collection standards you may need
to update the code to filter on `TRTESTCD == "DIAMETER"`. If this is the case
Expand All @@ -121,14 +118,14 @@ be updated accordingly.
```{r}
data("admiral_adsl")
data("admiral_adrs")
data("admiral_rs")
data("admiral_tu")
data("admiral_tr")
data("rs_onco_recist")
data("tu_onco_recist")
data("tr_onco_recist")
adsl <- admiral_adsl
adrs <- admiral_adrs
tu <- admiral_tu
tr <- admiral_tr
rs <- admiral_rs
tu <- tu_onco_recist
tr <- tr_onco_recist
rs <- rs_onco_recist
tu <- convert_blanks_to_na(tu) %>%
filter(TUEVAL == "INVESTIGATOR")
Expand All @@ -139,16 +136,6 @@ tr <- convert_blanks_to_na(tr) %>%
rs <- convert_blanks_to_na(rs)
```

```{r echo=FALSE}
subjects <- c("01-701-1015", "01-701-1023", "01-701-1440")
# exclude assessments after PD
tr <- filter(tr, USUBJID %in% subjects & (USUBJID != "01-701-1440" | VISITNUM <= 7))
tu <- filter(tu, USUBJID %in% subjects)
rs <- filter(rs, USUBJID %in% subjects)
adsl <- filter(adsl, USUBJID %in% subjects)
adrs <- filter(adrs, USUBJID %in% subjects)
```

At this step, it may be useful to join `ADSL` to your `TR` domain. For efficiency, only the `ADSL` variables (in this example, Randomization date (`RANDDT`) used for derivations are selected at this step. The rest of the relevant `ADSL` variables would be added later.

```{r eval=TRUE}
Expand Down Expand Up @@ -243,8 +230,16 @@ uniquely in your SDTM. However, if this is not the case and your grouping lesio
```{r}
tr <- mutate(
tr,
AVISIT = VISIT,
AVISITN = VISITNUM
AVISIT = if_else(
VISIT == "SCREENING",
"BASELINE",
VISIT
),
AVISITN = if_else(
AVISIT == "BASELINE",
0,
VISITNUM
)
)
```

Expand Down
1 change: 0 additions & 1 deletion vignettes/adtte.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ The examples of this vignette require the following packages.
library(admiral)
library(admiralonco)
library(dplyr)
library(admiral.test)
library(lubridate)
```

Expand Down
1 change: 0 additions & 1 deletion vignettes/nactdt.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ For example purpose, `CM` and `PR` has been generated (based on CDISC Pilot test
```{r, warning=FALSE, message=FALSE}
library(admiral)
library(dplyr)
library(admiral.test)
adsl <- admiral_adsl
Expand Down

0 comments on commit dccb0f2

Please sign in to comment.