R-Guru Smile design: how to one in SIlhouette Studio ยป Smart Silhouette Resource Hub

D. Pharmaverse: Regulatory Submission Process Flow - Bookmark This Page!

Metadata > OAK > Admiral > Define.xml > TLGs (rtf/pdf) > Submissions > Shiny

 R Package

 

Metadata


Raw to SDTMs

To ADaMs 

(Create Random ADaMs)

To Tables, Lists and Graphs 
 

R Scripts

(Tidyverse, DPLYR, etc.)

 N/A R Scripts  R Scripts 

R Scripts: Statistical Analysis

Tables & Lists, Graphs 

R Markdown

R Shiny

 

Pharmaverse

Blog

Metacore 

[ExamplesStructureFunctions]

Metatools

OAK [PresentationGithub]

SDTMChecks

[Example, FunctionsVideo 1, Video 2Github]

ADMIRAL 

[VideoStepsGithub]

rTables [TLGs

Tpylr


The pharmaceutical industy has quickly adapted to embrace R!  The Pharmaverse concept is created as a collaboration amoung top pharma and industy organizatins for open-source solutions.  Organizations now have the option to continue programming in R using common packages or use the packages from Pharmaverse to get a jump start.  With Pharmaverse R package compliance standards, organizations can feel more confident to apply these packages.  Smarter organizations make time to confirm packages behave as expected with expected results.  Up to 50% of Pharmaverse is built using Tidyverse.  This page is designed to help guide you using Pharmaverse packages.

Pharmaverse has R packages that work as modules to help in the CDISC submission process.  Organizations can plan to understand and start to incoporate R packages as needed to grow.  See new to clinical data and new to CDISC to learn about the basics.  Note that the SDTMs and ADaMs pages within R-Guru utilize base R and other non-Pharmaverse packages. 

Pharmaverse Common FAQs - Your Guide to Leveraging Pharmaverse Packages
  • Where do you start? What is your task/objective?
    • As pharmaverse continues to grow, there are packages for the full clinical trial workflow process:
    • Metadata > OAK > Admiral > Define.xml > TLGs (rtf/pdf) > Submissions > Shiny
  • Who are the key players?
    • Pharma industry leaders setting ‘new standards in R and submissions’ since they are key developers of pharmaverse packages
    • Genentech, GSK, Merk, J&J
    • CDISC
    • PHUSE, Atorus, Appsilon, ProCogia
  • Do you have to use all of the pharmaverse packages?
    • No, organizations can choose and priority packages to test and install
    • Organizations can continue to use tidyverse and dplyr for in-house developed R scripts
  • How different are pharmaverse packages to tidyverse?
    • Pharmaverse packages are built from up to 50% of tidyverse packages so can easily learn pharmaverse packages
  • What methods can I learn and apply pharmaverse packages?
    • R-Guru.com/pharma is a designed for the collecdtion and curation of:
    • Videos
    • Examples
    • Case Studies
    • Documentation
  • What about pharmaverse shiny apps?
  • Why should i use pharmaverse packages?
    • Organizations can save development time, money and SMEs
  • Are there risks in using pharmaverse packages?
    • Yes, organizations are responsible for their own risk management
    • Pharmaverse packages undergo rigorous tests to help assure robust and reliable results





  • # Metadata functions: is.character(), is.numeric, is.Date(), contents(), names(), rename(), label(), contains(), starts_with(), ends_with(), nchar(), mode()

  • print(contents(df), maxlevels=10, levelType='table') # requires hmisc package

  • names(adsl) <- tolower(names(adsl)) # lower case all variable names, toupper()

  • df <- df %>% rename(vr_new = vr_old) # rename variables

  • label(df$vr1) <- 'My Label' # assign variable labels
  • label(df[["vr1"]]) <- "My Label" # data frame options method

  • attr(data[["age"]], "label")  attr function to assign labels

  • df2 <- df1 %>% select(-contains('vr1')) # drop variables names that contain vr1

  • df <- select (vr1, vr10:vr15, starts_with("L")) # select vr1, vr10 to vr15 variables by order and variables that start with L, ends_with() 

  • intersect(names(df1), names(df2)) # list common variables between df1 and df2


  • setdiff(names(df1), names(df2)) # list of df1 unique variables that are not in df2

  • nms <- c(names(df1), names(df2)) # list of unique variable names from two or more data frames to compare
  • nms[duplicated(nms)] 

  • dt1 <- as.Date("2021/01/25")

  • log1 <- TRUE
  • mode(2) # numeric variable
  • mode('a') # character variable
  • mode(dt1) # numeric date variable
  • mode(log1) # logical variable

      • # SAS vs R Checking SDTM Compliance
      • # create exposure data
      • exposure <- data.frame(
      • USUBJID = c("1001", "1002", "1003", "1004"),
      • EXTRT = c("TreatmentA", "TreatmentB", "TreatmentA", "TreatmentC"),
      • EXDOSE = c(50, 100, 75, 25),
      • EXDOSU = c("mg", "mg", "mg", "IU"),
      • EXROUTE = c("Oral", "IV", "Topical", "Nasal"),
      • EXSTART = as.Date(c("2024-01-01", "2024-01-05", "2024-01-10", "2024-01-15")),
      • EXENDTC = as.POSIXct(c("2024-01-01 12:00:00", "2024-01-05 10:30:00", NA, "2024-01-15 12:30:00")),
      • EXDUR = c(2, 2, NA, 3),
      • EXDURU = c("days", "hours", NA, "hours"),
      • EXSTAT = c("Ongoing", "Completed", "Discontinued", "Ongoing")
      • )
      • # EX vars
      • ex_vars <- c("USUBJID", "EXTRT", "EXDOSE", "EXDOSU", "EXROUTE", "EXSTART", "EXENDTC", "EXDUR", "EXDURU", "EXSTAT")

      • # error counter variable
      • error_count <- 0

      • for (var in names(exposure)) {  # loop over all ex variable names
      • if (!(var %in% ex_vars)) { # check each ex var with list of ex_vars
      • cat("Error: Variable", var, "does not comply with SDTM EX naming standards.\n")
      • error_count <- error_count + 1
      • }
      • if (nchar(var) > 8) { # check each ex var for name length > 8
      • cat("Error: Variable", var, "length exceeds SDTM EX naming standards.\n")
      • error_count <- error_count + 1
      • }
      • }
      • if (error_count == 0) { # message for no or any errors
      • cat("All variables comply with SDTM EX naming standards.\n")
      • } else {
      • cat("Errors found in variable names in the data.\n")
      • }