using PumasUtilities
using Random
using Pumas
using CairoMakie
using AlgebraOfGraphics
using CSV
using DataFramesMeta
using Dates
PK21 - Heteroinduction model
1 Background
- Structural model - One compartment oral administration consists of time dependent change in the elimination rate constant.
- Route of administration - Oral
- Dosage Regimen - Nortriptyline (NT) 10 mg (or 10000 μg) oral, three times daily for 29 days (i.e., 696 hours), after 216 hours treatment with an enzyme inducer, i.e. Pentobarbital (PB), for a period of 300 hours, i.e., up until 516 hours of treatment with NT.
- Number of Subjects - 1
2 Learning Outcome
This exercise demonstrates simulating from a heteroinduction model after repeated oral doses with an enzyme inducer for a limited duration.
3 Objectives
To build an oral one-compartment model with enzyme induction where clearance is time dependent, simulate the model for a single subject, and subsequently perform simulation for a population.
Certain assumptions are to be considered:
- The fractional turnover rate, i.e.,
Kout
of the enzyme has a longer half-life than the drug or the inducer - The duration from one level of enzyme activity to others will be influenced by
Kout
of the enzyme - The
Kout
is not regulated by the Pentobarbital. The interpretationV
includes bioavailability (i.e., it is reallyV/F
).
4 Libraries
Load the necessary libraries.
5 Model definition
Note the expression of the model parameters with helpful comments. The model is expressed with differential equations. Residual variability is a proportional error model.
In this one compartment model, we administer the dose in the Depot compartment at time= 0 that is given every 8 hours for 87 additional doses. A second drug, which is an enzyme inducer (Pentobarbital) is added at 216 hours for 300 hours up to 516 hours of treatment with Nortriptyline.
We do not have concentrations of Pentobarbital and hence it is not included in the model.
= @model begin
pk_21 @metadata begin
= "Heteroinduction Model"
desc = u"hr"
timeu end
@param begin
"""
Absorption Rate Constant (1/hr)
"""
∈ RealDomain(lower = 0)
tvka """
Intrinsic Clearance post-treatment (L/hr)
"""
∈ RealDomain(lower = 0)
tvclss """
Lag-time (hrs)
"""
∈ RealDomain(lower = 0)
tvlag """
Intrinsic Clearance pre-treatment (L/hr)
"""
∈ RealDomain(lower = 0)
tvclpre """
Fractional turnover rate (1/hr)
"""
∈ RealDomain(lower = 0)
tvkout """
Volume of distribution (L)
"""
∈ RealDomain(lower = 0)
tvv ∈ PDiagDomain(3)
Ω """
Proportional RUV
"""
∈ RealDomain(lower = 0)
σ²_prop end
@random begin
~ MvNormal(Ω)
η end
@covariates TBP TBP2
@pre begin
= tvka * exp(η[1])
Ka = tvclpre * exp(η[3])
Clpre = tvclss * exp(η[2])
Clss = tvv
Vc = tvkout
Kout = Clpre / Vc
Kpre = Clss / Vc
Kss = Kss - (Kss - Kpre) * exp(-Kout * (t - TBP))
Kperi = Kss - (Kss - Kpre) * exp(-Kout * (TBP2 - TBP))
A = Kpre - (Kpre - A) * exp(-Kout * (t - TBP2))
Kpost = (t < TBP) * Kpre + (t >= TBP && t < TBP2) * Kperi + (t >= TBP2) * Kpost
K10 end
@dosecontrol begin
= (Depot = tvlag,)
lags end
@dynamics begin
' = -Ka * Depot
Depot' = Ka * Depot - K10 * Central
Centralend
@derived begin
= @. (1000 / 263.384) * Central / Vc
cp """
Observed Concentration (nM)
"""
~ @. Normal(cp, sqrt(cp^2 * σ²_prop))
dv end
end
PumasModel
Parameters: tvka, tvclss, tvlag, tvclpre, tvkout, tvv, Ω, σ²_prop
Random effects: η
Covariates: TBP, TBP2
Dynamical system variables: Depot, Central
Dynamical system type: Nonlinear ODE
Derived: cp, dv
Observed: cp, dv
6 Initial Estimates of Model Parameters
The model parameters for simulation are as given below. Note that tv
represents the typical value for parameters.
Ka
- Absorption Rate Constant (1/hr)CLss
- Intrinsic Clearance post-treatment (L/hr),tlag
- Lag-time (hrs),CLpre
- Intrinsic Clearance pre-treatment (L/hr),Kout
- Fractional turnover rate (1/hr),V
- Volume of distribution (L),Ω
- Between Subject Variability,σ
- Residual error.
= (
param = 1.8406,
tvka = 114.344,
tvclss = 0.814121,
tvlag = 46.296,
tvclpre = 0.00547243,
tvkout = 1679.4,
tvv = Diagonal([0.01, 0.01, 0.01]),
Ω = 0.015,
σ²_prop )
7 Dosage Regimen
Dose regimen - Oral dosing of 10 mg or 10000 μg at time=0
that is given every 8 hours for 87 additional doses for a single subject.
= DosageRegimen(10000, cmt = 1, time = 0, ii = 8, addl = 87) ev1
Row | time | cmt | amt | evid | ii | addl | rate | duration | ss | route |
---|---|---|---|---|---|---|---|---|---|---|
Float64 | Int64 | Float64 | Int8 | Float64 | Int64 | Float64 | Float64 | Int8 | NCA.Route | |
1 | 0.0 | 1 | 10000.0 | 1 | 8.0 | 87 | 0.0 | 0.0 | 0 | NullRoute |
8 Single-individual that receives the defined dose
= Subject(
sub1 = 1,
id = ev1,
events = (TBP = 216, TBP2 = 516),
covariates = (cp = nothing,),
observations )
Subject
ID: 1
Events: 88
Observations: cp: (n=0)
Covariates: TBP, TBP2
9 Single-Subject Simulation
Simulate the plasma concentration-time profile with given observation time-points for single subject.
Initialize the random number generator with a seed for reproducibility of the simulation
Random.seed!(123)
Define the timepoints at which concentration values will be simulated.
= simobs(pk_21, sub1, param, obstimes = 0:1:800) sim_sub1
SimulatedObservations
Simulated variables: cp, dv
Time: 0:1:800
10 Visualize Results
@chain DataFrame(sim_sub1) begin
dropmissing(:cp)
data(_) *
mapping(:time => "Time (hours)", :cp => "Concentration (nM)") *
visual(Lines; linewidth = 4)
draw(; figure = (; fontsize = 22), axis = (; xticks = 0:100:800))
end
11 Population Simulation
We perform a population simulation with 48 participants, and simulate concentration values for 72 hours following 6 doses administered every 8 hours.
This code demonstrates how to write the simulated concentrations to a comma separated file (.csv
).
= (
param = 1.8406,
tvka = 114.344,
tvclss = 0.814121,
tvlag = 46.296,
tvclpre = 0.00547243,
tvkout = 1679.4,
tvv = Diagonal([0.0568, 0.0925, 0.0685]),
Ω = 0.04,
σ²_prop
)
= DosageRegimen(10000, cmt = 1, time = 0, ii = 8, addl = 87)
ev1 = map(i -> Subject(id = i, events = ev1, covariates = (TBP = 216, TBP2 = 516)), 1:45)
pop
Random.seed!(1234)
= simobs(
sim_pop
pk_21,
pop,
param,= [
obstimes 0,
168,
171,
172,
175,
216,
360,
361,
363,
365,
368,
384,
432,
504,
505,
507,
509,
552,
600,
696,
697,
699,
701,
704,
],
)
= DataFrame(sim_pop)
pkdata_21_sim #CSV.write("pk_21_sim.csv", pkdata_21_sim)
12 Conclusion
This tutorial showed how to build and simulate from a heteroinduction model after repeated oral dose data on treatment with an enzyme inducer for a limited duration.