Convert a Wings for NONMEM extended control stream to standard NONMEM
Source:R/nm_convert_ctl.R
nm_convert_ctl.RdWings for NONMEM (WFN) supports an extended control stream format where
parameter names (e.g. POP_CL, PPV_CL, RUV_PROP) are
used directly in model records ($PK, $PRED, $ERROR,
$DES) instead of THETA(n), ETA(n), ERR(n).
This function parses the parameter names from $THETA, $OMEGA
and $SIGMA comment fields and substitutes them back into standard
NONMEM syntax, producing a control stream compatible with direct
nmfe execution.
Arguments
- ctl
Path to the Wings extended control stream (
.ctl). (Formerlyctl_file, still accepted with a warning.)- output_file
Output path for the converted control stream. If
NULL(default), the output file is named<run>_converted.ctlin the same directory asctl. (Formerlyout_file, still accepted with a warning.)- overwrite
Logical. If
TRUE, overwriteoutput_fileif it already exists (defaultFALSE).- verbose
Logical. If
TRUE(default), print a summary of substitutions made.- ...
Former argument name, accepted with a warning until version 1.0:
ctl_file(nowctl).
Details
The conversion follows the WFN specification:
Parameter names are extracted from the first non-numeric word after the
;comment delimiter in each$THETA,$OMEGAand$SIGMAline.Names are substituted by
THETA(n),ETA(n)andERR(n)in model records ($PK,$PRED,$ERROR,$DES,$AES).Once a name appears on the left-hand side of an assignment, it is no longer substituted on subsequent right-hand sides (WFN rule).
$OMEGA BLOCKstructures are handled correctly.
Examples
if (FALSE) { # \dontrun{
# Convert a WFN extended control stream
out <- nm_convert_ctl("C:/analyses/run001_wfn.ctl")
# Then run with nmpilot
log <- nm_run(
ctl = out,
nmfe_path = "C:/nm76g64/run/nmfe76.bat",
analysis_dir = "C:/analyses"
)
} # }