Description Usage Arguments Details Value Note Author(s) References See Also Examples
NONR
executes, from R, a NONMEM run for which there exists a compatible (see note)
control stream. Supported platforms include MS Windows and
Unix-like operating systems (Nix). Special support is included for Sun Grid
Engine with Nix. Defaults are currently chosen for NONMEM 7.3. Generally,
NONMEM needs to be installed using NMQual
(http://nmqual.googlecode.com). See also autolog.pl
.
Execution on the Nix grid requires
the installation of Sun Grid Engine v6. Following a successful NONMEM
run NONR
can call PLOTR
to create diagnostic plots (pdf format) and/or
run a user-written script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | NONR(
run,
...,
command,
project = getwd(),
wait = TRUE,
grid = FALSE,
concurrent = grid & wait,
udef= FALSE,
invisible=udef,
compile = TRUE,
execute = TRUE,
split = FALSE,
checkrunno = TRUE,
checksum = TRUE,
diag = wait,
fdata = TRUE,
logtrans = FALSE,
nice= TRUE,
epilog = NULL,
dvname = NULL,
grp = NULL,
grpnames = NULL,
cont.cov = NULL,
cat.cov = NULL,
par.list = NULL,
eta.list = NULL,
missing = -99,
interface='autolog.pl',
q=NA,
pe=NA
)
|
run |
vector of control stream names. Typically integer.
e.g. 1:10 corresponds to 1.ctl, 2.ctl, ... 10.ctl. Character names are supported,
especially '001' etc. But beware! Names with non-digit characters may match patterns
in |
command |
path for a script to run NONMEM, e.g.,
If |
project |
directory in which run-specific subdirectories will be created. Typically also contains original control streams. Use an absolute path (safer) or specify relative to the current working directory. |
wait |
If |
grid |
whether NONMEM execution should be wrapped in a call to Sun Grid Engine's
|
concurrent |
Should the runs represented by elements of As of version 5.22, this argument defaults to |
udef |
a logical indicating whether |
invisible |
|
compile |
whether to compile NONMEM (i.e., make nonmem.exe). Set to |
execute |
whether to execute the compiled NONMEM (i.e., invoke nonmem.exe).
Set to |
split |
whether to compile and execute as separate steps. If both
compile and execute are |
checkrunno |
whether to check/correct the control stream to
ensure that standard uses of the NONMEM control stream name match the
name listed in ‘Standard’ uses currently include: the first word after $PROB(LEM) (not counting RUN or RUN\#); ‘*.tab’ (case insensitive); ‘*par.tab’ (case insensitive); ‘*.msf’ (case insensitive) except on a line that starts with $MSFI. |
checksum |
If |
diag |
whether to plot standard diagnostic plots. Default: |
fdata |
whether to attempt deletion of NONMEM files FDATA and
PRDERR. Default: |
logtrans |
passed to PLOTR |
nice |
whether the NONMEM run directory, based on |
epilog |
user-defined function or script to call at end of NONR or PLOTR.
A non-null argument that cannot be coerced by |
dvname |
name of the dependent variable to use as a label for the diagnostic plots. Default: DV. |
grp |
passed to |
grpnames |
passed to |
cont.cov |
passed to |
cat.cov |
passed to |
par.list |
passed to |
eta.list |
passed to |
missing |
passed to |
interface |
the name of a function to prepare NONMEM command lines |
q |
choice of queue, passed to |
pe |
choice of parallelization environment, passed to |
... |
additional arguments passed to functions that accept them. For example,
you can pass Flags recognized
by Sun Grid Engine's |
NONR
is currently implemented as a wrapper that calls runNonmem
for each
element in run
. It creates a like-named subdirectory for each
run in project
. It looks for <run>.ctl
in project
,
cleans it up as necessary, and writes it to the subdirectory, in which context
NONMEM is invoked (using runCommand
). The output of NONMEM will be
‘<run>.lst’ in the subdirectory. Files matching patterns in purgeRunDir:standard
will
be removed (unless you pass purge=FALSE
as a dots argument: see entry above for ...). Attempts will be made to run PLOTR
and epilog
.
Then a ‘complete’ message is printed.
As of version 5.22, parallelization is directly supported.
<run>.pnm
is copied to the subdirectory, if present in the
same directory as <run>.ctl
. If not, template.pnm
is copied to the subdirectory
(if present in the same directory as <run>.ctl
) and is renamed <run>.ctl
.
Use an NMQual-mediated NONMEM installation that expects this convention.
File names and locations can be manipulated somewhat, i.e., by over-riding
runNonmem
's defaults for rundir
, outfile
, streams
,
ctlfile
, and remove
.
an invisible list of the results of calls to runNonmem
Specific control stream syntax is expected
when running NONR
and the other functions present in the metrumrg package.
The list of syntax requirements are as follows.
$PROB should be followed by ‘RUN\#’ then a number representing the control stream number. No commas should be used in the $PROB statement. ‘PROBLEM’ is an alternative for ‘PROB’. The run number is the first space-delimited alphanumeric sequence after PROB(LEM), ignoring RUN(\#). No ampersands are allowed in the problem statement.
The datafile name and relative path needs to be on the first line of the $DATA record immediately following ‘$DATA’.
A relative datafile path must be specified relative to runNonmem:rundir
, typically a subdirectory
of project
. For example, ‘3.ctl’ will actually run as ‘path/project/3/3.ctl’; if
its datafile is ‘path/data/DATA3’, then 3.ctl should specify
“$DATA ../../data/DATA3”.
The NONMEM datafile must contain a ‘C’ column containing only C's or periods(‘.’). Typically this is the first column.
The ‘*.TAB’ file in the “$TABLE” step must contain an EVID column for plotting purposes. In the case of “$PRED” models, this can be a dummy column in the data file.
The NONMEM data file must contain a column with a header of ‘ID’ for plotting purposes.
File paths for ‘MSF’ files and ‘TAB’ files, etc., are generally expected to be relative paths, using ‘/’ as the directory separator. File paths with no separator are assumed to be relative to the directory in which the control stream is run: ‘./’ may be prepended. E.g. “$TABLE EVID FILE=100.tab” is taken as “$TABLE EVID FILE=./100.tab”.
$TABLE statments should include the ONEHEADER option, or problems may result.
Avoid the use of ampersands and greater-than, less-than symbols in comments: they confuse xml processors.
PLOTR
will automatically generate CWRES plots if required files are
present in NONMEM run directory. See help for compute.cwres
for
instructions on generating the files required for CWRES plots. PLOTR
expects etas and model parameters to be output in the ‘*par.TAB’ file and
variables for diagnostic plots to be output in the ‘*.TAB’ file, where
‘*’ represents the control stream number. Additional $TABLE records
can be present in the control stream but these are not used/needed by
PLOTR
. Mechanisms and expectations are somewhat different for NONMEM7.
written by Bill Knebel; modified by Tim Bergsma.
http://metrumrg.googlecode.com
runNonmem
PLOTR
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ## Not run:
#vignette:
metrumrgURL('example/project/script/model.pdf')
#Assuming an NMQual-mediated NONMEM wrapper: /opt/NONMEM/nm72/nmqual/autolog.pl
#Assuming this is some script directory, and contol streams (e.g. 1.ctl) are in
# a sibling directory "nonmem"
#regular run, no grid
path <- '/opt/NONMEM/nm72/nmqual/autolog.pl'
NONR(
run=1,
command=path,
project='../nonmem',
wait=TRUE, #default
grid=FALSE, #default
diag=TRUE #default
)
#regular run on grid
NONR(
run=1,
command=path,
project='../nonmem',
wait=TRUE, #default
grid=TRUE,
diag=TRUE #default
)
#bootstrap run, no grid (uncommon)
NONR(
run=1,
command=path,
project='../nonmem',
wait=FALSE,
grid=FALSE, #default
diag=FALSE #default
)
#bootstrap run on grid
NONR(
run=1,
command=path,
project='../nonmem',
wait=FALSE,
grid=TRUE,
diag=FALSE #default
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.