Jump to content


Photo
- - - - -

Q&A from Lesson 7: Enterohepatic Recirculation

pml ehc

  • Please log in to reply
7 replies to this topic

#1 bwendt@certara.com

bwendt@certara.com

    Advanced Member

  • Administrators
  • 282 posts

Posted 24 January 2017 - 08:42 AM

Question: Are you fixing the time for release from gall bladder? Would this not be a parameter to be estimated?
Answer: You are right that we have used a constant value (Ri=10 hours) for the time of release from gall bladder.  We did this as it is well defined from the data profile.  But one could also estimate this as a parameter

Question: It appears that the model is applied on data from a single subject, can this be done on a population, when the Ri could be different in each subject.

Answer: Yes, even for a single subject one could have estimated Ri as a parameter.  In population mode one could also put a random effect on Ri as well.

Question: Why did you change C2 to Ct in the modified graphical model?

Answer: This is for notation purposes - C2 is the default name, Ct stands for tissue compartment.

Question: Is the textual model generated automatically from the graphical model?

Answer: Yes, all selections that you make in built-in or graphical mode get written automatically to the model text.

Question: To my understanding you manually need to add the switch variable.

Answer: Correct - the enterohepatic recirculation compartments are added in graphical mode (for convenience) and then the switch is added in Text mode.

Question: In the fixef parameters, what would the third parameter be (after minimum and maximum estimates)?

Answer: The fixef statement asks for a vector with three components as input, the lower bound, the initial estimate and the upper bound, here is an example:

fixef(tV=(lower bound, initial estimate, upper bound))

You can leave the lower and upper bounds blank, since typically the algorithm does not need any boundaries. This is a difference to the legacy PK model engine where boundaries were required.

Question: How do you buildup a model for oral administration instead of IV?

Answer: There are two alternative ways to get to this:

1.    Start from built-in options and adjust the settings as we showed in the demo with one exception: choose extravascular as Administration

 

ehc1.png

 

2.    Switch to graphical mode and add the two compartments for bile and gut plus the two flows.

 

ehc2.png

 

3.    Now, switch to textual model and adjust the textual code as we showed in the demo. You need to remove the additional definition for Ka. Here is the model:

 

ehc3.png

 

4.    When you simulate with the same dose (switched from A1 to Aa) you get the following profile:

 

ehc4.png

 

Question: If you are simulating an oral dose. Do you create an additional GI compartment for the EHC? Or do you just use the GI compartment that you already have in the model?

Answer: As you can see from answer to the previous question you can have a separate absorption compartment for an oral dose. However, you can use the same GI compartment from our initial model.

Here are the steps:

1.    You need to switch back to graphical mode and set the dosepoint in the central compartment to 0

 

ehc5.png

 

2.    Then you add a dosepoint for the GI compartment (renamed to Aa)

 

ehc6.png

 

3.    Finally, you switch to textual model and adjust the model as we did in our demo. The final model text is here:

 

ehc7.png

 

Question: Would the Ka be different for the absorption of the dose and the absorption of the recycled drug?

Question: Can I apply a second Ka for oral absortion?

Answer: One could try fitting different Ka values (e.g. Ka1, Ka2) for immediate absorption and re-absorption, and then if comparable reduce the model to a single Ka.

Question: For multiple emptying, could you not add more to the switch statement instead of dosing or sin functions?

Answer: Yes, you can add constant cycles to the PML, e.g. like:

Ri = 10  # Ri is the time recirculation occurs - Ri=10 from a plot of the data

Rate = Switch / Tau # tau is the duration of time zero order input goes from bile to gut

EHC_cycle = 5 # assumes an average time interval between food uptake of 5 hours

sequence{

                        Switch=0;

                        sleep(Ri);

                        Switch = 1;

                        sleep(Tau)

                        Switch = 0;

                        sleep(EHC_cyle – Tau)

                        Switch = 1;

                        Sleep(Tau)

                        Switch = 0;

            }

 

Question: Can you simulate gall badder emptying every 24h?

Answer: Yes, typically you would just need to expand the time interval within the sequence block to 24 hours. Here is an example:

Ri = 10  # Ri is the time recirculation occurs - Ri=10 from a plot of the data

Rate = Switch / Tau # tau is the duration of time zero order input goes from bile to gut

sequence{

            while(1) {

                        Switch=0;

                        sleep(Ri);

                        Switch = 1;

                        sleep(Tau)

                        Switch = 0;

                        sleep(24 – Ri - Tau)

                        }

            }

I have put a conditional statement into the block since I assume you are thinking about multiple doses. While(1) means: do the loop as long as you have time points in your data set for the specific individual.

 



#2 LLLi

LLLi

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts

Posted 14 March 2017 - 07:20 PM

Hi,

 

I don't understand the while (1) statement in the last Q&A quite well. I found the following wording in the PML guideline, but I am still confused.

• while statements set zero or more statements to be executed while expr is true

 while ( expr ){ statement* }

 

What dose the 1 in the statement mean? Can someone provide an example to clarify the while statement?

 

Any input is appreciated!

 

Thank you!

 

LLLi



#3 bwendt@certara.com

bwendt@certara.com

    Advanced Member

  • Administrators
  • 282 posts

Posted 14 March 2017 - 07:26 PM

While(1) means do the loop as long as you have time points in your data set for the specific individual, this is when you do fitting. In fitting for example, if you have first patient from t=0 to t=20, it means that once the loop reached t=20, it stops. Of course in order to move you need a sleep statement . If you put a while(1) without a sleep statement, you enter an infinite loop and never finishes.

 

Bernd



#4 LLLi

LLLi

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts

Posted 14 March 2017 - 08:26 PM

Hi Bernd, 

 

Thank you for your prompt reply.

 

For the following statement, if we remove while(1), dose this mean that the loop will stop at 24 hours even you have data after 24hr?

 

sequence{

            while(1) {

                        Switch=0;

                        sleep(Ri);

                        Switch = 1;

                        sleep(Tau)

                        Switch = 0;

                        sleep(24 – Ri - Tau)

                        }

            }

 

Thanks!

LLLi



#5 bwendt@certara.com

bwendt@certara.com

    Advanced Member

  • Administrators
  • 282 posts

Posted 16 March 2017 - 03:50 PM

There is no need for the last sleep statement since nothing will change: the Switch will still stay at 0 for whatever data you have after tau. The same sequence loop, i.e. without while(1),  I have been using in the model that was presented in the webinar.

 

Hope, this is clear now.

 

Bernd



#6 0521

0521

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 03 February 2021 - 02:12 AM

Hi support,

 

I think there is something wrong with the code in this case.

 

In this case, the authors claim that the drug in the gallbladder is excreted to the intestine at a zero-order rate, but at a first-order rate in the code.

 

Raw code:

test(){
	double(Switch)  # must declare new variables used in sequence block
	deriv(A1 = - (Cl * C)- (Cld * (C - C2))- (A1 * K1g) + (Agut * Ka))
	urinecpt(A0 = (Cl * C))
	deriv(A2 = (Cld * (C - C2)))
	deriv(Abile = (A1 * K1g)- (Abile * Rate))  # repaced GBr with Rate here
	deriv(Agut = (Abile * Rate)- (Agut * Ka))
	C = A1 / Vc
	dosepoint(A1, idosevar = A1Dose, infdosevar = A1InfDose, infratevar = A1InfRate)
	C2 = A2 / Vt
	error(CEps = 1)
	observe(CObs = C * (1 + CEps))
	Ri = 10  # Ri is the time recirculation occurs - Ri=10 from a plot of the data
	Rate = Switch / Tau # tau is the duration of time zero order input goes from bile to gut
	# the sequence block here is used to turn input to the gut from bile on and off
	sequence{
		Switch=0;
		sleep(Ri);
		Switch = 1;
		sleep(Tau)
		Switch = 0;
	}
	stparm(Vc = tvVc)
	stparm(Cl = tvCl)
	stparm(Vt = tvVt)
	stparm(Cld = tvCld)
	stparm(K1g = tvK1g)
	#stparm(GBr = tvGBr)   # need to delete this
	stparm(Ka = tvKa)
	fixef(tvVc = c(, 13, ))
	fixef(tvCl = c(, 1.2, ))
	fixef(tvVt = c(, 35, ))
	fixef(tvCld = c(, 10, ))
	fixef(tvK1g = c(, 0.7, ))
	#fixef(tvGBr = c(, 1, ))  # need to delete this
	fixef(tvKa = c(, 2.3, ))
	fixef(Tau = c(, 2.8, ))   # need to add this
}

The code should be modified to:

test(){
	double(Switch)  # must declare new variables used in sequence block
	deriv(A1 = - (Cl * C)- (Cld * (C - C2))- (A1 * K1g) + (Agut * Ka))
	urinecpt(A0 = (Cl * C))
	deriv(A2 = (Cld * (C - C2)))
	deriv(Abile = (A1 * K1g)-  Rate)  # repaced GBr with Rate here
	deriv(Agut = (Abile * Rate)-  Ka)
	C = A1 / Vc
	dosepoint(A1, idosevar = A1Dose, infdosevar = A1InfDose, infratevar = A1InfRate)
	C2 = A2 / Vt
	error(CEps = 1)
	observe(CObs = C * (1 + CEps))
	Ri = 10  # Ri is the time recirculation occurs - Ri=10 from a plot of the data
	Rate = Switch / Tau # tau is the duration of time zero order input goes from bile to gut
	# the sequence block here is used to turn input to the gut from bile on and off
	sequence{
		Switch=0;
		sleep(Ri);
		Switch = Agut;
		sleep(Tau)
		Switch = 0;
	}
	stparm(Vc = tvVc)
	stparm(Cl = tvCl)
	stparm(Vt = tvVt)
	stparm(Cld = tvCld)
	stparm(K1g = tvK1g)
	#stparm(GBr = tvGBr)   # need to delete this
	stparm(Ka = tvKa)
	fixef(tvVc = c(, 13, ))
	fixef(tvCl = c(, 1.2, ))
	fixef(tvVt = c(, 35, ))
	fixef(tvCld = c(, 10, ))
	fixef(tvK1g = c(, 0.7, ))
	#fixef(tvGBr = c(, 1, ))  # need to delete this
	fixef(tvKa = c(, 2.3, ))
	fixef(Tau = c(, 2.8, ))   # need to add this
}
The main differences are: 
 
In "deriv" statements, variables change in real time, while in "sequence" statements, variables change only at a specific time. 
Therefore, in the "raw code", the rate of bile excretion Abile/Tau is not a constant in the 10-12 hour period and will change over time; when Ablie is introduced into the excretion rete in the sequence statement, the excretion dose Abile/Tau in the 10-12 hour period will be constant.
 
In the "Modeling discontinuous events" section of the "Phoenix Modeling language Guide", the case of "enterohepatic circulation model" is correct.It is in the "sequence" sentence that he uses the dose in the gallbladder.
1 deriv(a=-a*k10-a*k1b+g*kg1)
# central cpt
2 deriv(b=a*k1b-qbg)
# bile cpt
3 deriv(g=qbg-g*kg1)
# gut cpt
4 real(qbg)
#qbg is flow rate from bile to gut
5 stparm(tCycle=…, tReflux=…)
# times are parameters
# introduce the time sequence:
6 real(i)
7 sequence{
8 i=0;
9 while(i<10){
10 i=i+1;
11 qbg=0;
12 sleep(tCycle-tReflux);
13 qbg=(b/tReflux);
14 sleep(tReflux);
15 qbg=0;
16 }
17 }

Edited by 0521, 03 February 2021 - 02:18 AM.


#7 bwendt@certara.com

bwendt@certara.com

    Advanced Member

  • Administrators
  • 282 posts

Posted 04 February 2021 - 09:27 AM

Nice catch! I agree that in the deriv statement for the bile  we should not multiply the varying amounts of Abile with the rate constant of gallbladder emptying since this will describe indeed a first-order elimination. But why did you put Agut in the sequence statement? You should replace Agut with Abile - the amount of compound in the gallbladder at the start of the gallbladder emptying.  

One further note: when you go back to the book, the authors state "...we would like to caution against assuming zero-order release from bile...", and "Release from bile may not necessarily be a zero-order or a very regular process..." That is why I did investigate a bit further. As you can see in the plot below - these are the differences between the model proposed by the authors (GB_In_Ed, means the influx of compound into the bile as proposed by the book and your model, GB_In_Mod, same with your suggested modification, etc.), the differences are obvious:

GB_In_GB_Out.png

however, looking at the model diagnostics, this does not seem to be significant:

diagnostics.png



#8 0521

0521

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 05 February 2021 - 01:39 AM

Dear bwendt,
 
Thank you for your reply.
 
bwendt :"You should replace Agut with Abile"
0521: Yes, I agree with you. I also made a clerical error here. This is supposed to be "Abile".
 
bwendt :"One further note: when you go back to the book, the authors state "...we would like to caution against assuming zero-order release from bile...", and "Release from bile may not necessarily be a zero-order or a very regular process..." That is why I did investigate a bit further."
0521: I always remember the saying, "all models are wrong, but some are useful.".So, obviously, no matter how we assume the excretion of bile, this is wrong. 
But our code must be able to truthfully express our ideas, which is not the reason for code errors.
The bile excretion mode is set to zero-order rate and first-order rate only because it is the simplest model, that's all.
 
 
By the way, I also have different views on the parameterization of bile compartment in the model.
 
Perhaps the K1g parameter should be parameterized to CL1g, so that it can be better compared with CL, so that the reader can intuitively understand which of the drugs eliminated in the body are eliminated and excreted into the bile.
CL_total=CL_el+CL_1g
F=CL_1g/CL_total
 
Once the model is parameterized, the reader can easily estimate the initial values of the parameters:
CL_total= NCA clearance rate of the first peak.
F= (AUC_all_peaks - AUC _ first_peak)/AUC _ first_peak






Also tagged with one or more of these keywords: pml, ehc

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users