PML learning

Hello

I’m a new to PML and I’m attending the PML school webinars.

I actually have a code but i want to write the same in the PML so I need help in it.

The code is-

dV/dt = Q * Cp + jiv * I - jvi * V

dI/dt = jvi * V - jiv * I

Cp = A * e^(- a * t) + B * e^(- b * t)

jiv = jvi/s

I = Tumor concentration * Vi

V = Vascular concentration * Vv

s = Vi/Vv

q1.FF = (Aexp(-at) + Bexp(-bt))*fu

flux(2,4) = k(2,4) * q4

k(2,4)=k(4,2)/s

flux(4,2) = k(4,2) * q2

flux(2,1) = k(2,1) * q1

k(2,1)=Q

flux(0,4) = k(0,4) * q4

s1 = q4/(Vv*s)

FF = (Aexp(-at) + Bexp(-bt))*fu

flux(V,I) = k(V,I) * I

k(V,I)=k(I,V)/s

flux(I,V) = k(I,V) * V

flux(V,FF) = k(V,FF) * FF

k(V,FF)=Q

flux(0,I) = k(0,I) * I

s1 = I/(Vv*s)

s1 is the tumor sampling site

For the compartmental model:

dX1/dt = k21 * X2 + k41 * X4 - (k12 + k10 + k13) * X1

dX2/dt = k12 * X1 - k21 * X2

dX3/dt = k13 * X1 - k34 * X3

dX4/dt = k34 * X3 - k41 * X4

flux(1,4) = k(1,4) * q4

flux(4,3) = k(4,3) * q3

flux(3,1) = k(3,1) * q1

flux(2,1) = k(2,1) * q1

flux(1,2) = k(1,2) * q2

flux(0,1) = k(0,1) * q1

ex1.bolus = 0.0

ex1.infusion = 0.0

s5 = q4/v4

s4 = q4/v4

s3 = q4/v4

s2 = q1/v1

s1 = q1/v1

s1 and s2 are sample concentration from central compartment q1 or X1.

s3, s4 and s are smple concentrations from tumor compartment q4 or X4.

Your question is about direct translation of your code into PML code. If you want to do that you may want to follow two simple rules:

  1. for differential equations, please use the deriv() statement, e.g.

your code:

dX1/dt = k21 * X2 + k41 * X4 - (k12 + k10 + k13) * X1

would become:

deriv(X1= k21 * X2 + k41 * X4 - (k12 + k10 + k13) * X1)

  1. for algebraic equations, please enter as is, e.g.

your code:

s5 = q4/v4

would still be:

s5 = q4/v4

At the PML School we are trying to adopt a different way of modeling, not just simple translation, but a stepwise buildup of your model. We would start your model by building up the PK model from the built-in options, in this case a 3-compartment model with IV input and micro parametrization:

We would then switch to Graphical Model Builder and add a second dosepoint (e.g. IV Infusion), another compartment (the 4th one), you adjust the flows and parameter names between the compartments and end up with this:

This covers the PK part of you model. It is not quite clear how you add the first part of your code to the PK model. Perhaps you can add more description or a graphical representation of your model that would allow us to incorporate that into the model

Bernd

Thank you for the quick reply.

Actually I want the PML code to be written for the model that you can find in the attachment.

Dosing is done in the central compartment by IV bolus

The graphical model that I showed in my reply is more or less reflecting the tumor model that you showed in your picture. I have renamed the parameters in the graphical model and rearranged the compartments so that you can see the similarity:

If you have a dataset you might want to try the model that is included in the Phoenix project file. There are actually two Phoenix models, the PK model that I showed in my previous response and the tumor model where I simply changed the parameter names.

PML Learning.phxproj (144 KB)

Bernd

Thank you Bernd for your suggestions and support. It has helped me alot.
I have tried the model but it is not executing when I’m using dose instead of concentration.
I’m also attaching the Phoenix project file with the work done.

PML Learning.phxproj (422 KB)

A few things:

  1. I have setup the Tumor Model as Simulation not as a simple fitting run. So I changes this under the Run Options tab.

  2. There is no observation in the model, so I had to add a continuous observation and linked this object to the central compartment.This allows you to map your measured amounts in the Main input

  3. The dose information does not seem to be correct:

your dose is 50 mg

but your first observation shows 58 mg!

I guess you need to adjust for the body weight.

Can you please check and get back.

Thanks,

Bernd

You might also consider providing the observations as concentrations instead of amounts.

Bernd

Thank You for the support.

The model is running now.

I want to predict tumor concentration using this model so the driving force of the drug into the tumor is product of Plasma flow and Concentration in the central compartment and the drug follows 2 compartment model so I want this 2 compartment equation to be included while determining the concentration in the C3 compartment.

Cl3 (please see phoenix project file) = Q*C1 ; where

Q= plasma flow

C1= Ae^-at + Be^-bt

I’m attaching phoenix project file as well as an article for better understanding.

PML Learning.phxproj (702 KB)26074-72685-1-PB.pdf (1.09 MB)

Hey there!

A Santa’s gift:

