OQNCA: Operational Qualification (OQ) report to a pdf file

View source: R/OQNCA.R

OQNCAR Documentation

Operational Qualification (OQ) report to a pdf file

Description

Generate a self-contained PDF report that documents whether the NonCompart noncompartmental analysis engine reproduces pre-specified reference results on the user's own machine, within a pre-specified relative tolerance. It is intended as Operational Qualification (OQ) evidence. The report lists every computed value next to its reference value, with the absolute and relative difference and a pass flag, then an overall verdict. It uses only base R and the package's pdf helpers (no LaTeX). The signature page is first; 1 inch margins; Letter paper in a United States locale and A4 elsewhere.

Usage

OQNCA(fileName = "NonCompart-OQ-Report.pdf", cases = NULL, tol = 0.001,
      refDir = system.file("OQ", package = "NonCompart"), performedBy = "",
      paper = "auto", sigField = FALSE)

Arguments

fileName

file name to save the PDF report.

cases

a list of OQ case definitions. If NULL, the built-in set of fourteen scenarios is used: eight concordance (Tier B) ones (Theophylline and Indometacin; extravascular / IV bolus / IV infusion; linear-up-linear-down and linear-up-log-down AUC) and six Tier A cases on synthetic fixtures whose terminal phase is exactly mono-exponential, so their reference values are known in closed form. Each case is a list with elements id, desc, either dataset (the name of a datasets object) or data (an inline data frame), key, colTime, colConc, args (further tblNCA arguments), ref (the reference csv file name in refDir), and optionally roundTrip (re-run the analysis with the UsedPoints the first run reported and require every parameter to be unchanged).

tol

acceptance tolerance: a parameter passes when the symmetric relative difference abs(R - W) / ((abs(R) + abs(W))/2) is at most tol; an absolute fallback is used when both values are essentially zero.

refDir

directory holding the reference csv files and the ‘RptCfg.csv’ PPTESTCD-to-reference-column name map. Defaults to the OQ folder installed with NonCompart.

performedBy

name of the person performing the qualification, printed on the signature page. Defaults to the login name.

paper

paper size: "letter", "a4", or "auto" (the default; Letter in a United States locale, A4 elsewhere).

sigField

if TRUE, add Adobe Acrobat Reader signature fields to the finished report (via addSigFieldNCA) so it can be signed with one click in Acrobat Reader.

Details

For each case the function runs tblNCA on the (frozen) input data, maps the CDISC PPTESTCD result columns to the column names of the reference tables using ‘RptCfg.csv’ in refDir, matches comparable parameters to the reference table (robust to % vs . naming), and compares every parameter for every subject. A case passes only when all of its comparisons pass.

Most bundled reference values are WinNonlin 6.4 NCA outputs. These establish concordance with the de-facto reference implementation (Tier B); they are not, by themselves, an independent verification.

Since 0.8.3 the set also contains three Tier A cases, whose reference values are derived from first principles rather than from another implementation. They run a synthetic single-subject fixture carrying a lag-phase zero, an embedded below-the- limit-of-quantification sample inside the lambda z window, and trailing BLQ, and they cover automatic slope selection, an explicit UsePoints fit, and a round trip that feeds the reported UsedPoints back in. Neither Theoph nor Indometh contains a trailing or an embedded BLQ sample or exercises UsePoints, so the eight Tier B cases alone cannot reach those paths.

Since 0.8.4 two further Tier A cases qualify the steady-state path (SS = TRUE with tau): a single dosing interval whose concentrations are small integers, so that AUCTAU is the hand-summable trapezoid 66, CAVG is 66/12 and CL/F is the dose over 66, once with tau given in hours and once with the same tau given in days. Every reference value in that file was written out from the definition of the parameter, not produced by this package or by any other software.

Since 0.8.5 a sixth Tier A case qualifies the intravascular steady-state path: a one-compartment bolus at steady state (dose 100 every 12 h, volume 20, half-life 4 h) run with the log-down method, for which every area is exact. Its reference row is closed form throughout; in particular the MRT to infinity is 1/k and Vss equals the volume, 20. A case now also fails when a parameter or a subject of its reference table is absent from the result, or when a subject occurs twice; such rows used to be left out of the comparison.

Value

Invisibly, a list with fileName, qualified, tol, nCases, nFailCases, paper, and results (a per-case list whose comp element is the full table of every comparison). A PDF is written to fileName.

Author(s)

Kyun-Seop Bae <k@acr.kr>

See Also

IQNCA, writeMD5NCA, tblNCA

Examples

#OQNCA()
#res <- OQNCA(); res$qualified; res$results[[1]]$comp

NonCompart documentation built on Nov. 15, 2026, 5:07 p.m.