Skip to content

Commit 3611628

Browse files
author
Vladyslav
committed
Update readme
1 parent fed3154 commit 3611628

File tree

1 file changed

+48
-7
lines changed

1 file changed

+48
-7
lines changed

README.md

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,51 @@ The documentation process in `{pharmaverseadam}` is automated for consistency an
3737

3838
## Workflow
3939

40-
1. **Metadata Preparation**:
41-
- Ensure `adams-specs.xlsx` contains up-to-date metadata for all datasets.
42-
- Missing fields default to "No label/description/source available."
43-
2. **Run Script**:
44-
- The `data-raw/create_adams_data.R` script dynamically retrieves metadata, enriches it with dataset attributes, and generates `.R` files in the `R/` directory.
45-
3. **Generate Documentation**:
46-
- Use `roxygen2::roxygenize()` to update `.Rd` files in the `man/` directory.
40+
The creation and maintenance of ADaM test datasets in `{pharmaverseadam}` is automated to ensure reproducibility and ease of updates. The workflow consists of two main steps:
41+
42+
### 1. Metadata Preparation
43+
44+
- All metadata for datasets is defined in a centralized Excel file: `inst/extdata/adams-specs.xlsx`.
45+
- This file includes dataset names, labels, descriptions, variable metadata, and source information.
46+
- Any missing metadata fields will be set by default to "No label/description/source available."
47+
48+
### 2. Run Script
49+
50+
`data-raw/create_adams_data.R` handles the generation, processing, and documentation of ADaM datasets by executing template scripts from the `{admiral}` package family.
51+
52+
#### What the Script Does
53+
54+
1. **Install or Update Required Packages**
55+
Installs or updates the latest development versions of:
56+
- `{admiral}`
57+
- `{admiralonco}`
58+
- `{admiralophtha}`
59+
- `{admiralvaccine}`
60+
- `{admiralpeds}`
61+
- Any dependencies such as `{pharmaversesdtm}`
62+
63+
2. **Execute Templates from Each Package**
64+
- Finds all template scripts located in each package’s `inst/templates` directory.
65+
- Executes these templates, which create the ADaM datasets (e.g., `adsl`, `advs`, etc.).
66+
- Some templates may be excluded via the `ignore_templates` configuration.
67+
68+
3. **Process and Save Datasets**
69+
For each dataset:
70+
- It is loaded from the temporary output,
71+
- Variables are labeled using metadata from `adams-specs.xlsx` via `{metacore}` and `{metatools}`,
72+
- A domain-specific suffix is applied if needed (e.g., `_O`, `_P`),
73+
- The dataset is saved to `data/` as a compressed `.rda` file.
74+
75+
4. **Generate Dataset Documentation**
76+
For every dataset, a matching `.R` file is created in the `R/` folder containing:
77+
- Dataset name and title,
78+
- Variable-level documentation (names and labels),
79+
- Source information indicating which template and package generated it,
80+
- Example usage with `data("<dataset>")`.
81+
82+
5. **Log Errors and Failures**
83+
- Errors such as missing metadata or template failures are caught and logged,
84+
- Any issues are printed in the console output to assist debugging.
85+
86+
6. **Finalize Documentation**
87+
After all datasets and `.R` files are generated, the script calls: `roxygen2::roxygenize()` to update .Rd files in the man/ directory.

0 commit comments

Comments
 (0)