Description Usage Arguments Details Value Note Author(s) References See Also Examples
Metadata from successful model runs, e.g. NONMEM, comes in various formats, some of which are version dependent. NONMEM6 and 7 outputs are interconverted with support for the conventional run log format as well as a universal format.
1 2 3 4 5 6 7 8 | runlog()
unilog()
as.runlog.file(file, ...)
as.unilog.lst(file, run, tool, ...)
as.unilog.pxml(x, run, tool = 'nm7', ...)
as.unilog.runlog(x, tool = 'nm6', ...)
as.runlog.unilog(x, ...)
as.file.runlog(x, file = 'NonmemRunLog.csv', header = FALSE, quote = FALSE, na = '.', ...)
|
x |
data.frame in runlog or unilog format |
file |
file name for metadata file, e.g. ‘NonmemRunLog.csv’, ‘3.lst’ |
header |
whether to include column names in output |
quote |
whether to quote cell contents |
na |
string to represent |
... |
passed arguments |
run |
name (number) of the model run corresponding to the data |
tool |
the tool that created the metadata: currently ‘nm6’ or ‘nm7’ |
These functions are not typically needed by the user, since rlog
serves as an interface.
Metadata may reside in ‘lst’ files (NONMEM primary output), in ‘NonmemRunLog’
files (created for NONMEM6 by metrumrg INFN routine) or in ‘ext’ files (NONMEM7
secondary output). as.unilog.lst
, as.runlog.file
, and as.pxml.ext
(documented elsewhere) read these formats. pxml is an internal xml format
produced by as.pxml.ext
and converted to unilog by as.unilog.pxml
.
The runlog format by convention has the columns: prob, moment, min,
cov, mvof, p1...pn,
and (possibly) run
. p1
through pn
are (an arbitrary number
of) parameters for that run. The others give, respectively, the problem statement,
a flag to identify relative standard error percent, minimization status, covariance
status, minimum value of the objective function, and run name (number). The primary
values for each variable are given in a single record. Where available, a
second record gives ‘PRSE’, with non-informative entries as necessary. Usually the
header is not present in files.
The unilog format is fully normalized. It has the columns: tool, run, parameter,
moment, value
. Moment is, for instance, ‘estimate’ or ‘prse’. Typically
all cells are filled and meaningful. The value column is handled as text for
maximum compatibility across data types. The term ‘parameter’ is used informally:
several items typically captured are not really parameters per se.
Unilog and runlog formats are interconvertible via as.runlog.unilog
and
as.unilog.runlog
. as.file.runlog
creates the traditional disk file from the
runlog format; writing unilog to disk is left to conventional strategies.
runlog
and unilog
return zero-row data.frames with the corresponding formats.
as.file.runlog
is used for side effects. All others return data.frame
in the runlog or unilog format.
These functions are not vectorized: their first arguments are expected to represent a single model run.
As of 5.18, as.unilog.run tries to give a more meaningful value of 'min' than just 1 or 0 for NONMEM 7. Not supported on NONMEM 7.1.2, since it requires the .xml file available under 7.2.
Tim Bergsma
http://metrumrg.googlecode.com
as.unilog.run
rlog
as.pxml.ext
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 | runlog()
unilog()
ext <- c(
'TABLE NO. 1: First Order: Goal Function=MINIMUM VALUE OF OBJECTIVE FUNCTION',
' ITERATION THETA1 THETA2 THETA3 SIGMA(1,1) OMEGA(1,1) OBJ',
' 0 1.70E+0 1.02E-1 2.90E+1 0.00E+0 1.17E+0 11.570086639848398',
' 2 1.78E+0 1.06E-1 3.05E+1 0.00E+0 1.08E+0 9.377909428896904',
' 4 1.91E+0 1.05E-1 3.14E+1 0.00E+0 8.96E-1 8.983605357031118',
' 6 1.94E+0 1.01E-1 3.20E+1 0.00E+0 9.06E-1 8.940731060922468',
' 8 1.93E+0 1.01E-1 3.20E+1 0.00E+0 8.99E-1 8.940110966224346',
' 10 1.94E+0 1.01E-1 3.20E+1 0.00E+0 8.99E-1 8.940101673144566',
' 11 1.94E+0 1.01E-1 3.20E+1 0.00E+0 8.99E-1 8.940101673144566',
' -1000000000 1.94E+0 1.01E-1 3.20E+1 0.00E+0 8.99E-1 8.940101673144566',
' -1000000001 6.28E-1 7.36E-3 1.25E+0 0.00E+0 5.44E-1 0.'
)
file <- textConnection(ext)
pxml <- as.pxml.ext(file)
close(file)
pxml
unip <- as.unilog.pxml(pxml,run=3)
unip
runlogfile <- c(
'1001 2 compartment base,, 0, 1, 0.1439E+5, 0.2E+1, 0.4E+1, 0.2E+1, 0.5E+1,
0.1E+1, 0.0E+0, 0.0E+0, 0.0E+0, 0.0E+0, 0.0E+0, 0.1E+0, 0.0E+0, 0.0E+0,
0.0E+0, 0.0E+0, 0.0E+0, 0.0E+0, 0.0E+0, 0.0E+0, 0.0E+0, 0.0E+0, 0.0E+0,
0.0E+0, 0.0E+0, 0.0E+0, 0.3E+0, 0.1E+1, 0.0E+0, 0.0E+0, ,',
'1001 2 compartment base,RSE,,,,0,0,0,0,0,0,0,0,0,0, 0.0E+0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0, 0.0E+0, 0.0E+0,0,0, ,'
)
runlogfile <- sub('\n','',runlogfile)
file <- textConnection(runlogfile)
rlg <- as.runlog.file(file)
close(file)
rlg
as.runlog.unilog(unip)
as.unilog.runlog(rlg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.