test(){

C = A * exp(-Alpha * t) + B * exp(-Beta * t)

ForcingFunction = C * Q

Av = delay(ForcingFunction, Tlag)

deriv(Ai = Jvi * Av - Jiv * Ai - Jio * Ai)

Cv = Av / Vv

Ci = Ai / Vi

error(CEps = 0.1)

observe(CObs = C + C * CEps)

observe(CiObs = Ci + Ci * CEps)

stparm(

A = tvA

Alpha = tvAlpha

B = tvB

Beta = tvBeta

Tlag = tvTlag

Vi = tvVi

Vv = Vi / r

Jvi = tvJvi

Jiv = tvJiv

Jio = tvJio

)

fixef(

tvA = 4.34

tvAlpha = 0.055

tvB = 0.72

tvBeta = 0.0019

tvTlag = 25

r (freeze) = 3.875

Q (freeze) = 28.8

tvVi = 32.7

tvJvi = 0.151

tvJiv = 0.03897

tvJio = 1.85

)

}

I didn’t add the population distributions, you can add it by yourself with ranef/stparm using presented CVs.

I also added a tiny proportional error, it’s up to you to use it or not in simulations.

Please note delay() is something new in PHX7, it would not work in PHX6.4

Kindly suggest to visit some Serge Guzy’s courses!

He’s a Guru of Phoenix simulations!

All the best,

Mittyright

Hi Nehabatra,

regarding delay statement which I used here:

In the article you sent there is a sentence:

In addition, we introduced a lag time (Tlag) to account for a delayed appearance of the drug in the tumor. The Tlag was estimated by a curve feathering method and subtracted from the time profile of the tumor concentrations.

In PHX6.4 you can use only transit statement (transit compartments) which is closer to the distributed delay. AFAIK there’s no common way to get the simple delay in PHX6.4 (maybe some manipulations with sequence? Not sure…)

As I mentioned before this is something new in PHX7 (THX to developers!)

Please follow the PML User’s guide for description:

delay( , )
Outputs the value that had at the corresponding time in the past (). must be a non-negative expression and can be estimated. If is negative, it is treated as zero, since future values cannot be known.
Delay statements assume an initial value of zero and work by keeping a table of past values of the expression captured at times when the ODE solver was “on trajectory”
(which includes change points like doses) and by using linear interpolation into that table.

If you’re interested in delay modeling, please look at the Shuhua Hu’s presentation

https://www.youtube.com/watch?v=YCXIW_uxTrs

BR,

Mittyright

Thanks Mittyright.

But still Im not able to write the code in PML as Im facing the problem of incorporating the biexponential equation in the tumor compartment. I need help to write it down and it will be a great help for me.

dV/dt = Q * Cp + jiv * I - jvi * V

dI/dt = jvi * V - jiv * I

Cp = A * e^(- a * t) + B * e^(- b * t)

jiv = jvi/s

I = Tumor concentration * Vi

V = Vascular concentration * Vv

s = Vi/Vv

q1.FF = (Aexp(-at) + Bexp(-bt))*fu

flux(2,4) = k(2,4) * q4

k(2,4)=k(4,2)/s

flux(4,2) = k(4,2) * q2

flux(2,1) = k(2,1) * q1

k(2,1)=Q

flux(0,4) = k(0,4) * q4

s1 = q4/(Vv*s)

FF = (Aexp(-at) + Bexp(-bt))*fu

flux(V,I) = k(V,I) * I

k(V,I)=k(I,V)/s

flux(I,V) = k(I,V) * V

flux(V,FF) = k(V,FF) * FF

k(V,FF)=Q

flux(0,I) = k(0,I) * I

s1 = I/(Vv*s)

s1 is the tumor sampling site

For the compartmental model:

dX1/dt = k21 * X2 + k41 * X4 - (k12 + k10 + k13) * X1

dX2/dt = k12 * X1 - k21 * X2

dX3/dt = k13 * X1 - k34 * X3

dX4/dt = k34 * X3 - k41 * X4

flux(1,4) = k(1,4) * q4

flux(4,3) = k(4,3) * q3

flux(3,1) = k(3,1) * q1

flux(2,1) = k(2,1) * q1

flux(1,2) = k(1,2) * q2

flux(0,1) = k(0,1) * q1

ex1.bolus = 0.0

ex1.infusion = 0.0

s5 = q4/v4

s4 = q4/v4

s3 = q4/v4

s2 = q1/v1

s1 = q1/v1

s1 and s2 are sample concentration from central compartment q1 or X1.

s3, s4 and s are smple concentrations from tumor compartment q4 or X4.

Waiting for a reply :slight_smile:

Hi Nehabatra,

Did you investigate the code I posted before?

I do not get all the lines of your code, the image is the similar to the article scheme.

Please see the project attached with simulation of the subject using typical values presented in the article.

I strongly suggest to visit Serge Guzy’s NLME courses.

BR,

Mittyright

nehabatra.phxproj (352 KB)

Thanks Mittyright !

yeah I need to attend this course. Can you give me more information about it??

Hi Nehabatra,

Both classroom and on demand (i.e. online training) courses are listed here.

http://www.certarauniversity.com/lms/

probably any of the intermediate or advanced courses would help you

Simon

Thanks Simon!! :slight_smile: