Overview
mighty uses these inputs:
- ADaM specification: one YAML file per ADaM domain, describing what the dataset contains
- Framework configuration (_mighty.yml): keys of external domains and where to find components
- Code components: the code for derivations, referenced from the specifications
-
Study properties (_study.yml): (optional) study-level properties such as
study_id, used for for define.xml generation
This modular approach separates the what (specifications) from the how (code components), enabling efficient and consistent ADaM development. By providing these building blocks, mighty takes care of organizing and rendering ADaM programs.
Additionally (and optional), mighty can render programs that are executable, based on the available data:
- Data Model Metadata (optional): Metadata about available data sources (SDTM, metadata used for ADaM generation, and non-mighty ADaM datasets)
Framework configuration (_mighty.yml)
_mighty.yml has two sections:
-
external_data: the keys of external domains (SDTM, metadata, ADaM built elsewhere). mighty uses keys to join domains. For example, when ADLB takesSAFFLfrom ADSL, the rows are matched on ADSL’s keys. -
repos: where mighty looks for components.
ADaM Specification
Each ADaM domain requires its own specification that acts as a comprehensive blueprint. The specification defines:
- Base tables: Which SDTM domain(s) serve as the foundation
- Subsetting rules: How to filter base domains during preparation
- Column requirements: Both retained SDTM variables and derived variables
- Row operations: Transformations such as derived parameters and imputations
For detailed information about the ADaM specification data model and syntax, see ADaM specification.
Code Components
Code components hold the code for the derivations that ADaM specifications refer to. Each component is an R script (.R) or a Mustache template (.mustache). A template has placeholders that are filled from the with: parameters in the specification. Specifications refer to components by name, and mighty finds them in the repositories listed under repos in _mighty.yml.
There are two kinds of components:
User components
- Supplied through the repositories listed under
reposin_mighty.yml, searched in order; the first match wins - Can come from a shared library (e.g. mighty.standards) or from the trial repository
- Referenced in the specification by
component: id:
Internal components
- Used by mighty itself and never referenced in a specification
- Read source data, set up each domain, filter rows, and write the output
- Join other domains using the keys defined in
_mighty.ymlor in their specifications
See Code components and Internal components.
Study properties (_study.yml)
The optional _study.yml holds study-level properties. While mighty does not use it to generate code, it is used for define.xml. If the file is missing, mighty shows a message and continues. If it exists, it must contain a study_id field; otherwise mighty.metadata stops with an error.
Available data (optional)
While a trial is running, the available data keeps changing until database lock: new SDTM datasets are added, columns appear in existing ones, supplemental qualifier datasets are created or updated, and protocol amendments can add new data points. The programs mighty generates always follow the full ADaM specification, so they fail if a domain or column they use does not exist yet.
To get programs you can run now, pass generate_adam_code() a data_context describing which SDTM and metadata tables and columns exist. mighty then returns two sets of programs: the complete ones, which follow the specification, and executable ones, which run on the current data. In the executable programs, steps that can’t run yet are commented out, with a note saying which data is missing. See Missing data analysis.
