write_ModelTemplateTokens {Certara.RDarwin} | R Documentation |
Prints NLME metamodel template file and token json file using given options, filepaths and data
Description
This function generates and writes the model template and tokens files based on the provided inputs.
Usage
write_ModelTemplateTokens(
TemplateFilePath = "template.txt",
TokensFilePath = "tokens.json",
Description = "",
Author = "",
DataFilePath,
DataMapping = NULL,
ColDef = "",
PMLParametersSets,
EstArgs = specify_EngineParams(),
SimArgs = "",
Tables = list(),
AppendixRows = "",
OmegaSearchBlocks = list()
)
Arguments
TemplateFilePath |
TemplateFilePath NLME template file path to be written (usually txt). |
TokensFilePath |
json file path to be written (usually json). |
Description |
A problem name to be outputted in Description section. |
Author |
The author information for the model to be outputted in Author section. |
DataFilePath |
A data file path used by NLME. |
DataMapping |
A named vector ModelTerm = DataTerm for the used data file. |
ColDef |
A character string specifying additional column definitions in NLME column definition format. See https://onlinehelp.certara.com/phoenix/8.4/index.html#t=Phoenix_UserDocs%2FPML%2FColumn_mappings.htm |
PMLParametersSets |
A list of PML parameters sets ( |
EstArgs |
Estimation arguments for the model template. Please use
|
SimArgs |
Simulation arguments for the model template. Please use
|
Tables |
A list of |
AppendixRows |
Additional rows to include in the model template appendix in NLME column definition format. See https://onlinehelp.certara.com/phoenix/8.4/index.html#t=Phoenix_UserDocs%2FPML%2FColumn_mappings.htm |
OmegaSearchBlocks |
A list of character vectors representing omega names to try to build block omegas. |
Details
Terms <DosepointName>_Duration
or <DosepointName>_Rate
could be
used to map rate/duration columns for the current dosepoints. Term
<ObservationName>BQL
could be used to map BQL flag for the current
observation. AMT
term could be used to map different main dosepoints (i.e.
A1 will be mapped for Gamma
, Aa for First-Order
absorption etc.) If AMT
term is used, additional terms Duration
or Rate
could be used; current
function will map it to the main dosepoint of each Parameter set. But it is
possible to map duration/rate for some dosepoint directly using terms
<DosepointName>_Duration
or <DosepointName>_Rate
, it will override
Duration
or Rate
terms mapping for current dosepoint.
Value
A list containing statements written to template and tokens files.
See Also
specify_EngineParams()
, specify_SimParams()
, Table()
Examples
# Write model template and tokens files
PMLParametersSets <- create_ModelPK(CompartmentsNumber = c(1,2))
# write test data frame
TempFolder <- tempdir()
TemplateFilePath <- file.path(TempFolder, "template.txt")
TokensFilePath <- file.path(TempFolder, "tokens.json")
DataFilePath <- file.path(TempFolder, "Data.csv")
write.csv(data.frame(id = 'id',
time = 'time',
AMT = 'AMT',
Conc = 'Conc',
age = 'age',
Weight = 'Weight',
CObsBQL = 'CObsBQL'),
DataFilePath)
write_ModelTemplateTokens(TemplateFilePath = TemplateFilePath,
TokensFilePath = TokensFilePath,
Description = "1-2Cpts try",
Author = "Certara",
DataFilePath = DataFilePath,
DataMapping = c(ID = "id",
time = "time",
CObs = "Conc",
AMT = "AMT",
"age"),
ColDef = "",
PMLParametersSets = PMLParametersSets,
EstArgs = specify_EngineParams(method = "QRPEM"),
SimArgs = specify_SimParams(numReplicates = 1000L),
Tables = list(Table(Name = "simtable1.csv",
KeepSource = TRUE,
VariablesList = "C",
ForSimulation = TRUE)),
OmegaSearchBlocks = list(c("nCl", "nV"), c("nCl2", "nV2")))