Creating a Neuro ADLB ADaM

Introduction

This article describes creating a laboratory ADaM for neuroscience clinical trials.

We advise you first consult the {admiral} Creating a BDS Finding ADaM vignette. The programming workflow around creating the general set-up of an ADLB using {admiral} functions is the same. In this vignette, we focus on common ADLB derivations in neuroscience studies and avoid repeating information and maintaining the same content in two places.

Note: All examples assume CDISC SDTM and/or ADaM format as input unless otherwise specified.

Required Packages

The following packages are required to run the examples in this vignette.

library(admiral)
library(admiralneuro)
library(pharmaversesdtm)
library(dplyr)
library(stringr)

Programming Workflow

Read in Data

To start, all data frames needed for the creation of the ADaM dataset should be loaded into the global environment. Reading data will usually be a company specific process, however, for the purpose of this vignette, we will use example data from {pharmaversesdtm} and {admiralneuro}. We will utilize LB and ADSL data.

lb <- convert_blanks_to_na(pharmaversesdtm::lb_neuro)
adsl <- convert_blanks_to_na(admiralneuro::adsl_neuro)

Define Lookup Tables

Define parameter lookup table used to derive PARAMCD, PARAM, and PARAMN variables.

# Assign PARAMCD, PARAM, and PARAMN
param_lookup <- tibble::tribble(
  ~LBTESTCD, ~PARAMCD, ~PARAM, ~PARAMN,
  "PTAU217", "PTAU217", "Lumipulse G pTau 217 Plasma (pg/mL)", 1,
  "AMYLB42", "AMYLB42", "Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL)", 2,
  "PTAB42R", "PTAB42R", "Lumipulse G pTau 217/Beta-Amyloid 1-42 Plasma Ratio", 3,
  "ASYNASAA", "ASYNASAA", "Alpha Synuclein Seed Amplification Assay (CSF)", 4,
  "TAU181P", "TAU181P", "Elecsys Tau Protein Phosphorylated 181", 5
)

Derive Core ADLB Variables

The basic parameters and timing variables can be derived similarly to other BDS finding ADaMs. For the derivation of analysis values, various variable types and significant figures need to be considered.

# Get list of ADSL vars required for derivations
adsl_vars <- exprs(TRTSDT, TRTEDT, TRT01A, TRT01P)

adlb <- lb %>%
  # Join ADSL with LB data (need TRTSDT for ADY derivation) ----
  derive_vars_merged(
    dataset_add = adsl,
    new_vars = adsl_vars,
    by_vars = get_admiral_option("subject_keys")
  )

adlb <- adlb %>%
  # Add PARAMCD, PARAM and PARAMN ----
  derive_vars_merged_lookup(
    dataset_add = param_lookup,
    new_vars = exprs(PARAMCD, PARAM, PARAMN),
    by_vars = exprs(LBTESTCD)
  )

# Add analysis date (ADT)
adlb <- adlb %>%
  derive_vars_dt(new_vars_prefix = "A", dtc = LBDTC) %>%
  derive_vars_dy(reference_date = TRTSDT, source_vars = exprs(ADT))

# Derive analysis visit (AVISIT, AVISITN)
adlb <- adlb %>%
  mutate(
    AVISIT = case_when(
      !is.na(VISIT) ~ str_to_title(VISIT),
      TRUE ~ NA_character_
    ),
    AVISITN = case_when(
      AVISIT == "Baseline" ~ 0,
      str_detect(str_to_upper(VISIT), "WEEK") ~
        as.integer(str_extract(VISIT, "\\d+")),
      TRUE ~ NA_integer_
    ),
    BASETYPE = "LAST"
  )

# Derive AVAL and AVALC
adlb <- adlb %>%
  mutate(
    LBSTRESN2 = case_when(
      PARAMN == 1 ~ round(LBSTRESN, 4),
      PARAMN == 2 ~ round(LBSTRESN, 1),
      PARAMN == 3 ~ round(LBSTRESN, 5),
      PARAMN == 4 ~ LBSTRESN,
      PARAMN == 5 ~ round(LBSTRESN, 3),
      TRUE ~ NA
    ),
    AVAL = LBSTRESN,
    # Only populate AVALC if the character value is non-redundant with AVAL,
    # following standard ADaM conventions.
    AVALC = if_else(
      is.na(AVAL) | as.character(signif(LBSTRESN2, 5)) != LBSTRESC,
      LBSTRESC,
      NA_character_
    ),
    ANRLO = LBSTNRLO,
    ANRHI = LBSTNRHI
  ) %>%
  select(!LBSTRESN2)
