Skip to content

Error: the complex F is not supported by babelmixr2 #115

@john-harrold

Description

@john-harrold

I'm testing the models in the model library (nlmixr2lib) trying to convert them to different formats. I'm having trouble converting this one to monolix.

library(babelmixr2)
#> Loading required package: nlmixr2
#> Loading required package: nlmixr2data
library(rxode2)
#> rxode2 2.1.3.9000 using 5 threads (see ?getRxThreads)
#>   no cache: create with `rxCreateCache()`
rx_fun = 
function() {
    covariateData <- list(WT = "Body weight in kg")
    description <- "Dupilumab PK model (Kovalenko 2020)"
    reference <- "Kovalenko P, Davis JD, Li M, et al. Base and Covariate Population Pharmacokinetic Analyses of Dupilumab Using Phase 3 Data. Clinical Pharmacology in Drug Development. 2020;9(6):756-767. doi:10.1002/cpdd.780"
    units <- list(time = "day", dosing = "mg")
    ini({
        lvc <- 0.908258560176891
        label("central volume (L)")
        lke <- -2.92994453301599
        label("elimination rate (1/d)")
        lkcp <- -1.54646311327271
        label("central-to-peripheral rate (1/d)")
        Mpc <- 0.686
        label("ratio of kcp and kpc (kpc is peripheral to central rate with units of 1/d)")
        lka <- -1.36257783450257
        label("absorption rate (1/d)")
        lMTT <- -2.25379492882461
        label("mean transit time (d)")
        lVm <- 0.0676586484738149
        label("maximum target-mediated rate of elimination (mg/L/d)")
        Km <- fix(0.01)
        label("Michaelis-Menten constant (mg/L)")
        lfdepot <- -0.441610554744518
        label("Bioavailability (fraction)")
        e_wt_vc <- 0.711
        label("Exponent of weight on central volume (unitless)")
        CcpropSd <- c(0, 0.15)
        label("Proportional residual error (fraction)")
        CcaddSd <- fix(0, 0.03)
        label("Additive residual error (mg/L)")
        etalvc ~ 0.192
        etalke ~ 0.285
        etalka ~ 0.474
        etalvm ~ 0.236
        etamtt ~ 0.525
    })
    model({
        vc <- exp(lvc + etalvc) * (WT/75)^e_wt_vc
        ke <- exp(lke + etalke)
        kcp <- exp(lkcp)
        ka <- exp(lka + etalka)
        MTT <- exp(lMTT + etamtt)
        Vm <- exp(lVm + etalvm)
        kpc <- kcp/Mpc
        ktr <- (3 + 1)/MTT
        d/dt(depot) <- -ktr * depot
        d/dt(transit1) <- ktr * (depot - transit1)
        d/dt(transit2) <- ktr * (transit1 - transit2)
        d/dt(transit3) <- ktr * transit2 - ka * transit3
        d/dt(central) <- ka * transit3 - ke * central - kcp * 
            central + kpc * periph - central * (Vm/(Km + central/vc))
        d/dt(periph) <- kcp * central - kpc * periph
        f(depot) <- exp(lfdepot)
        Cc <- central/vc
        Cc ~ add(CcaddSd) + prop(CcpropSd)
    })
}

rx_obj = rxode2::rxode2(rx_fun)
export_name = "test"

library(tibble)
dataset = 
tribble(
~id,  ~low,  ~time,  ~high,  ~cmt,  ~amt,  ~rate,  ~ii,  ~addl,  ~evid,  ~ss,  ~dur,  ~WT,  ~dv,
  1,    NA,      0,     NA,  'Cc',    NA,     NA,   NA,     NA,      0,   NA,    NA,    1,    0,
  1,    NA,      1,     NA,  'Cc',    NA,     NA,   NA,     NA,      0,   NA,    NA,    1,    0,
  2,    NA,      0,     NA,  'Cc',    NA,     NA,   NA,     NA,      0,   NA,    NA,    1,    0,
  2,    NA,      1,     NA,  'Cc',    NA,     NA,   NA,     NA,      0,   NA,    NA,    1,    0)

res = nlmixr2::nlmixr2(rx_obj, dataset, "monolix", babelmixr2::monolixControl(modelName=export_name, runCommand=NA))
#> Error : the complex F is not supported by babelmixr2
#> Error: the complex F is not supported by babelmixr2

Created on 2024-08-20 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions