Learn R Programming

babelmixr2

The goal of babelmixr2 is to convert nlmixr2 syntax to other commonly used tools.

Installation

You can install the released version of babelmixr2 from CRAN with:

install.packages("babelmixr2")

You can install from r-universe by:

# Download and install babelmixr2 in R
install.packages('babelmixr2',
                 repos = c(
                   nlmixr2 = 'https://nlmixr2.r-universe.dev',
                   CRAN = 'https://cloud.r-project.org'))

Otherwise you can always install from GitHub:

What you can do with babelmixr2

Babelmixr2 can help you by:

  • Running your nlmixr2 model in a commercial nonlinear mixed effects modeling tool like NONMEM or Monolix

  • Convert your NONMEM model to a nlmixr2 model (in conjunction with nonmem2rx)

  • Convert you Monolix model to a nlmixr2 model (in conjunction with monolix2rx)

  • Calculate scaling factors and automatically add initial conditions based on non-compartmental analysis (using PKNCA)

  • Perform Optimal design using nlmixr2 as an interface to PopED

Monolix Setup

While not required, you can get/install the R ‘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, R can run ‘Monolix’ directly instead of using a command line.

PKNCA Example

After installed, if you use the standard interface, you can obtain new initial estimates with PKNCA:

mod <-
  nlmixr2(
    nlmixrFun, nlmmixrData, est = "pknca",
    control = pkncaControl(concu = "ng/mL", doseu = "mg", timeu = "hr", volumeu = "L")
  )

Monolix example

With babelmixr2 loaded, you can use nlmixr2 to convert a nlmixr2 model to Monolix, run with monolix, and import back to nlmixr2 with the following:

mod <- nlmixr(nlmixrFun, nlmmixrData, est="monolix")

NONMEM example

With babelmixr2 loaded you can use nlmixr2 to convert a nlmixr2 model to NONMEM, run NONMEM and import back to nlmixr2 with the following:

mod <- nlmixr(nlmixrFun, nlmmixrData, est="nonmem")

Copy Link

Version

Install

install.packages('babelmixr2')

Monthly Downloads

702

Version

0.1.6

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Matthew Fidler

Last Published

January 20th, 2025

Functions in babelmixr2 (0.1.6)

.setupPopEDdatabase

Setup the poped database
nmGetDistributionMonolixLines

This is a S3 method for getting the distribution lines for a base rxode2 saem problem
nlmixr2Est.pknca

Estimate starting parameters using PKNCA
getStandardColNames

Determine standardized rxode2 column names from data
modelUnitConversion

Unit conversion for pharmacokinetic models
nmGetDistributionNonmemLines

This is a S3 method for getting the distribution lines for a base rxode2 saem problem
popedControl

Control for a PopED design task
popedMultipleEndpointResetTimeIndex

Reset the Global Time Indexer for Multiple Endpoint Modeling
popedMultipleEndpointParam

Populates Multiple Endpoint Parameters for internal solving
reexports

Objects exported from other packages
rxToMonolix

Convert RxODE syntax to monolix syntax
simplifyUnit

Simplify units by removing repeated units from the numerator and denominator
rxToNonmem

Convert RxODE syntax to NONMEM syntax
popedGetMultipleEndpointModelingTimes

Get Multiple Endpoint Modeling Times
.popedCluster

Internal function to use with PopED to run PopED in parallel on Windows
bblDatToMonolix

Convert nlmixr2-compatible data to other formats (if possible)
babelBpopIdx

Get the bpop_idx by variable name for a poped database created by babelmixr2
babel.poped.database

Expand a babelmixr2 PopED database
as.nlmixr2

Convert an object to a nlmixr2 fit object
.popedSolveIdME

Solve poped problem for appropriate times with single/multiple endpoint models
.popedF

Get the function value from the rxode2 solve
.popedSetup

Setup the PopED environment
.popedRxRunSetup

Setup poped if needed
.popedFree

Free Poped memory (if any is allocated)
nonmemControl

NONMEM estimation control
pkncaControl

PKNCA estimation control
monolixControl

Monolix Controller for nlmixr2
.popedW

Get the weight from the rxode2 solve