Model libraries are useful to have consistent high-quality basic models that can be used as a model itself or as a building block for other models.
Compartment and parameter names should be all lower case when on their own and should use snakeCase when combined in some way.
Compartment and parameter names are selected to align with those used
by rxode2::linCmt()
which are described in the vignette:
vignette(“rxode2-model-types”, package = “rxode2”).
Compartment naming follows compartment names with the
linCmt()
with augmentation for other compartments:
depot
: The extravascular dosing compartment (for
example, the gut for oral dosing or subcutaneous space for subcutaneous
dosing)central
: The intravascular compartment used for
intravenous dosing or for typical pharmacokinetic (PK) model sampling of
the drugperipheral1
, peripheral2
: The first and
second peripheral compartments for 2- and 3-compartment PK modelseffect
: The compartment for effect compartment
modelsTo enable more consistent cross-model compatibility, the following conventions should be used unless there is a strong reason for an exception:
cp
. cp
should be used even when using a
linCmt()
model (in which case
cp <- linCmt()
should be used and the residual error
should be applied to the cp
parameter).PK models should use the following parameter naming conventions:
ka
: absorption ratecl
: clearanceq
: intercompartmental clearance (central
to and from peripheral1
compartments)q2
: second intercompartmental clearance
(central
to and from peripheral2
compartments)vc
: central volume of distributionvp
, vp2
: first and second peripheral
compartment volumesWhen micro-constants are used, they should use the following naming conventions:
kel
elimination rate (cl/vc
)k12
, k21
, k13
,
k31
: intercompartmental transit rates (q/vc
,
q/vp
, q2/vc
, and q2/vp2
,
respectively)Parameters are often estimated on a transformed scale. For instance, a natural logarithm transform is often used for parameters that must be positive, and a logit transform is often used when a parameter must remain within a specific range.
Transformed parameters should be prefixed with an indicator of the transformation. Preferred transformation prefixes are:
l
(lower case L): natural log transformlogit
: logit transformprobit
: probit transformGenerally, for any transform other than natural logarithm, include
the full name as a prefix. For example, natural logarithm-transformed
ka
would be lka
and logit-transformed
emax
would be logitemax
.
Random effects are estimates as part of a distribution varying by some grouping factor. The grouping factor is often a subject in a clinical trial. (For NONMEM users, random effects are often referred to as inter-individual variability.)
Random effect parameters should prefix the (transformed) parameter
name with eta
. For example, a random effect on
log-transformed clearance would be named etalcl
.
Different drug effects may be investigated during model building. And, multiple drug effect styles (linear, Emax, threshold, etc.) may be investigated by the user.
To enable simpler changes to drug effects and to minimize the chance of parameter name collisions when combining models, the following rules are strongly recommended:
drugEffect
followed by the name of the part of the model
that is most closely associated with the drug effect. For example, in
the Simeoni 2004 model, the drug effect is called
drugEffectCyclingCells
.Files in a model library should have the following characteristics:
description <- "This is the description of the model"
right inside the function()
before the ini({})
block.reference <- "Richard Hooijmaijers, Matthew Fidler, William S. Denney (2022). nlmixr2lib: A Model Library for 'nlmixr2'. https://nlmixr2.github.io/nlmixr2lib/"
"message"
attribute to the model. Note that in that case, you must give the
function name as the last line of the model to ensure that it is the
returned value from evaluation of the file. (See
oncology_xenograft_simeoni_2004.R
for an example of adding
a message.)ini()
and model()
block.If a function to modify, self-start, or otherwise help the user would
make sense, add it as a new file in the R/
directory with
the file name and function name updateModelName()
using the
word update followed by the model name in camelCase
(e.g. updateOncologyXenograftSimeoni2004
). If such a
function is added, please add it in the messages
described
above, as well. Update functions must be able to take in a function, an
rxUi object, or an nlmixr2fitCore object and should usually return an
rxUi object.
For examples, see the package installation directory.