Adds a terminal metabolite: a logit-normal fraction fm (initial 0.5)
of the parent elimination flux, (cl / v) * central ("clv") or
kel * central ("kel"; "auto" uses clv when both variables
exist), forms d/dt(<metab>) <- fm * <flux> - (clm / vm) * <metab>
with concentration <concentration> <- <metab> / vm. The parent
elimination is unchanged, so fm < 1 is parent cleared by other routes.
Usage
addMetabolite(
ui,
central = "central",
metab = "metab",
cl = "cl",
v = "vc",
kel = "kel",
clm = "clm",
vm = "vmc",
fm = "fm",
concentration = "Cm",
parameterization = c("auto", "clv", "kel"),
model
)Arguments
- ui
The model as a function (or something convertible to an rxUi object)
- central
central compartment name
- metab
name of the metabolite compartment
- cl
parent clearance variable (
clvparameterization)- v
parent central volume variable (
clvparameterization)- kel
parent elimination rate variable (
kelparameterization)- clm
metabolite clearance variable
- vm
metabolite volume variable
- fm
fraction of the parent elimination that forms the metabolite
- concentration
metabolite concentration variable name
- parameterization
how to read the parent elimination:
"auto","clv"or"kel"- model
Deprecated alias for
ui. Supplyingmodelinstead ofuistill works but emits a deprecation warning.
See also
Other Metabolite building blocks:
removeMetabolite()
Examples
pk1cmtDes <- function() {
ini({
lka <- 0.45; label("Absorption rate (Ka)")
lcl <- 1; label("Clearance (CL)")
lvc <- 3.45; label("Central volume of distribution (V)")
propSd <- 0.5; label("Proportional residual error (fraction)")
})
model({
ka <- exp(lka)
cl <- exp(lcl)
vc <- exp(lvc)
kel <- cl / vc
d/dt(depot) <- -ka * depot
d/dt(central) <- ka * depot - kel * central
Cc <- central / vc
Cc ~ prop(propSd)
})
}
pk1cmtDes |> addMetabolite()
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> ── rxode2-based free-form 3-cmt ODE model ──────────────────────────────────────
#> ── Initalization: ──
#> Fixed Effects ($theta):
#> lka lcl lvc propSd lclm lvmc logitfm
#> 0.45 1.00 3.45 0.50 0.10 0.10 0.00
#>
#> States ($state or $stateDf):
#> Compartment Number Compartment Name
#> 1 1 depot
#> 2 2 central
#> 3 3 metab
#> ── Model (Normalized Syntax): ──
#> function() {
#> ini({
#> lka <- 0.45
#> label("Absorption rate (Ka)")
#> lcl <- 1
#> label("Clearance (CL)")
#> lvc <- 3.45
#> label("Central volume of distribution (V)")
#> propSd <- c(0, 0.5)
#> label("Proportional residual error (fraction)")
#> lclm <- 0.1
#> label("Metabolite clearance (Clm)")
#> lvmc <- 0.1
#> label("Metabolite volume (Vm)")
#> logitfm <- 0
#> label("Fraction of the parent elimination forming metab (fm)")
#> })
#> model({
#> vmc <- exp(lvmc)
#> clm <- exp(lclm)
#> ka <- exp(lka)
#> cl <- exp(lcl)
#> vc <- exp(lvc)
#> kel <- cl/vc
#> d/dt(depot) <- -ka * depot
#> d/dt(central) <- ka * depot - kel * central
#> fm <- expit(logitfm, 0, 1)
#> d/dt(metab) <- fm * (cl/vc) * central - (clm/vmc) * metab
#> Cm <- metab/vmc
#> Cc <- central/vc
#> Cc ~ prop(propSd)
#> })
#> }
