Transit compartment codes

Hi, I am building a population Pk model for an oral drug. The plasma concentration-time curve suggests two compartments for the Structural model. Adding a Tlag function to delay absorption has improved the fit; however, I believe modeling the absorption process using transit compartments models will improve the general fitting of the model. I need help to write the codes for the Transit compartments for extravascular administration with two compartments. I really appreciate help and suggestions.

Thanks

Have you considered using a delay function instead?

https://onlinehelp.certara.com/phoenix/8.3/index.html#t=topics%2FDiscrete_and_distributed_delays.htm&rhsearch=delay&rhhlterm=delay&rhsyns=%20

You did not provide an example Phoenix project file. Let me start with a standard 2-comp oral model in PML:


test(){
deriv(A1 = - (Cl * C) + (Aa * Ka)- (Cl2 * (C - C2)))
deriv(Aa = - (Aa * Ka))
deriv(A2 = (Cl2 * (C - C2)))
C = A1 / V
dosepoint(Aa, idosevar = AaDose, infdosevar = AaInfDose, infratevar = AaInfRate)
C2 = A2 / V2
error(CEps = 1)
observe(CObs = C + CEps)
stparm(V = tvV * exp(nV))
stparm(Cl = tvCl * exp(nCl))
stparm(Ka = tvKa * exp(nKa))
stparm(V2 = tvV2 * exp(nV2))
stparm(Cl2 = tvCl2 * exp(nCl2))
fixef(tvV = c(, 1, ))
fixef(tvCl = c(, 1, ))
fixef(tvKa = c(, 1, ))
fixef(tvV2 = c(, 1, ))
fixef(tvCl2 = c(, 1, ))
ranef(diag(nV, nCl, nKa, nV2, nCl2) = c(1, 1, 1, 1, 1))
}


For a transit compartment, just add a transit statement:


test(){
#deriv(Aa = - (Aa * Ka))
transit(Aa, mtt, ntr, max=50, out=-Aa*Ka)
deriv(A1 = - (Cl * C) + (Aa * Ka)- (Cl2 * (C - C2)))
deriv(A2 = (Cl2 * (C - C2)))
C = A1 / V
dosepoint(Aa, idosevar = AaDose, infdosevar = AaInfDose, infratevar = AaInfRate)
C2 = A2 / V2
error(CEps = 1)
observe(CObs = C + CEps)
stparm(V = tvV * exp(nV))
stparm(Cl = tvCl * exp(nCl))
stparm(Ka = tvKa * exp(nKa))
stparm(V2 = tvV2 * exp(nV2))
stparm(Cl2 = tvCl2 * exp(nCl2))
stparm(mtt = tvmtt)
stparm(ntr = tvntr)
fixef(tvV = c(, 1, ))
fixef(tvCl = c(, 1, ))
fixef(tvKa = c(, 1, ))
fixef(tvV2 = c(, 1, ))
fixef(tvCl2 = c(, 1, ))
fixef(tvmtt = c(,1,))
fixef(tvntr= c(,1,))
ranef(diag(nV, nCl, nKa, nV2, nCl2) = c(1, 1, 1, 1, 1))
}


For the delay-function that Keith suggested, a few additional changes need to be done:


test(){
#deriv(A1 = - (Cl * C) + (Aa * Ka)- (Cl2 * (C - C2)))
#deriv(Aa = - (Aa * Ka))
delayInfCpt( A1, mtt, ntr, out = - Cl*C - (Cl2 * (C - C2)))
deriv(A2 = (Cl2 * (C - C2)))
C = A1 / V
dosepoint(A1, idosevar = AaDose, infdosevar = AaInfDose, infratevar = AaInfRate)
C2 = A2 / V2
error(CEps = 1)
observe(CObs = C + CEps)
stparm(V = tvV * exp(nV))
stparm(Cl = tvCl * exp(nCl))
#stparm(Ka = tvKa * exp(nKa))
stparm(V2 = tvV2 * exp(nV2))
stparm(Cl2 = tvCl2 * exp(nCl2))
stparm(mtt = tvmtt)
stparm(ntr = tvntr)
fixef(tvV = c(, 1, ))
fixef(tvCl = c(, 1, ))
#fixef(tvKa = c(, 1, ))
fixef(tvV2 = c(, 1, ))
fixef(tvCl2 = c(, 1, ))
fixef(tvmtt = c(,5,))
fixef(tvntr= c(,10,))
ranef(diag(nV, nCl, nKa, nV2, nCl2) = c(1, 1, 1, 1, 1))
}


Please let us know if you run into issues.

Bernd

the online help has more background about PML syntaxt if you have not found this yet; https://onlinehelp.certara.com/phoenix/8.3/index.html#t=topics%2FPML_-_Transit_compartment_models.htm

Thanks, kniefort for your suggestion! I will try it.

Thanks, Bernd, for providing codes for both models, I really appreciate your help!!

Thanks Simon for sharing the link!

Bernd

I have a follow up question regarding the model with delay function, why do not we estimate absorption rate constant in this model?

Thanks

David,

you don’t need Ka with delay function: you are dosing directly into the systemic compartment (A1). The delay function will cause the amounts of compound to appear in the systemic compartment to be delayed, see A1 vs Time of a simulated profile:

Bernd

Thanks, Bernd, for the explanation

Hi

Hi Bernd,

Appreciate for the code! I tried to modified it to a one-compartment model, here is my code:

test(){
	deriv(A1 = - (Cl * C) + (Aa * Ka))  
	transit(Aa, mtt, ntr, max=50 ,out=-Aa*Ka)
	dosepoint(Aa)
	C = A1 / V
	ktr=(ntr+1)/mtt 
	error(CEps = 0.1)
	observe(CObs = C * (1 + CEps))
	stparm(Ka = tvKa * exp(nKa))
	stparm(V = tvV * exp(nV))
	stparm(Cl = tvCl * exp(nCl))
	stparm(mtt = tvmtt)
	stparm(ntr = tvntr)
	fixef(tvKa = c(, 1, ))
	fixef(tvV = c(, 2.14, ))
	fixef(tvCl = c(, 0.73, ))
	fixef(tvmtt=c(, 1, ))
	fixef(tvntr=c(0, 1, )) 
	ranef(diag(nV, nCl, nKa) = c(1, 1, 1))
}

However, my theta estimate for ntr is a little off, CI includes negative value (I specified ntr should >0 in the code).

I am wondering what’s wrong with my code, thanks!

Hi,

I don’t think there is anything wrong with your code. CI with negative values just indicates that this parameter is not identifiable with the data at hand. If you can share the data, we can investigate. You can send to support@certara.com if you don’t want to share publicly.

Bernd

Hi Bernd,

Thanks for the quick reply! It would be really helpful to get some suggestions from you, I attached my project.

I tried adding Tlag, using the transit model (“1comp Transit”) or the delay-function (“1comp Transit delayed”) you mentioned before.