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.

Assumptions

  • Basic knowledge of CDISC Standards (ADaM and SDTM Domains)
  • Basic background in R and its packages
  • Basic familiarity with RStudio IDE (So much Pane!!)
  • %>% chaining functions together
  • Dual Screens - Workshop and β€œCoding along”
  • 🦺 But even lacking all this we still think you will gain some good knowledge! 🦺

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 workshop’s objectives!

  • 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 to β€œcode”

  • Preferred:
    • Sign up for a free Posit Account
    • Share Link for R/Pharma: ADaM Workshop
      • Everything loaded (data, packages, specs) and ready to go!
  • Quick and Dirty
    • Grab files from Repo
    • Files are in exercises, metadata and solutions folders
  • Advanced:
    • Clone Repo and set up yourself
  • Sit back and Relax
    • πŸ–οΈπŸ–οΈπŸ·πŸ·

How we will β€œcode” today

  • Fanny and I will walk you through coding ADSL and ADVS
    • Lite Discussion on each function and function arguments
    • A few fill in the blanks!
    • Occasional Check-in Poll
  • Important to move along quickly
    • Please post questions to chat
    • Full scripts are available in solutions folder

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!

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 and variable 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
  • Correct Answer: a) 15 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()
  • Correct Answer: c) source()

Check-in 4

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

  1. 15
  2. 4
  3. 8
  4. 10
  • Correct Answer: c) 8

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 admiral function could be used to compute the Analysis Sequence Number (Numbering the Observations Within Each Group)?

Questions and Resources

Closing Thoughts

  • We were only able to show a small number of pharmaverse packages and functions 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.3.3 (2024-02-29 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=English_United Kingdom.utf8 
[2] LC_CTYPE=English_United Kingdom.utf8   
[3] LC_MONETARY=English_United Kingdom.utf8
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.utf8    

time zone: America/New_York
tzcode source: internal

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.8.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.1    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.1     
[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.3.3      
[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.48         tibble_3.2.1     
[49] tidyselect_1.2.1  rstudioapi_0.17.0 knitr_1.48        htmltools_0.5.8.1
[53] rmarkdown_2.28    readr_2.1.5       compiler_4.3.3    downlit_0.4.4    
[57] readxl_1.4.3     

R/Pharma ADaM Workshop Starting at 10:02 US EST