Skip to contents

The mighty framework introduces a declarative paradigm to building ADaM datasets, emphasizing what you need rather than how to create it. This shift enables users to focus on the structure, derivations, and intent of your datasets while abstracting away tedious implementation details.

Important mighty is a work-in-progress, so expect the documentation and functionality to change.

Why mighty?

Declarative Specification

With mighty, you specify exactly what belongs in your ADaM datasets—including columns, derivations, and row transformations—and point to existing code implementations (or your own custom ones) that handle the actual data manipulations. Mighty orchestrates and compiles these instructions into executable ADaM programs.

Single Source of Truth

Mighty ensures metadata required for your define.xml always matches the code implementation. Components and specifications are consolidated into a single representation, ensuring any changes automatically propagate throughout your ADaM programs and keeping documentation synchronized with implementation.

Dependency Analysis

Mighty tracks column and row dependencies for every derivation and works out the order to run them in. This ensures that derived variables are created in the correct sequence, with prerequisite calculations completed before dependent operations. Dependency validation alerts you when required columns are missing, or if cyclic dependencies are detected, to aide debugging.

Missing Data Analysis

If some SDTM or ADaM data doesn’t exist yet, mighty can also generate programs that run on the data available today, with the steps that can’t run commented out. See Missing data analysis.

Example: Deriving COMPLSFL in ADSL

To illustrate mighty’s declarative paradigm, consider the following example where we define and derive the variable COMPLSFL for the ADSL domain. This column indicates whether the subject’s end-of-study status is “COMPLETED.”

id: ADSL
label: Subject-Level Analysis Dataset
class: SUBJECT LEVEL ANALYSIS DATASET
structure: One record per subject

keys:
  - USUBJID
  - STUDYID

population:
  base:
    - domain: DM
      depends: NA
      filter: NA
  global:
    - filter: NA
      depends: NA

columns:
  - id: USUBJID

  - id: STUDYID

  - id: EOSSTT

  - id: COMPLSFL
    component:
      id: der_complsfl

This specification uses the mighty.metadata format with these main sections:

  • id: The ADaM domain name (ADSL)
  • label: A description of the dataset
  • class: The CDISC class of the dataset
  • structure: A text description of the dataset’s structure
  • keys: Primary key variables for the dataset
  • population: Defines which SDTM domains form the base population
  • columns: An array of column definitions with their derivation methods

The COMPLSFL column points to the code component called der_complsfl.

Code components

Code components can either be validated standard components or custom (un-validated) components. In this example der_complsfl is a standard component.

The id field holds the name of the component, not a file path. Mighty looks it up in the component repositories listed under repos in _mighty.yml (see Framework configuration). To use your own components, add the directory that contains them to repos and refer to each one by its name or file name:

# _mighty.yml
repos:
  - github::NovoNordisk-OpenSource/mighty.standards/components
  - path/to/custom/components
  - id: COMPLSFL
    component:
      id: der_complsfl.R

Custom components are R scripts (.R) or Mustache templates (.mustache) that adhere to a few simple rules. See Code components for more details.

As mighty matures, more of these components will be pre-defined and ready for use, so fewer components would need to be defined by the user. Standard components are provided by mighty.standards, while mighty.component provides utilities for rendering both standard and custom components.

See ADaM specification for more details on the ADaM Specification data model.

For now, let’s assume der_complsfl doesn’t exist and we have to write it ourselves:

#' @title Completion Status Flag Calculation
#'
#' @description This script adds a `COMPLSFL` column to the input data frame,
#' indicating whether a subject's end-of-study status is marked as "COMPLETED".
#'
#' @type column
#'
#' @origin Derived
#'
#' @method Set to "Y" when EOSSTT is "COMPLETED", otherwise "N".
#'
#' @depends ADSL EOSSTT
#'
#' @outputs COMPLSFL
#' @code

# Add a new column COMPLSFL based on the EOSSTT value
ADSL <- ADSL |> dplyr::mutate(
  COMPLSFL = dplyr::case_when(
    EOSSTT == "COMPLETED" ~ "Y",  # Mark "Y" if EOSSTT is "COMPLETED"
    TRUE                  ~ "N"   # Mark "N" otherwise
  )
)

How it works

mighty uses these inputs to generate ADaM programs:

  1. ADaM specifications: one YAML file per dataset, describing its columns and records
  2. Framework configuration (_mighty.yml): keys of the datasets mighty reads, and where to find components
  3. Code components: reusable building blocks referenced in specifications
  4. Data availability (optional): which SDTM/ADaM domains and columns exist today, to generate programs that run on the current data

See Inputs overview for details.

mighty puts the derivations, parameters and imputations in the right order and writes them out as structured, production-ready ADaM programs.

Note: Code components can be sourced from mighty.standards (processed via mighty.component) or defined as custom user components, depending on project requirements.

See ADaM specification for more details on ADaM specifications, Framework configuration for study metadata configuration, and Connecting to data for more details on how source data is retrieved in the rendered programs.

The mighty ecosystem

The mighty framework consists of these complementary packages:

  • mighty - Core orchestration engine
  • mighty.metadata - ADaM metadata management in YAML format
  • mighty.component - Utilities enabling mighty to handle code components
  • mighty.standards - Standard component library with pre-built, validated derivations (coming later)
  • mighty.ai - AI-powered helper for the mighty ecosystem (coming later)
  • mighty.editor - An enhanced editor for handling ADaM specifications and components (coming later)
  • mighty.toolbox - A toolbox for define.xml generation and validation of ADaM related deliverables according to CDISC and regulatory requirements

Note: All packages in the mighty ecosystem are currently under active development and are subject to change. Package names, features, and functionality may evolve as the ecosystem matures.

Installation

Install the released version from CRAN:

Install the development version from GitHub:

pak::pak("NovoNordisk-OpenSource/mighty")