Interactive Forest Plot

Interactive forest plot for clinical trial safety analysis using 'metalite', 'reactable', 'plotly', and Analysis Data Model (ADaM) datasets. Includes functionality for adverse event filtering, incidence-based group filtering, hover-over reveals, and search and sort operations. The workflow allows for metadata construction, data preparation, output formatting, and interactive plot generation.


forestly

R-CMD-check Codecov test coverage CRAN status CRAN Downloads

Installation

The easiest way to get forestly is to install from CRAN:

install.packages("forestly")

Alternatively, to use a new feature or get a bug fix, you can install the development version of forestly from GitHub:

# install.packages("remotes")
remotes::install_github("Merck/forestly")

Overview

The forestly package creates interactive forest plots for clinical trial analysis & reporting.

  • Safety analysis
    • Specific adverse events analysis
  • Efficacy analysis (future work)
    • Subgroup analysis

We assume ADaM datasets are ready for analysis and leverage metalite data structure to define inputs and outputs.

Workflow

The general workflow is:

  1. Define input metadata from ADaM datasets with metalite.
  2. prepare_ae_forestly() prepares datasets for interactive forest plot.
  3. format_ae_forestly() formats output layout.
  4. ae_forestly() generates an interactive forest plot.

Here is a quick example

library("forestly")

adsl <- forestly_adsl
adae <- forestly_adae
adsl$TRTA <- factor(
  adsl$TRT01A,
  levels = c("Xanomeline Low Dose", "Placebo"),
  labels = c("Low Dose", "Placebo")
)
adae$TRTA <- factor(
  adae$TRTA,
  levels = c("Xanomeline Low Dose", "Placebo"),
  labels = c("Low Dose", "Placebo")
)

analysis_plan <- metalite::plan(
  analysis = "ae_forestly",
  population = "apat",
  observation = "wk12",
  parameter = "any;rel;ser"
)

meta <- metalite::meta_adam(population = adsl, observation = adae) |>
  metalite::define_plan(plan = analysis_plan) |>
  metalite::define_population(
    name = "apat",
    var = c("USUBJID", "SAFFL", "TRTA", "SITEID", "SEX", "RACE", "AGE"),
    group = "TRTA",
    subset = SAFFL == "Y",
    label = "All Participants as Treated"
  ) |>
  metalite::define_observation(
    name = "wk12",
    var = c(
      "USUBJID", "SAFFL", "TRTA", "SITEID", "SEX", "RACE", "AGE",
      "ASTDY", "AEDECOD", "AEBODSYS", "AESER", "AEREL", "AEACN",
      "AEOUT", "ADURN", "ADURU"
    ),
    group = "TRTA",
    subset = SAFFL == "Y",
    label = "Weeks 0 to 12"
  ) |>
  metalite::define_parameter(
    name = "any",
    term1 = "",
    term2 = "",
    var = "AEDECOD",
    soc = "AEBODSYS",
    label = "All AEs"
  ) |>
  metalite::define_parameter(
    name = "rel",
    term1 = "Drug-Related",
    term2 = "",
    subset = AEREL %in% c("POSSIBLE", "PROBABLE"),
    var = "AEDECOD",
    soc = "AEBODSYS",
    label = "Drug-related AEs"
  ) |>
  metalite::define_parameter(
    name = "ser",
    term1 = "Serious",
    term2 = "",
    subset = AESER == "Y",
    var = "AEDECOD",
    soc = "AEBODSYS",
    label = "Serious AEs"
  ) |>
  metalite::define_analysis(
    name = "ae_forestly",
    label = "Interactive forest plot"
  ) |>
  metalite::meta_build()

meta |>
  prepare_ae_forestly(parameter = "any;rel;ser") |>
  format_ae_forestly() |>
  ae_forestly()

Interactive features

The interactive features for safety analysis include:

  • Select different AE criteria.
  • Filter by incidence of AE in one or more groups.
  • Reveal information by hovering the mouse over a data point.
  • Search bars to find subjects with selected adverse events (AEs).
  • Sort value by clicking the column header.
  • Drill-down listing by clicking $\blacktriangleright$.

References

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("forestly")

0.1.6 by Yujie Zhao, 2 months ago


https://merck.github.io/forestly/, https://github.com/Merck/forestly


Report a bug at https://github.com/Merck/forestly/issues


Browse source code at https://github.com/cran/forestly


Authors: Yilong Zhang [aut] , Benjamin Wang [aut] , Yujie Zhao [aut, cre] , Nan Xiao [ctb] , Hiroaki Fukuda [aut] , Yulia Sidi [ctb] , Xuan Deng [ctb] , Jeetener Chauhan [ctb] , Li Ma [ctb] , Chen Wang [ctb] , Madhusudhan Ginnaram [ctb] , Merck & Co. , Inc. , Rahway , NJ , USA and its affiliates [cph]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports brew, crosstalk, glue, htmltools, metalite, metalite.ae, reactable, reactR, ggplot2, uuid

Suggests covr, dplyr, knitr, r2rtf, rmarkdown, patchwork, testthat


Suggested by metalite.ae.


See at CRAN