| Title: | '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. |
| Authors: | Pawan Rama Mali [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-7864-5819>) |
| Maintainer: | Pawan Rama Mali <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-12 10:10:17 UTC |
| Source: | https://github.com/r4sub/r4subpharma |
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'.
adam_to_evidence( data, metadata, ctx, dataset_name = NULL, source_name = "adam", source_version = NULL )adam_to_evidence( data, metadata, ctx, dataset_name = NULL, source_name = "adam", source_version = NULL )
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 |
Four indicators are evaluated:
Each variable described in the metadata is present in the dataset (traceability).
Each dataset column is described in the metadata; columns that are not are flagged (traceability).
Present variables have the data type family the metadata specifies (quality).
Present variables carry a non-empty label attribute (usability).
A data.frame conforming to the R4SUB evidence schema.
metacore_to_evidence(), submission_readiness()
# 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)# 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)
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.
as_variable_metadata(metadata)as_variable_metadata(metadata)
metadata |
Either a |
A tibble with columns dataset, variable,
label, type, origin, derivation, and is_derived.
# The example ADaM metadata shipped in r4subdata. meta <- as_variable_metadata(r4subdata::adam_metadata) head(meta)# The example ADaM metadata shipped in r4subdata. meta <- as_variable_metadata(r4subdata::adam_metadata) head(meta)
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.
metacore_to_evidence( metadata, ctx, source_name = "metacore", source_version = NULL )metacore_to_evidence( metadata, ctx, source_name = "metacore", source_version = NULL )
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 |
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:
Variable is documented (has a label and a data type).
Derivation text is present for derived variables.
A data.frame conforming to the R4SUB evidence schema.
adam_to_evidence(), submission_readiness()
# 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)# 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)
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.
submission_readiness(data, metadata, ctx, config = NULL)submission_readiness(data, metadata, ctx, config = NULL)
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 |
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).
metacore_to_evidence(), adam_to_evidence()
# 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)# 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)