R/Pharma ADaM Workshop

Fanny Gautier Cytel
Ben Straub GSK
Edoardo Mancini Roche
Sadchla Mascary Gilead

Friday, October 25, 2024

Objectives

  • By the end of this workshop you will have:
    • Updated code for ADaMs ADSL and ADVS using pharmaverse packages, tidyverse packages, base R and Pinnacle21-like specs.
    • Gained an understanding of how to use pharmaverse packages
    • Gained an understanding of how to use resources for building ADaMs in R.

Play by Play

  • πŸ•™10:05 - 10:15 Introductions and Setup

  • πŸ•™10:15 - 10:30 Overview of pharmaverse packages and functions

  • πŸ•₯10:30 - 11:20 ADSL

  • πŸ•š11:20 - 11:30 Break

  • πŸ•¦11:30 - 12:30 ADVS

  • πŸ•12:30 - 1:00 Questions and Resources

Introductions and Setup

πŸ•™10:05 - 10:15

Who will help you achieve the objective!

  • Fanny Gautier - presenting on ADVS πŸ“£
  • Ben Straub - presenting on ADSL and pharmaverse packages πŸ“£
  • Edoardo Mancini - Chat Support πŸ’»
  • Sadchla Mascary - Chat Support πŸ’»

Setting up your Workspace

  • Preferred:

    • Sign up for a free Posit Account

    • Share Link for R/Pharma: ADaM Workshop

      • Everything loaded (data, packages, specs) and ready to go!
  • Advanced:

    • Clone Repo and set up yourself

How we will β€œcode” today

  • Fanny and I will walk you through coding ADSL and ADVS
    • Lite Discussion on each function
    • Fill in the blank!
    • Occasional Zoom Poll
  • Important to move along quickly
    • Please post questions to chat
    • Full scripts are available

Overview of pharmaverse packages and functions

πŸ•₯10:15 - 10:30

The core pharmaverse packages

  • metacore
  • metatools
  • xportr
  • admiral

The core tidyverse packages

  • dplyr
  • stringr
  • haven
  • lubridate

Hello pharmaverse Functions!

Hello pharmaverse Functions!

Package Function Purpose
admiral derive_vars_merged() left_join on steroids
admiral derive_param_computed() Core function for wrappers used in ADVS
admiral convert_blanks_to_na() SAS blanks versus R NAs
admiral derive_vars_dtm() Take a ---DTC variable and turn it into a ---DTM variable
admiral derive_vars_duration() Duration between timepoints
admiral derive_vars_extreme_event() 🀯

Hello pharmaverse Functions!

Package Function Purpose
metatools combine_supp() Join Parent and Supplementary Datasets
metatools create_var_from_codelist() Numeric Vars from Specs!
metatools drop_unspec_vars() Easily drop variables not in Spec
xportr xportr_label() Apply labels from Spec
xportr xportr_write() Write out an xpt file

Hello Specs!

  • Pinnacle21-like Specs

  • Not fit for purpose - just a helpful guide

  • What is in the the Specs:

    • Two datasets, dataset labels, Keys

    • Variables - labels, lengths, types, linked to method

    • Codelists!!

    • No VLMs

ADSL

πŸ•₯10:30 - 11:20

ADSL Quizzes

Check-in 1

Which admiral function can be used to turn a ---DTC variable into a ---DTM variable

  1. derive_vars_dtc()
  2. derive_var_trtdurd()
  3. derive_vars_dtm()
  4. derive_vars_exsdtc()

Correct Answer: c) derive_vars_dtm()

Check-in 2

How many arguments does derive_vars_merged() have?

Hint: Go to the documentation ?fcn_name or F1

  1. 15 arguments
  2. 4 argruments
  3. 1 argrument
  4. 10 arguments

Check-in 3

Which function did I use to load the adams_little_helpers.R?

  1. load_all()
  2. install.functions()
  3. source()
  4. callr()

Check-in 4

How many packages did I load using library() to create ADSL today?

  1. 15
  2. 4
  3. 6
  4. 10

Break

πŸ•¦11:20 - 11:30

ADVS

πŸ•¦11:30 - 12:30

ADVS Quizzes

Check-in 1

Have a look to admiraldiscovery: Which admiral function could be used to derive β€œBMI” parameter at any time point?

Check-in 2

Have a look to admiraldiscovery: Which admiral wrapper function could be used to derive β€œBSA” parameter at any time point?

Check-in 3

With the help of admiraldiscovery: Which admiral function could be used to derive ONTRTFL variable?

Check-in 4

Execute the derivation of PCHG on a subset of the input dataset: Post-baseline records only. Which admiral functions will you use ? Get some hints on the Reference page

Check-in 5

With the help of the Reference page: which function could be used to compute the Analysis Sequence (Numbering the Observations Within Each Group)?

Questions and Resources

Closing Thoughts

  • We were only able to show a small number of pharmaverse packages today, but please delve deeper to explore the full breadth
  • If you’d like to contribute to pharmaverse, check out options at pharmaverse.org
  • Finally, be sure to join our community on Slack!

Pacakges and Session Information

R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so;  LAPACK version 3.9.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] link_2024.4.0   countdown_0.4.0 glue_1.7.0     

loaded via a namespace (and not attached):
 [1] rappdirs_0.3.3    sass_0.4.9        utf8_1.2.4        generics_0.1.3   
 [5] tidyr_1.3.1       xml2_1.3.6        stringi_1.8.4     hms_1.1.3        
 [9] digest_0.6.37     magrittr_2.0.3    evaluate_1.0.0    timechange_0.3.0 
[13] fastmap_1.2.0     cellranger_1.1.0  jsonlite_1.8.9    backports_1.5.0  
[17] admiraldev_1.1.0  purrr_1.0.2       fansi_1.0.6       xportr_0.4.0     
[21] httr2_1.0.5       jquerylib_0.1.4   cli_3.6.3         rlang_1.1.4      
[25] withr_3.0.1       cachem_1.1.0      yaml_2.3.10       tools_4.4.1      
[29] tzdb_0.4.0        memoise_2.0.1     checkmate_2.3.2   dplyr_1.1.4      
[33] forcats_1.0.0     curl_5.2.3        vctrs_0.6.5       R6_2.5.1         
[37] lifecycle_1.0.4   metacore_0.1.3    lubridate_1.9.3   stringr_1.5.1    
[41] pkgconfig_2.0.3   admiral_1.1.1     pillar_1.9.0      bslib_0.8.0      
[45] metatools_0.1.6   haven_2.5.4       xfun_0.47         tibble_3.2.1     
[49] tidyselect_1.2.1  rstudioapi_0.16.0 knitr_1.48        htmltools_0.5.8.1
[53] rmarkdown_2.28    readr_2.1.5       compiler_4.4.1    downlit_0.4.4    
[57] readxl_1.4.3