Title: | Pharmacometric Model Building Using 'shiny' |
---|---|
Description: | Develop Nonlinear Mixed Effects (NLME) models for pharmacometrics using a 'shiny' interface. The Pharmacometric Modeling Language (PML) code updates in real time given changes to user inputs. Models can be executed using the 'Certara.RsNLME' package. Additional support to generate the underlying 'Certara.RsNLME' code to recreate the corresponding model in R is provided in the user interface. |
Authors: | James Craig [aut, cre], Mike Talley [aut], Shuhua Hu [ctb], Certara USA, Inc [cph, fnd] |
Maintainer: | James Craig <[email protected]> |
License: | LGPL-3 |
Version: | 3.0.1 |
Built: | 2024-12-21 05:37:12 UTC |
Source: | https://github.com/cran/Certara.RsNLME.ModelBuilder |
modelBuilderUI()
and create resulting metamodelUsed by Pirana to run modelBuilderUI()
, saving the
resulting metamodel e.g., .mmmdl file given model building operations performed in GUI.
create_metamodelBuiltin(metamodelFile, datafile, author = "")
create_metamodelBuiltin(metamodelFile, datafile, author = "")
metamodelFile |
File where the metamodel should be created. |
datafile |
File with input data. |
author |
Optional character string to specify the author in the metamodel. |
NLME PML model S4 class instance
if (interactive()) { tmp_data <- tempfile(fileext = ".csv") write.csv(Certara.RsNLME::pkData, tmp_data, row.names = FALSE) create_metamodelBuiltin( "run1.mmdl", tmp_data ) }
if (interactive()) { tmp_data <- tempfile(fileext = ".csv") write.csv(Certara.RsNLME::pkData, tmp_data, row.names = FALSE) create_metamodelBuiltin( "run1.mmdl", tmp_data ) }
modelTextualUI()
and run shiny applicationUsed by Pirana to send existing metamodel to modelTextualUI()
for
editing, and after returning, saves it as a metamodel file e.g, .mmdl.
create_metamodelTextual(metamodelFile)
create_metamodelTextual(metamodelFile)
metamodelFile |
Path to existing metmodel file. |
If DOSING CYCLE
block is presented in the metamodel, it will be
transferred to COLDEF
block with a warning.
Updated metamodel text.
if (interactive()) { mmdl_file <- system.file("vignettesdata/OneCpt_IVInfusion.mmdl", package = "Certara.RsNLME") create_metamodelTextual( mmdl_file ) }
if (interactive()) { mmdl_file <- system.file("vignettesdata/OneCpt_IVInfusion.mmdl", package = "Certara.RsNLME") create_metamodelTextual( mmdl_file ) }
Shiny GUI to examine the model and evaluate estimates for fixed effects.
estimatesUI(model, host = NULL)
estimatesUI(model, host = NULL)
model |
Model object. |
host |
Optional host parameter of class |
A model object of class NlmePmlModel
if (interactive()) { library(Certara.RsNLME) host <- hostParams( parallelMethod = "None", hostName = "local", numCores = 1 ) model <- pkmodel( parameterization = "Clearance", absorption = "Intravenous", numCompartments = 2, data = pkData, ID = "Subject", A1 = "Amount", CObs = "Conc", Time = "Act_Time", modelName = "pk_model" ) model <- estimatesUI(model, host) }
if (interactive()) { library(Certara.RsNLME) host <- hostParams( parallelMethod = "None", hostName = "local", numCores = 1 ) model <- pkmodel( parameterization = "Clearance", absorption = "Intravenous", numCompartments = 2, data = pkData, ID = "Subject", A1 = "Amount", CObs = "Conc", Time = "Act_Time", modelName = "pk_model" ) model <- estimatesUI(model, host) }
Shiny application to build RsNLME model from Shiny GUI and generate corresponding RsNLME code based on input selections.
modelBuilderUI( data, modelName = "PKPDmodel", workingDir = "", baseModel = NULL )
modelBuilderUI( data, modelName = "PKPDmodel", workingDir = "", baseModel = NULL )
data |
Input dataset. |
modelName |
Name of the model; if |
workingDir |
Working directory to run the model. Current working directory
will be used if |
baseModel |
The model object from where the input dataset and model name are recovered if
arguments |
A model object of class NlmePmlModel
if (interactive()) { model <- modelBuilderUI(data = Certara.RsNLME::pkData, modelName = "PK_Model") }
if (interactive()) { model <- modelBuilderUI(data = Certara.RsNLME::pkData, modelName = "PK_Model") }
Shiny application to update RsNLME model from Shiny GUI and directly edit PML statements using Ace editor. Syntax and semantic check is performed by TDL executable (if presented). The Shiny application also allows adding input options and column mappings from Shiny GUI.
modelTextualUI(baseModel, initpml, data, modelName = "PKPDmodel")
modelTextualUI(baseModel, initpml, data, modelName = "PKPDmodel")
baseModel |
The model object from where the information is recovered. |
initpml |
Initial PML model file to be edited. Overrides
|
data |
Input data frame.
Overrides |
modelName |
Name of the model; if |
A model object of class NlmePmlModel
if (interactive()) { model <- modelBuilderUI(data = Certara.RsNLME::pkData, modelName = "PK_Model") model <- modelTextualUI(baseModel = model) }
if (interactive()) { model <- modelBuilderUI(data = Certara.RsNLME::pkData, modelName = "PK_Model") model <- modelTextualUI(baseModel = model) }