Follow up on the bioavailablity fraction implementation
Hi Ron, Hope things are OK. I am tying to implement the F (bioav fraction) for an oral drug and I thought it is as simple as adding in the differentials as a ultiplier for the amount in cmt=1. Something like shown below. However, when I look at our put, it looks like the full amount was available at time=0 in cmt=1. what is the right way to implement?
library(devtools) install_github("ronkeizer/PKPDsim") library(PKPDsim)
p_pkpd<- list(KA= 0.613, CL = 17.3, VC = 12.64, VP = 9, Q = 12.9, F=0.44, BSL = 574, gg= 0.00019, lambda= 0.04)
pktgi <- new_ode_model( code = " dAdt[1] = -KAFA[1] dAdt[2] = KAFA[1]-(CL/VC)*A[2]-(Q/VC)*A[2]+(Q/VP)*A[3] dAdt[3] = (Q/VC)*A[2]-(Q/VP)A[3] conc = A[2]/VC dAdt[4] = GG * A[4]-lambdaA[4]*conc ", state_init = "A[4] = BSL;" ) ....
Kindly advise.
Murad
hi Murad,
the trick is to specify bioavailability when you define the dose compartment. PKPDsim then scales the dose with the bioav parameter you specify. It's also best to define the obs. I'll add an example to the docs soon.
With your model:
p_pkpd<- list(KA= 0.613, CL = 17.3, VC = 12.64, VP = 9, Q = 12.9, F=0.44,
BSL = 574, GG = 0.00019, lambda= 0.04)
pktgi <- new_ode_model(
code = "
dAdt[1] = -KA*A[1]
dAdt[2] = KA*A[1]-(CL/VC)*A[2]-(Q/VC)*A[2]+(Q/VP)*A[3]
dAdt[3] = (Q/VC)*A[2]-(Q/VP) * A[3]
conc = A[2]/VC
dAdt[4] = GG * A[4] - lambda * A[4] * conc
",
state_init = "A[4] = BSL;",
dose = list(cmt = 1, bioav = "F"),
obs = list(cmt = 2, scale = "VC"),
parameters = p_pkpd
)
(The model above now compiles fine, I didn't test if the output makes sense.)
Also please note that PKPDsim is now developed at https://github.com/InsightRX/PKPDsim.git. The repository ronkeizer/PKPDsim will not be developed further.
Thanks Murad for the question and Ron for the clarification - this worked. Please note that in the documentation, the example uses scale = F instead of bioav = F. Scale = F does not work while bioav = F does.
Hi Melmelie,
scale relates to the obs argument, while bioav relates to the dose argument. Happy to update docs, but can't find where it is wrong. Can you point me to it?
Hello Ron, You can find the error I am referring to in the following link in the example: http://pkpdsim.ronkeizer.com/variability.html in the line --> dose = list(cmt = 1, scale = "F1i")) I think it should be bioav instead of scale. By the way, I have tried now the approach you recommended and noticed that the simulation does not really factor in the bioavailability. In other words, simulating with F1 = 1 or F1 = 0.1 give me the same result, not sure if I am doing something wrong. I ended up putting a multiplier on the dose itself in the regimen line to reflect fraction available of the dose for now. Thanks for the clarification in advance, Mohamed
Thanks Murad, I see it now. Will fix docs a.s.a.p.
It is strange that this is not working for you, I used similar functionality a week ago. Perhaps try and re-install the latest version of PKPDsim (from InsightRX/PKPDsim not ronkeizer/PKPDsim, since the latter one is now deprecated)?
Ron