Title: | Converts 'Monolix' Models to 'rxode2' |
---|---|
Description: | 'Monolix' is a tool for running mixed effects model using 'saem'. This tool allows you to convert 'Monolix' models to 'rxode2' (Wang, Hallow and James (2016) <doi:10.1002/psp4.12052>) using the form compatible with 'nlmixr2' (Fidler et al (2019) <doi:10.1002/psp4.12445>). If available, the 'rxode2' model will read in the 'Monolix' data and compare the simulation for the population model individual model and residual model to immediately show how well the translation is performing. This saves the model development time for people who are creating an 'rxode2' model manually. Additionally, this package reads in all the information to allow simulation with uncertainty (that is the number of observations, the number of subjects, and the covariance matrix) with a 'rxode2' model. This is complementary to the 'babelmixr2' package that translates 'nlmixr2' models to 'Monolix' and can convert the objects converted from 'monolix2rx' to a full 'nlmixr2' fit. While not required, you can get/install the 'lixoftConnectors' package in the 'Monolix' installation, as described at the following url <https://monolixsuite.slp-software.com/r-functions/2024R1/installation-and-initialization>. When 'lixoftConnectors' is available, 'Monolix' can be used to load its model library instead manually setting up text files (which only works with old versions of 'Monolix'). |
Authors: | Matthew Fidler [aut, cre] , Justin Wilkins [ctb] |
Maintainer: | Matthew Fidler <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.4 |
Built: | 2024-11-29 04:06:12 UTC |
Source: | CRAN |
Read and parse mlxtran lines
mlxtran(file, equation = FALSE, update = FALSE)
mlxtran(file, equation = FALSE, update = FALSE)
file |
mlxtran file to process |
equation |
parse the equation block to rxode2 (some models cannot be translated) |
update |
when true, try to update the parameter block to the final parameter estimates |
mlxtran object
Matthew L. Fidler
# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file("theo", package="monolix2rx") mlx <- mlxtran(file.path(pkgTheo, "theophylline_project.mlxtran")) mlx
# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file("theo", package="monolix2rx") mlx <- mlxtran(file.path(pkgTheo, "theophylline_project.mlxtran")) mlx
Get equation block from a Monolix model txt file
mlxTxt(file, retFile = FALSE)
mlxTxt(file, retFile = FALSE)
file |
string representing the model text file. Can be lib:fileName.txt if library setup/available |
retFile |
boolean that tells |
parsed equation or file name
Matthew L. Fidler
# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file("theo", package="monolix2rx") mod <- mlxTxt(file.path(pkgTheo, "oral1_1cpt_kaVCl.txt")) mod
# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file("theo", package="monolix2rx") mod <- mlxTxt(file.path(pkgTheo, "oral1_1cpt_kaVCl.txt")) mod
Translate a monolix file to rxode2
monolix2rx( mlxtran, update = TRUE, thetaMatType = c("sa", "lin"), sd = 1, cor = 1e-05, theta = 0.5, ci = 0.95, sigdig = 3, envir = parent.frame() )
monolix2rx( mlxtran, update = TRUE, thetaMatType = c("sa", "lin"), sd = 1, cor = 1e-05, theta = 0.5, ci = 0.95, sigdig = 3, envir = parent.frame() )
mlxtran |
file name for mlxtran to translate to rxode2 |
update |
is a boolean that represents if the final parameter estimates should be used for the translation (when present) |
thetaMatType |
This lists the preferred source for |
sd |
Default standard deviation for between subject variability/inter-occasion variability that are missing. |
cor |
Default correlation for missing correlations estimate |
theta |
default population estimate |
ci |
confidence interval for validation, by default 0.95 |
sigdig |
number of significant digits for validation, by default 3 |
envir |
represents the environment used for evaluating the corresponding rxode2 function |
rxode2 model
Matthew L. Fidler
# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file("theo", package="monolix2rx") rx <- monolix2rx(file.path(pkgTheo, "theophylline_project.mlxtran")) pkgCov <- system.file("cov", package="monolix2rx") rx <- monolix2rx(file.path(pkgCov, "warfarin_covariate3_project.mlxtran")) rx
# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file("theo", package="monolix2rx") rx <- monolix2rx(file.path(pkgTheo, "theophylline_project.mlxtran")) pkgCov <- system.file("cov", package="monolix2rx") rx <- monolix2rx(file.path(pkgCov, "warfarin_covariate3_project.mlxtran")) rx