| Title: | 'pharmaverse' Adapters for R4SUB Submission Readiness Evidence |
| Version: | 0.1.0 |
| Description: | Bridges the 'pharmaverse' clinical reporting stack and the R4SUB (Ready for Submission) ecosystem. Converts 'metacore' metadata objects and ADaM (Analysis Data Model) datasets - such as those built with 'admiral' - into standardized R4SUB evidence table rows via 'r4subcore', so that submission readiness can be scored with 'r4subscore' without changing an existing pharmaverse pipeline. |
| License: | MIT + file LICENSE |
| URL: | https://r4sub.github.io/r4subpharma/, https://github.com/R4SUB/r4subpharma |
| BugReports: | https://github.com/R4SUB/r4subpharma/issues |
| Depends: | R (≥ 4.2) |
| Imports: | cli, r4subcore, tibble |
| Suggests: | knitr, metacore, pharmaverseadam, r4subdata, r4subprofile, r4subscore, rmarkdown, testthat (≥ 3.0.0) |
| VignetteBuilder: | knitr |
| Config/testthat/edition: | 3 |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| NeedsCompilation: | no |
| Packaged: | 2026-08-31 17:07:11 UTC; alpine |
| Author: | Pawan Rama Mali |
| Maintainer: | Pawan Rama Mali <prm@outlook.in> |
| Repository: | CRAN |
| Date/Publication: | 2026-09-11 13:00:02 UTC |
r4subpharma: 'pharmaverse' Adapters for R4SUB Submission Readiness Evidence
Description
Bridges the 'pharmaverse' clinical reporting stack and the R4SUB (Ready for Submission) ecosystem. Converts 'metacore' metadata objects and ADaM (Analysis Data Model) datasets - such as those built with 'admiral' - into standardized R4SUB evidence table rows via 'r4subcore', so that submission readiness can be scored with 'r4subscore' without changing an existing pharmaverse pipeline.
Author(s)
Maintainer: Pawan Rama Mali prm@outlook.in (ORCID) [copyright holder]
See Also
Useful links:
Report bugs at https://github.com/R4SUB/r4subpharma/issues
Convert an ADaM Dataset to Submission Readiness Evidence
Description
Compares a built ADaM dataset - such as one produced by an 'admiral' pipeline
against its metadata and emits R4SUB evidence rows about conformance. The checks are computed directly from the dataset and metadata, so they work whether or not the dataset was passed through 'xportr' or 'metatools'.
Usage
adam_to_evidence(
data,
metadata,
ctx,
dataset_name = NULL,
source_name = "adam",
source_version = NULL
)
Arguments
data |
A data.frame: one ADaM dataset. |
metadata |
A |
ctx |
An r4subcore::r4sub_run_context providing run and study identifiers. |
dataset_name |
Character or |
source_name |
Character. Label recorded as the evidence source.
Default |
source_version |
Character or |
Details
Four indicators are evaluated:
- T-ADAM-001
Each variable described in the metadata is present in the dataset (traceability).
- T-ADAM-002
Each dataset column is described in the metadata; columns that are not are flagged (traceability).
- Q-ADAM-001
Present variables have the data type family the metadata specifies (quality).
- Q-ADAM-002
Present variables carry a non-empty label attribute (usability).
Value
A data.frame conforming to the R4SUB evidence schema.
See Also
metacore_to_evidence(), submission_readiness()
Examples
# Check the CDISC pilot ADSL from pharmaverseadam against the ADaM metadata
# shipped in r4subdata.
ctx <- suppressMessages(r4subcore::r4sub_run_context("CDISCPILOT01", "DEV"))
ev <- suppressMessages(adam_to_evidence(
pharmaverseadam::adsl,
r4subdata::adam_metadata,
ctx,
dataset_name = "ADSL"
))
table(ev$indicator_id, ev$result)
Coerce Metadata to the Variable-Metadata Contract
Description
Normalizes the accepted metadata inputs into a single tidy table with one row
per dataset variable. A metacore object is unpacked
into its dataset, variable, and derivation components; a data.frame is checked
for the required dataset and variable columns and completed with any
missing optional columns.
Usage
as_variable_metadata(metadata)
Arguments
metadata |
Either a |
Value
A tibble with columns dataset, variable,
label, type, origin, derivation, and is_derived.
Examples
# The example ADaM metadata shipped in r4subdata.
meta <- as_variable_metadata(r4subdata::adam_metadata)
head(meta)
Convert Metadata to Submission Readiness Evidence
Description
Turns dataset metadata - either a metacore object or a
plain data.frame - into standardized R4SUB evidence rows describing how
completely each variable is documented. This lets metadata assembled for a
'pharmaverse' pipeline feed the same evidence table and Submission Confidence
Index as any other source.
Usage
metacore_to_evidence(
metadata,
ctx,
source_name = "metacore",
source_version = NULL
)
Arguments
metadata |
A |
ctx |
An r4subcore::r4sub_run_context providing run and study identifiers. |
source_name |
Character. Label recorded as the evidence source.
Default |
source_version |
Character or |
Details
Two indicators are evaluated, reusing the identifiers emitted by
r4subcore::define_xml_to_evidence() so that metadata- and Define-XML-sourced
evidence group together in scoring and explainability:
- Q-DEFINE-002
Variable is documented (has a label and a data type).
- Q-DEFINE-003
Derivation text is present for derived variables.
Value
A data.frame conforming to the R4SUB evidence schema.
See Also
adam_to_evidence(), submission_readiness()
Examples
# The example ADaM metadata shipped in r4subdata.
ctx <- suppressMessages(r4subcore::r4sub_run_context("STUDY01", "DEV"))
ev <- suppressMessages(metacore_to_evidence(r4subdata::adam_metadata, ctx))
table(ev$indicator_id, ev$result)
Score Submission Readiness for a 'pharmaverse' Deliverable
Description
A single entry point that harvests evidence from metadata and one or more ADaM datasets and, when 'r4subscore' is available, computes the Submission Confidence Index (SCI) in one call. It is the fastest way to go from a 'pharmaverse' pipeline to a readiness score.
Usage
submission_readiness(data, metadata, ctx, config = NULL)
Arguments
data |
A named list of ADaM data.frames (names are dataset identifiers,
e.g. |
metadata |
A |
ctx |
An r4subcore::r4sub_run_context providing run and study identifiers. |
config |
An optional |
Value
An object of class "submission_readiness": a list with evidence
(the combined evidence data.frame), pillar_scores, and sci (an
sci_result, or NULL if 'r4subscore' is not installed).
See Also
metacore_to_evidence(), adam_to_evidence()
Examples
# Score the CDISC pilot ADSL against the ADaM metadata in r4subdata.
ctx <- suppressMessages(r4subcore::r4sub_run_context("CDISCPILOT01", "DEV"))
res <- suppressMessages(submission_readiness(
list(ADSL = pharmaverseadam::adsl),
r4subdata::adam_metadata,
ctx
))
nrow(res$evidence)