Skip to contents

Overview

Each study has one _mighty.yml, in the study directory next to the specifications. It has two sections:

  • external_data: the keys of the external domains the generated programs read (SDTM, metadata, ADaM built elsewhere)
  • repos: where mighty looks for components

Both apply to all ADaM domains in the study.

External data

The external_data section specifies primary keys for all external datasets that will be available at runtime.

mighty recognizes the kind of each external domain from its name, and the generated programs read it from the matching source in your connector config:

Domain name Kind Connector source
  • 2 letters (e.g. DM, LB)
  • RELREC
  • starts with SUPP
  • starts with DM_
SDTM domains sdtm
starts with AD (e.g. an ADaM dataset not generated by mighty) ADaM datasets adam
starts with MD (e.g. MDPARAM) metadata: study-level lookup tables, e.g. parameter definitions metadata

IMPORTANT: ADaM domains being generated by mighty should have their keys defined in their individual domain specification files (see ADaM specification), NOT in _mighty.yml.

IMPORTANT: Domain names must be specified in uppercase following CDISC standards (e.g., DM, EX, LB), regardless of the file name casing. The system automatically handles case conversion when reading data files.

Example:

external_data:
  - id: DM
    keys: [USUBJID, STUDYID]
  - id: EX
    keys: [USUBJID]
  - id: MDPARAM
    keys: [STUDYID, TOPICCD]

Component repositories

The repos field tells mighty where to look for code components. Repositories are searched in the order listed, and the first match wins.

A component with the same name in a later repository is ignored. This also applies to mighty’s internal components (for example mighty_init_domain). To use your own version of an internal component, put its repository before the one with the internal components. Otherwise, list the internal components first.

Each entry can be:

  • github::owner/repo — a GitHub repository
  • github::owner/repo/subdir — a subdirectory inside a GitHub repository
  • github::owner/repo/subdir@ref — a specific branch, tag, or commit
  • A local filesystem path (absolute or relative to the working directory), optionally prefixed with local::

mighty resolves each GitHub ref to a commit once per R session, and downloads each commit once per session. Later calls to generate_adam_code() reuse the cached copy. Restart R to pick up new commits on a branch.

Example:

repos:
  - github::NovoNordisk-OpenSource/mighty.standards/components
  - github::my-org/study-components@v1.0.0
  - "./local-components"

IMPORTANT: repos must include a source for mighty’s internal components (typically github::NovoNordisk-OpenSource/mighty.standards/components). Without it, mighty cannot resolve the internal components used during code generation.

Component IDs

The id of a component in an ADaM specification is looked up in repos. It is not a file path. Inside each repository, id: relative_day matches:

  • relative_day.R or relative_day.mustache
  • the same file names inside a relative_day/ subdirectory

If one repository has more than one match (for example both relative_day.R and relative_day.mustache), mighty stops with an error. Use the file name with its extension to select one.