| Title: | Data Visualization and Quality Checking for Pharmacometric Datasets |
|---|---|
| Description: | Data quality checks for NONMEM-style and ADPPK pharmacometric datasets, with a Shiny application to review the findings alongside individual and population concentration-time profiles. |
| Authors: | Runcheng Li [aut, cre] |
| Maintainer: | Runcheng Li <[email protected]> |
| License: | Apache License (>= 2) |
| Version: | 0.0.0.9000 |
| Built: | 2026-10-29 10:24:43 UTC |
| Source: | https://github.com/pharmaverse/pmxdchk |
A variant of [adppk_example] with known problems injected across several domains so the checks and the profile flag overlay have something to detect. Injected issues include an invalid EVID, a zero and an extreme dose amount, a decreasing time, a high predose and an extreme concentration, an MDV/DV inconsistency, an inconsistent within-subject SEX, an implausible baseline weight, a subject with observations but no dose, a duplicate record, and an exclusion flag without a reason (via an added 'EXCLFL' column).
adppk_corruptedadppk_corrupted
The same structure as [adppk_example] plus an 'EXCLFL' column.
Derived from pharmaverseadam::adppk; see
data-raw/corrupted_examples.R.
A copy of the ADPPK analysis dataset from pharmaverseadam, provided as a built-in clean example for trying the app and the checks. It uses CDISC ADPPK variable names (e.g. 'USUBJIDN', 'AFRLT', 'NFRLT', 'WTBL', 'PARAMN'), which the app's variable mapping resolves to canonical NONMEM names.
adppk_exampleadppk_example
A data frame with one row per event record and CDISC ADPPK columns including 'USUBJIDN', 'STUDYIDN', 'AFRLT', 'NFRLT', 'EVID', 'MDV', 'DV', 'AMT', 'CMT', 'II', 'SS', 'PARAMN', and baseline covariates.
pharmaverseadam::adppk
Lists every check the package runs, with the rule it applies and what to do when it flags.
check_catalogue()check_catalogue()
A tibble with one row per check: 'check_id', 'title', 'domain', 'severity', 'study_types', 'rule', 'guidance'.
check_catalogue()check_catalogue()
Conservative, data-driven defaults for checks that take tunable cutoffs. Passed into every check by [run_nmpk_checks()]; override individual elements to retune without touching check code.
default_thresholds()default_thresholds()
A named list of thresholds.
th <- default_thresholds() th$min_quantifiable_n <- 3th <- default_thresholds() th$min_quantifiable_n <- 3
Data-driven inference for 'CORE-STUDYTYPE-001', following the *Study Type Map* sheet of the QC checklist. Operates on a dataset already mapped to canonical variable names. The result is informational: the app presents it for user confirmation before checks are selected.
infer_study_type(data)infer_study_type(data)
data |
A data frame with canonical variable names. |
A tibble with columns 'study_type', 'applicable' (logical), 'reason'.
df <- data.frame( ID = c(1, 1, 2, 2), TIME = c(0, 1, 0, 1), EVID = c(1, 0, 1, 0), AMT = c(100, 0, 100, 0), ADDL = c(5, NA, 5, NA), II = c(24, NA, 24, NA) ) infer_study_type(df)df <- data.frame( ID = c(1, 1, 2, 2), TIME = c(0, 1, 0, 1), EVID = c(1, 0, 1, 0), AMT = c(100, 0, 100, 0), ADDL = c(5, NA, 5, NA), II = c(24, NA, 24, NA) ) infer_study_type(df)
Run the Shiny Application
run_app( onStart = NULL, options = list(), enableBookmarking = NULL, uiPattern = "/", ... )run_app( onStart = NULL, options = list(), enableBookmarking = NULL, uiPattern = "/", ... )
onStart |
A function that will be called before the app is actually run.
This is only needed for |
options |
Named options that should be passed to the |
enableBookmarking |
Can be one of |
uiPattern |
A regular expression that will be applied to each |
... |
arguments to pass to golem_opts. See '?golem::get_golem_options' for more details. |
Headless entry point and the same path the Shiny app uses. Applies the variable mapping, orders checks by their prerequisites, evaluates skip conditions, runs each check, and returns a tidy findings tibble.
run_nmpk_checks( data, mapping = NULL, thresholds = default_thresholds(), study_type = "All" )run_nmpk_checks( data, mapping = NULL, thresholds = default_thresholds(), study_type = "All" )
data |
A data frame of a NONMEM-style (NMPK) dataset. |
mapping |
Optional named character vector mapping canonical variable names to user column names ('c(ID = "USUBJID", TIME = "TAFD")'). When 'NULL', columns are assumed to already use canonical names. |
thresholds |
A list of thresholds; see [default_thresholds()]. Elements not supplied fall back to their defaults. |
study_type |
Character vector of confirmed study types used to gate conditional checks. Defaults to '"All"'. |
A tibble with one row per check: 'check_id', 'title', 'domain', 'severity', 'status', 'n_flagged', 'message'. The full [new_check_result()] objects are attached as the '"results"' attribute for the app and reporting layers.
df <- data.frame( ID = c(1, 1), TIME = c(0, 1), EVID = c(1, 0), MDV = c(1, 0), DV = c(0, 5), AMT = c(100, 0) ) run_nmpk_checks(df)df <- data.frame( ID = c(1, 1), TIME = c(0, 1), EVID = c(1, 0), MDV = c(1, 0), DV = c(0, 5), AMT = c(100, 0) ) run_nmpk_checks(df)