nonmem2rx {nonmem2rx} | R Documentation |
Convert a NONMEM source file to a rxode model (nlmixr2-syle)
Description
Convert a NONMEM source file to a rxode model (nlmixr2-syle)
Usage
nonmem2rx(
file,
inputData = NULL,
nonmemOutputDir = NULL,
rename = NULL,
tolowerLhs = TRUE,
thetaNames = TRUE,
etaNames = TRUE,
cmtNames = TRUE,
updateFinal = TRUE,
determineError = TRUE,
validate = getOption("nonmem2rx.validate", TRUE),
nonmemData = FALSE,
strictLst = FALSE,
unintFixed = FALSE,
extended = getOption("nonmem2rx.extended", FALSE),
nLinesPro = 20L,
delta = 1e-04,
usePhi = TRUE,
useExt = TRUE,
useCov = TRUE,
useXml = TRUE,
useLst = TRUE,
mod = ".mod",
cov = ".cov",
phi = ".phi",
lst = getOption("nonmem2rx.lst", ".lst"),
xml = ".xml",
ext = ".ext",
scanLines = getOption("nonmem2rx.scanLines", 50L),
save = getOption("nonmem2rx.save", NA),
saveTime = getOption("nonmem2rx.saveTime", 15),
overwrite = getOption("nonmem2rx.overwrite", TRUE),
load = getOption("nonmem2rx.load", TRUE),
compress = getOption("nonmem2rx.compress", TRUE),
keep = getOption("nonmem2rx.keep", c("dfSub", "dfObs", "thetaMat", "sigma"))
)
Arguments
file |
NONMEM run file, like an |
inputData |
this is a path to the input dataset (or |
nonmemOutputDir |
This is a path the the nonmem output
directory. When not |
rename |
When not |
tolowerLhs |
Boolean to change the lhs to lower case (default:
|
thetaNames |
this could be a boolean indicating that the theta
names should be changed to the comment-labeled names (default:
|
etaNames |
this could be a boolean indicating that the eta
names should be changed to the comment-labeled names (default:
|
cmtNames |
this could be a boolean indicating that the
compartment names should be changed to the named compartments in
the |
updateFinal |
Update the parsed model with the model estimates
from the |
determineError |
Boolean to try to determine the |
validate |
Boolean that this tool will attempt to "validate" the model by solving the derived model under pred conditions (etas are zero and eps values are zero) |
nonmemData |
Boolean that tells |
strictLst |
The list parsing needs to be correct for a
successful load (default |
unintFixed |
Treat uninteresting values as fixed parameters (default |
extended |
Translate extended control streams from tools like wings for NONMEM |
nLinesPro |
The number of lines to check for the $PROBLEM statement. |
delta |
this is the offset for NONMEM times that are tied |
usePhi |
if present, use the NONMEM phi file to extract etas
(default |
useExt |
if present, use the NONMEM ext file to extract
parameter estimates (default |
useCov |
if present, use the NONMEM cov file to import the covariance, otherwise import the covariance with list file |
useXml |
if present, use the NONMEM xml file to import much of the NONMEM information |
useLst |
if present, use the NONMEM lst file to extract NONMEM information |
mod |
the NONMEM output extension, defaults to |
cov |
the NONMEM covariance file extension, defaults to |
phi |
the NONMEM eta/phi file extension, defaults to |
lst |
the NONMEM output extension, defaults to |
xml |
the NONMEM xml file extension , defaults to |
ext |
the NONMEM ext file extension, defaults to |
scanLines |
number of lines to scan for comment chars when
|
save |
This can be:
|
saveTime |
The time that the translation/validation needs (in secs) before it will save to avoid having to rerun the model (default 15 for 15 seconds) |
overwrite |
is a boolean to allow overwriting the save file
(see |
load |
a boolean that says to load the save file (if it
exists) instead of re-running the translation and validation.
Note if |
compress |
a boolean indicating if the UI should be a
compressed UI. If you are using this for simulation with old
versions of rxode2, the compressed ui is not supported, so this
should be |
keep |
is a character vector of imported model items that are kept in the model itself; The defaults is "sigma" which keeps the sigma matrix in the model itself. You can add rxode2 solving options that are imported from NONMEM to keep in the model. |
Details
Since some of these options you may want to set per project, the following options are queried:
-
nonmem2rx.validate
- boolean to validate the model (default:TRUE
) -
nonmem2rx.lst
- default extension for output (default:.lst
) -
nonmem2rx.save
- should nonmem2rx save the model output? -
nonmem2rx.overwrite
- should nonmem2rx save output be overwritten (defaultTRUE
) -
nonmem2rx.load
- should nonmem2rx load a saved model instead of translating and validating again? (defaultTRUE
) -
nonmem2rx.extended
- should nonmem2rx support extended control streams? (defaultFALSE
) -
nonmem2rx.compress
- should the ui be compressed or uncompressed (default:TRUE
)
Value
rxode2 function
Examples
# You can run a translation without validating the input. This is
# a faster way to import a dataset (and allows the CRAN machines to
# run a quick example)
mod <- nonmem2rx(system.file("mods/cpt/runODE032.ctl", package="nonmem2rx"), lst=".res",
save=FALSE, validate=FALSE, compress=FALSE)
# Though by default you likely wish to validate the input
mod <- nonmem2rx(system.file("mods/cpt/runODE032.ctl", package="nonmem2rx"),
lst=".res", save=FALSE)
mod
# you can plot to compare the pred/ipred differences
plot(mod)
# if you want to see the individual differences
# you can by plotting by page of plots
plot(mod, nrow=2, ncol=2, page=1, log="y")
# or select which pages you want to print
plot(mod, nrow=2, ncol=2, page=c(1,3), log="y")
#' or even all the individuals with
# plot(page=TRUE)
plot(mod, nrow=5, ncol=5, page=TRUE, log="y")
# you can also convert to a nlmixr2 object, but need babelmixr2 for
# that conversion