DaVinci
  • Getting Started
  • Module Gallery
    • Source code
    • Report a Bug

Getting Started

How to get started with DaVinci?

Environment setup and package installation

Environment setup

Please ensure that R version 4.0.0 or higher is installed on your computer. This is required to install all DaVinci packages and their dependencies. To check your current version of R, execute sessionInfo() within the R console.

Installing the DaVinci packages

More information on the modules and the corresponding package can be found here or in each individual package documentation.

To install all DaVinci packages, run the following lines of code:

if (!require("remotes")) install.packages("remotes")
davinci_packages <- c(
  "dv.loader", 
  "dv.manager",
  "dv.bookman", 
  "dv.clinlines", 
  "dv.edish", 
  "dv.explorer.parameter", 
  "dv.listings",
  "dv.papo",
  "dv.tables",
  "dv.teal"
)

for (pkg in davinci_packages) {
  remotes::install_github(paste0("Boehringer-Ingelheim/", pkg), upgrade = TRUE)
}

You can also speed up the installation by using {pak} for installing the packages.

How to set up your first App

In this section, the app creation process will be explained by means of a simple, executable example.

The app creation process can be split into 4 steps.
1. Loading the data
2. Preparing the data
3. Setting up the modules
4. Launching the app

1. Loading the data

First of all we need some data for the app. You can use the functionalities of {dv.loader} to load data from a filesystem.

data_list <- dv.loader::load_data(
  sub_dir = , # TODO: add path to your data
  file_names = c("dm", "ae", "lb")
)

To have a running example we will use data from the {pharamversesdtm} package.

if (!require("pharmaversesdtm")) install.packages("pharmaversesdtm")

data_list <- list(
  dm = pharmaversesdtm::dm,
  ae = pharmaversesdtm::ae,
  lb = pharmaversesdtm::lb
)

2. Preparing the data

In order to be able to use the data together with the DaVinci modules some pre-processing is needed. The modules themselves minimally handle data provisioning and derivations to ensure maximal flexibility. This assures compatibility with almost all data sources like SDTM or ADaM.

# Convert data to appropriate types
data_list[["dm"]] <- dv.listings::convert_data(data_list[["dm"]])
data_list[["ae"]] <- dv.listings::convert_data(data_list[["ae"]])
data_list[["lb"]] <- dv.listings::convert_data(data_list[["lb"]])

# Assign meaningful labels to data domain names
attributes(data_list$dm)$label <- "Subject Level"
attributes(data_list$ae)$label <- "Adverse Events"
attributes(data_list$lb)$label <- "Laboratory data"

3. Setting up the modules

# Specify default variables
default_vars <- list(
  dm = c("STUDYID", "USUBJID", "SITEID", "ARM"),
  ae = c("STUDYID", "USUBJID", "AESOC", "AETERM", "AESTDY", "AEENDY", "AESER"),
  lb = c("STUDYID", "USUBJID", "LBTEST", "LBORRES")
)

# Module list
module_list <- list(
  "Listings" = dv.listings::mod_listings(
    module_id = "mod1",
    dataset_names = c("dm", "ae", "lb"),
    default_vars = default_vars
  )
)

You can add additional modules to the app by including them into the module_list. Lets add the eDISH module as well.

module_list[["edish"]] <- dv.edish::mod_edish(
    module_id = "edish",
    dataset_names = c("dm", "lb"),
    arm_default_vals = c("Xanomeline Low Dose", "Xanomeline High Dose"),
    baseline_visit_val = "SCREENING 1"
  )

4. Launching the app

In this step you combine everything and launch the app.
You can found more information on run_app() here

dv.manager::run_app(
  data = list("MyData" = data_list),
  module_list = module_list,
  filter_data = "dm"
)
 
  • This website as well as the DaVinci packages are licensed under the Apache License, Version 2.0.