STUDYID USUBJID PARAMCD PARAM AVAL ADY AVISIT AVISITN
CDISCPILOT01 01-701-1015 ASYNASAA Alpha Synuclein Seed Amplification Assay (CSF) 1.0000000 -4 Baseline 0
CDISCPILOT01 01-701-1015 PTAU217 Lumipulse G pTau 217 Plasma (pg/mL) 8.2373431 1 Baseline 0
CDISCPILOT01 01-701-1015 AMYLB42 Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 1120.3107546 1 Baseline 0
CDISCPILOT01 01-701-1015 PTAB42R Lumipulse G pTau 217/Beta-Amyloid 1-42 Plasma Ratio 0.0073527 1 Baseline 0
CDISCPILOT01 01-701-1015 TAU181P Elecsys Tau Protein Phosphorylated 181 3.9634887 1 Baseline 0
CDISCPILOT01 01-701-1015 PTAU217 Lumipulse G pTau 217 Plasma (pg/mL) 6.0847536 84 Week 12 12
CDISCPILOT01 01-701-1015 AMYLB42 Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 730.6674011 84 Week 12 12
CDISCPILOT01 01-701-1015 PTAB42R Lumipulse G pTau 217/Beta-Amyloid 1-42 Plasma Ratio 0.0083277 84 Week 12 12
CDISCPILOT01 01-701-1015 TAU181P Elecsys Tau Protein Phosphorylated 181 1.6151086 84 Week 12 12
CDISCPILOT01 01-701-1015 PTAU217 Lumipulse G pTau 217 Plasma (pg/mL) 1.0141736 182 Week 26 26

For deriving visits based on time-windows, see {admiral} Visit and Period Variables.

Derive Log Transformation of Biomarkers

In addition to the core ADLB variables, log transformation of fluid biomarker values is essential for further analyses and graphing as these values are typically skewed.

# Derive log-transformed AMYLB42 parameter for further analyses and plotting
adlb <- adlb %>%
  derive_param_computed(
    by_vars = exprs(
      !!!get_admiral_option("subject_keys"), AVISIT, AVISITN,
      ADT, ADY, !!!adsl_vars
    ),
    parameters = "AMYLB42",
    set_values_to = exprs(
      AVAL = log(AVAL.AMYLB42),
      PARAMCD = "LAMYLB42",
      PARAM = "Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL)",
      PARAMN = 6
    )
  )
STUDYID USUBJID PARAMCD PARAM AVAL ADY AVISIT AVISITN
CDISCPILOT01 01-701-1015 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 7.021361 1 Baseline 0
CDISCPILOT01 01-701-1015 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 6.593958 84 Week 12 12
CDISCPILOT01 01-701-1015 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 5.549706 182 Week 26 26
CDISCPILOT01 01-701-1023 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 6.257612 1 Baseline 0
CDISCPILOT01 01-701-1028 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 6.157161 NA Baseline 0
CDISCPILOT01 01-701-1028 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 6.549071 NA Week 12 12
CDISCPILOT01 01-701-1028 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 6.730043 NA Week 26 26
CDISCPILOT01 01-701-1034 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 6.254860 1 Baseline 0
CDISCPILOT01 01-701-1034 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 6.291713 87 Week 12 12
CDISCPILOT01 01-701-1034 LAMYLB42 Log-Transformed Lumipulse G Beta-Amyloid 1-42-N Plasma (pg/mL) 5.980264 183 Week 26 26

Remaining ADLB Set-up

The {admiral} Creating a BDS Finding ADaM vignette describes the remaining standard ADLB derivations, including how to calculate baseline and change from baseline variables, add analysis flags (e.g., ANL01FL), handle reference ranges, categorizations, and other common ADLB requirements.

Example Script

ADaM Sourcing Command
ADLB admiral::use_ad_template("ADLB", package = "admiralneuro")