Reset AUC compartment at each dose event #996
-
Dear Mrgsolve community, I have a question on how to reset the AUC compartment values at each dose event. I would like to calculate the cumulative drug exposure (AUC) during a dose interval and use this AUC value for subsequent PD model. I wish the AUC compartment to be reset at each dose event. I have tried to use evid=3 but that flag resets the whole system rather than AUC compartment. Could you please instruct me which method I can use to reset only the AUC compartment? Many thanks in advance! There is the example codes for the PK and AUC sections.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @mark0935git - I think the NONMEM way would be to turn the compartment off and then on again. We can do it a little simpler in mrgsolve. See the suggestions below ... two approaches, one using the data and one using just the model. library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(mrgsolve)
#>
#> Attaching package: 'mrgsolve'
#> The following object is masked from 'package:stats':
#>
#> filter Reset the AUC compartmentIn NONMEM, we’d turn the compartment off then on. With code <- '
[PARAM] CL = 1, V1 = 20, Q = 5, V2 = 100
[INIT] @annotated
CENT: 0 : central cmt (ug)
PERI: 0 : peripheral cmt (ug)
AUC: 0 : cumulative AUC during a dose interval
[ODE]
dxdt_CENT = -(CL/V1)*CENT - (Q/V1)*CENT + (Q/V2)*PERI;
dxdt_PERI = (Q/V1)*CENT - (Q/V2)*PERI;
dxdt_AUC = CENT/V1;
'
mod <- mcode("code", code, end = 120)
#> Building code ... done. Just the dose (no reset) dose <- ev(amt = 100, ii = 24, addl = 3)
mrgsim(mod, dose) %>% plot() Create reset events reset <- ev(amt = 0, ii = 24, addl = 3, evid = 8, cmt = 3) We combined these together reset_dose <- c(reset,dose) %>% realize_addl()
reset_dose
#> Events:
#> time amt ii addl cmt evid
#> 1 0 0 0 0 3 8
#> 2 0 100 0 0 1 1
#> 3 24 0 0 0 3 8
#> 4 24 100 0 0 1 1
#> 5 48 0 0 0 3 8
#> 6 48 100 0 0 1 1
#> 7 72 0 0 0 3 8
#> 8 72 100 0 0 1 1 We don’t need the reset at time 0; won’t hurt to leave it in reset_dose <- filter(reset_dose, !(time==0 & evid==8))
reset_dose
#> Events:
#> time amt ii addl cmt evid
#> 1 0 100 0 0 1 1
#> 2 24 0 0 0 3 8
#> 3 24 100 0 0 1 1
#> 4 48 0 0 0 3 8
#> 5 48 100 0 0 1 1
#> 6 72 0 0 0 3 8
#> 7 72 100 0 0 1 1 Simulate and plot out1 <- mrgsim(mod, reset_dose)
plot(out1) Another model-based approachHere, we don’t need to reset AUC; we just keep track of the value at code2 <- '
[PARAM] CL = 1, V1 = 20, Q = 5, V2 = 100
[INIT] @annotated
CENT: 0 : central cmt (ug)
PERI: 0 : peripheral cmt (ug)
AUC: 0 : cumulative AUC during a dose interval
[ MAIN ]
if(NEWIND <= 1) double last_auc = 0;
[ODE]
dxdt_CENT = -(CL/V1)*CENT - (Q/V1)*CENT + (Q/V2)*PERI;
dxdt_PERI = (Q/V1)*CENT - (Q/V2)*PERI;
dxdt_AUC = CENT/V1;
[ TABLE ]
if(EVID==1) last_auc = AUC;
capture dAUC = AUC - last_auc;
'
mod2 <- mcode("code2", code2, end = 120)
#> Building code2 ... done.
out2 <- mrgsim(mod2, dose)
plot(out2, CENT+dAUC ~ time) plot(out1, CENT+AUC ~ time) library(ggplot2)
sim1 <- as_tibble(out1)
sim2 <- as_tibble(out2) The two methods give the same result ggplot() +
geom_line(data = sim1, aes(time,AUC)) +
geom_point(data = sim2, aes(time,dAUC), color = "firebrick") +
theme_bw() Created on 2022-06-18 by the reprex package (v2.0.1) |
Beta Was this translation helpful? Give feedback.
Hi @mark0935git -
I think the NONMEM way would be to turn the compartment off and then on again. We can do it a little simpler in mrgsolve. See the suggestions below ... two approaches, one using the data and one using just the model.
Reset the AUC compartment
In NONMEM, we’d turn the compartment off then on. With
mrgsolve, we can u…