Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #93 Update readme and doc script #94

Merged
merged 12 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Authors@R: c(
person("Gayatri", "G", role = "aut"),
person("Daphne", "Grassely", role = "aut"),
person("Zelos", "Zhu", role = "aut"),
person("Sadchla", "Mascary", role = "aut")
person("Sadchla", "Mascary", role = "aut"),
person("Vladyslav", "Shuliar", role = "aut", comment = c(ORCID = "0009-0008-2354-8999"))
)
Description: A set of Analysis Data Model (ADaM) datasets constructed using the
Study Data Tabulation Model (SDTM) datasets contained in the 'pharmaversesdtm' package and
Expand Down
56 changes: 32 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,53 @@
<!-- Please do not edit the README.md file as it is auto-generated after PR merges. Only edit the README.Rmd file -->
<!-- The purpose of this is to enable dynamic links using dyn_link function above to access devel/main admiral homepage respectively -->
<!-- To test this in your feature branch use code: rmarkdown::render("README.Rmd", output_format ="md_document") -->

# pharmaverseadam <img src="man/figures/logo.png" align="right" width="200" style="margin-left:50px;"/>

<!-- badges: start -->

[<img src="http://pharmaverse.org/shields/pharmaverseadam.svg">](https://pharmaverse.org)
[![CRAN
status](https://www.r-pkg.org/badges/version/pharmaverseadam)](https://CRAN.R-project.org/package=pharmaverseadam)
[<img src="http://pharmaverse.org/shields/pharmaverseadam.svg"/>](https://pharmaverse.org)
[![CRAN status](https://www.r-pkg.org/badges/version/pharmaverseadam)](https://CRAN.R-project.org/package=pharmaverseadam)

<!-- badges: end -->

Test data (ADaM) for the pharmaverse family of packages

# Purpose

To provide a one-stop-shop for ADaM test data in the pharmaverse family
of packages.
To provide a one-stop-shop for ADaM test data in the pharmaverse family of packages.

# Package Contents

The ADaM contents of this package is populated by an action that
executes the `{admiral}`, `{admiralonco}`, `{admiralophtha}`,
`{admiralvaccine}` and `{admiralpeds}` templates and saves the resulting datasets here. This
action can be triggered manually by the package maintainers in two
scenarios:
The ADaM contents of this package is populated by an action that executes the `{admiral}`, `{admiralonco}`, `{admiralophtha}`, `{admiralvaccine}` and `{admiralpeds}` templates and saves the resulting datasets here. This action can be triggered manually by the package maintainers in two scenarios:

- Regularly, upon new releases of `{admiral}`, `{admiralonco}`,
`{admiralophtha}` and `{admiralvaccine}`;
- Ad-hoc, whenever templates in the above packages have been updated
but releases are far away in the calendar. In this case, the ADaM
datasets are created using the development version of the templates.
- Regularly, upon new releases of `{admiral}`, `{admiralonco}`, `{admiralophtha}` and `{admiralvaccine}`;
- Ad-hoc, whenever templates in the above packages have been updated but releases are far away in the calendar. In this case, the ADaM datasets are created using the development version of the templates.
vbshuliar marked this conversation as resolved.
Show resolved Hide resolved

# Installation

The package is available from CRAN and can be installed by running
`install.packages("pharmaverseadam")`. To install the latest development
version of the package directly from GitHub use the following code:
The package is available from CRAN and can be installed by running `install.packages("pharmaverseadam")`. To install the latest development version of the package directly from GitHub use the following code:

if (!requireNamespace("remotes", quietly = TRUE)) {
```
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
```

# Documentation Process

The documentation process in `{pharmaverseadam}` is automated for consistency and ease of maintenance. Metadata for each dataset, such as names, labels, descriptions, authors, and sources, is managed in a centralized XLSX file (`inst/extdata/adams-specs.xlsx`) and used to generate `.R` documentation files.

## Workflow

1. **Metadata Preparation**:
- Ensure `adams-specs.xlsx` contains up-to-date metadata for all datasets.
- Missing fields default to "No label/description/source available."
2. **Run Script**:
- The `data-raw/create_adams_data.R` script dynamically retrieves metadata, enriches it with dataset attributes, and generates `.R` files in the `R/` directory.
3. **Generate Documentation**:
- Use `roxygen2::roxygenize()` to update `.Rd` files in the `man/` directory.

## Key Benefits of this Documentation Approach

vbshuliar marked this conversation as resolved.
Show resolved Hide resolved
- **Automation**: Eliminates manual effort in maintaining documentation.
- **Consistency**: Ensures uniform documentation for all datasets.
- **Flexibility**: Easily update metadata centrally via the XLSX file.

remotes::install_github("pharmaverse/pharmaverseadam", ref = "main")
This streamlined approach aligns with best practices for efficient package development.
2 changes: 2 additions & 0 deletions data-raw/create_adams_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ write_doc <- function(data, dataset_name, dataset_label, pkg, template_name) {
# TODO: use metatools/metacore for doc ?
dataset_label <- str_replace(dataset_label, "Hys Law", "Hy's Law")
doc_string <- paste(
sprintf("# This file is automatically generated."),
sprintf("# Manual edits are not recommended, as changes may be overwritten."),
sprintf("#' %s", dataset_name),
"#'",
sprintf("#' %s", dataset_label),
Expand Down
3 changes: 3 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,6 @@ seropositivity
Hy
Hy's
ORCID
XLSX
WORD
CRANstatus
1 change: 1 addition & 0 deletions man/pharmaverseadam-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading