LAGTIME MODEL PHOENIX

At an earlier date I wrote a lag time model with multiple lags as compartments. This was done in WinNonlin not Phoenix WinNonlin. Emily Colby converted it over to a Phoenix model (attached).

As it is set up it is a model for simulations and it works for multiple doses entered. However the first step it to do a fitting (simple) to times and plasma concentration. I am wondering how this was done in the Phoenix environment.

I am wondering how I could do that. I am thinking that it has to be rewritten a little to get it to do that.

Please can I be advised,

Angus

LagTime model.phxproj (376 KB)

Dear Angus

I worked on your data quite a lot as I was confused with your parameter override you used (I did not see it) set and model and I am attaching the project .

See last 3 models.

First, in order to avoind confusion, I deleted the override statement you had where you put initial parameters in the parameter table which override the parameters hwoing in the fixed effects table.

This created ocnfusion and may be a part of the problem.

I simulated data with 2 doses and fit using both the graphical way and also using the transit statement which really simplifies everything. I did it with both the population check box and without. All gave same results.

First, I used a common klag parameter as using 6 different will lead to non identifiability.

Second, once you have same klag you can sue the transit statement that simplifies the code.

The code for the transit is written in the ladt 3 models with the explanation too.

I fit both your model you defined graphically and using the transit statement and I got similar results.

Let me know if I can assist you with anything else .

No issue here. You can use the transit statement with single and multiple doses. The advantage is that you can estimate the number of transit compartments rather than fixing it. Also, way less code.

Best Regards

Serge

LagTime_01stSeq_SavicTransit_serge_august_2016.phxproj (2.9 MB)

Serge: Thank you for your work and my apologies about not getting back to you right away. I was swept away over the weekend by a tidal wave of work for an NDA submission.

I do not have the population PK module so to simplify the work I want to remove pop pk parts in the models. I am trying to follow the flow of the data and understand what is going on. My problems begin at External Sources: I do not see where Table 01 from transit statement_sim_2_doses comes from. It is used for the other work. I have looked for it in the results for transit statement_sim_2 doses results window including the CSV files and I do not see it. Also can you overview for me the simple definition of this transit statement and the results you get out of it in the most basic terms….it uses a transit compartment…….

Angus

Dear Angus

Table01 from transit statement sim 2 doses is created by using the add sim table option.

click on run options and you will see on the right table. Click on table and you will see the times and variables that were requested.

Then table01 is created and can be seen in the result tab

transit statement has the following terms here

Z8 is the last compartment in the chain. This is the last compartment that receive flow of drug with the same transfer rate I called Klag.

If you look at the model I called simlagtime_same_tlag_graphical, you will see the graphical way to describe these transit compartments. The only difference is that with the transit statement, the number of transit compartments is variable and can be a real number. Also it can be different for each patient (random variable).

Now look at the model I called simlagtime_same_tlag_graphical.

You see first that compartments Z2 to Z7 are similar in the sense that they all have an output equal to KLAG * by the concentration of the compartment. These are the transit compartments.

If you would remove all of them assuming there is no transit compartment at all, you would come back to the simple one compartment model with first absorption (You see that?). The central compartment would get K01*Z1 as input and Z1 gets a dose Z1 and that is it. Simple one compt with extravascular input

Now because these compartments Z2 to Z7 behave similarly, we create a way to handle those with a statement and moe sophisticated mathematical formulations allowed also to deal with real compartment numbers that are not integers(not important at this point).

Then to have the program understanding the model you want the define, the first question is to ask is the name of the compartment that last receives input from the transit compartments. This is of course Z8 as the transit compartments are from Z2 to Z7.

transit(Z8,..

Now the next argument is the mean transit time. It is the time a molecule spent in average in the transit space.

It is linked to the number of transit compartments (ntr+1) and the transfer rate we called here Klag.

mtt=(ntr+1)/Klag. If ntr=0, it means that you have one transit compartment. Therefore ntr+1 is the number of transit compartments.

The next argument is ntr where ntr+1 is the number of transit compartments

From now the remaining argument have an equal sign and therefore the order is not important and they are also optional unlike the first 3 arguments.

Now if I would not have any transit compartment, the flow that would get into the plasma compartment would be K01*Z1 (agree?).

This flow now has been moved upward as the first compartment that feeds the first transit compartment (Z2).

Therefore to enable that with the transit compartment, we added an in = rate expression you can fill.

in= means the rate at which the drug enters the first transt compartment is equal to and you fill the equal to.

Here the “equal to” is K01* Z1 because this is the rate at which the drug enters Z2.

If you want the in= expression allows to take the rate that would have feed Z8 if there were no transit compartments and now feed Z2.

The next optional expression is max= where max is the maximum number of transit compartments.

It is good to put a number not too large if you know it is the case because the program will go from 1 to max number of transit compartment during optimization and it can take time.

Finally you have out= which is the rate at which the drug leaves the last compartment that receives input from the transit compartments which is Z8 (receives input form Z7).

Now because all the transit compartments are hidden and cannot be used in the differential equation setting (Z2 to Z7) cannot be used, you cannot write a differential equation for Z8 because Z8 receives input from Z7.

Therefore we added the out= expression that allows you to tell the rate at which the drug leaves the last compartment that recievs input from the transit compartments.

This is of course K01*Z8.

That is it.

hope it helps.

best

Serge

Serge: Thanks. I am focusing on "Table01 from transit statement sim 2 doses is created by using the add sim table option. click on run options and you will see on the right table. Click on table and you will see the times and variables that were requested.

Then table01 is created and can be seen in the result tab"

I unchecked the pop PK box. I do see the Table 01 and it has 10 rows between 2 and 48 hours exactly as requested by simulation Table as you indicated: now when I look at EXTERNAL DATA object I see that that Table with exactly the same name has 49 rows of data: so I am puzzled by the difference. Surely the EXTERNAL DATA is the source data? so where did the 49 rows come from ?

Were they calculated at an earlier date?

Angus

Hi Angus,

" EXTERNAL DATA object I see that that Table with exactly the same name has 49 rows of data: so I am puzzled by the difference. Surely the EXTERNAL DATA is the source data? so where did the 49 rows come from ?

Were they calculated at an earlier date?"

My assumption would be yes, remember that the external objects are ‘static’ that is once published to will not be updated as outside the workflow. my guess is Serge ran it once with a seq(0,48,1) statement and published to the Data folder. However the current iteration has been run with specifed times of 2,4,6,8,12,24,30,36,42,48 as indicated in screen shot, hence only 10 lines.

Does that clear things up?

Simon

(in fact you can see this in the last two history lines for this object;

2016.08.26 05:30:23 UTC

and

2016.08.26 05:09:11 UTC

Phoenix Build 6.4.0.768
Plugins.DME, Version=1.4.0.906

test(){
deriv(Z1 = - (Z1 * K01))

last transit compartment is Z8

mtt=(ntr+1)/klagcommon

To use thhe transit compartment, we need to use the following syntax

#transit( , , [, max = nnn] [, in = ] [, out = ] )

final compartment name is Z8

mean transrit time is mtt but defined as (ntr+1)/klagcommon where ntr+1

ntr+1 is the number of transit stages, 6 here (Z2 to Z7), ntr=5

max is not mandatory but is the max number of stages

in is the input rate into the first transit compartmnt which is k01*Z1

out is the output rate from the final compartment (Z8) which is -k10*Z8

Therefore we can write

mtt=(ntr+1)/klagcommon
transit(Z8,mtt,ntr,max=10,in=K01Z1, out=-K10Z8)

dosepoint(Z1)
C = Z8 / V
error(CEps = 0.1)
observe(CObs = C *(1+ CEps))

fixef(ntr(freeze)=c(,5,))
stparm(K01 = tvK01)
stparm(V = tvV)
stparm(K10 = tvK10)
stparm(klagcommon = tvklagcommon)
fixef(tvK01 = c(, 0.0606015, ))
fixef(tvV = c(, 500000, ))
fixef(tvK10 = c(, 0.586913, ))
fixef(tvklagcommon = c(, 0.58, ))
}

override test(){
fixef(tvK01 = c(,0.413298,))
fixef(tvV = c(,1498630,))
fixef(tvK10 = c(,0.413309,))
}

id(“zzzDummyId”)
time(“Time”)
obs(CObs<-“conc”)
simtbl(file=“simtbl01.csv”,time(seq(0,48,1)),C,CObs)

id(“zzzDummyId”)
time(“Time”)
dose(Z1<-“Z1”, “Z1 Rate”)

Run Options
Method: Naive-pooled
N Iter:1000
Input sorted by subject+time
Enabling automatic log transform (if applicable)
ODE solver method: matrix exponent
Confidence Level %95
Simulation was performed

Number of points in simulation: 144
Max value of indep. var.: 120
Y variable (ex. C): C
Simulate also at observed times (ivar): Yes

Phoenix Build 6.4.0.768
Plugins.DME, Version=1.4.0.906

test(){
deriv(Z1 = - (Z1 * K01))

last transit compartment is Z8

mtt=(ntr+1)/klagcommon

To use thhe transit compartment, we need to use the following syntax

#transit( , , [, max = nnn] [, in = ] [, out = ] )

final compartment name is Z8

mean transrit time is mtt but defined as (ntr+1)/klagcommon where ntr+1

ntr+1 is the number of transit stages, 6 here (Z2 to Z7), ntr=5

max is not mandatory but is the max number of stages

in is the input rate into the first transit compartmnt which is k01*Z1

out is the output rate from the final compartment (Z8) which is -k10*Z8

Therefore we can write

mtt=(ntr+1)/klagcommon
transit(Z8,mtt,ntr,max=10,in=K01Z1, out=-K10Z8)

dosepoint(Z1)
C = Z8 / V
error(CEps = 0.1)
observe(CObs = C *(1+ CEps))

fixef(ntr(freeze)=c(,5,))
stparm(K01 = tvK01)
stparm(V = tvV)
stparm(K10 = tvK10)
stparm(klagcommon = tvklagcommon)
fixef(tvK01 = c(, 0.0606015, ))
fixef(tvV = c(, 500000, ))
fixef(tvK10 = c(, 0.586913, ))
fixef(tvklagcommon = c(, 0.58, ))
}

override test(){
fixef(tvK01 = c(,0.413298,))
fixef(tvV = c(,1498630,))
fixef(tvK10 = c(,0.413309,))
}

id(“id”)
time(“Time”)
obs(CObs<-“conc”)
simtbl(file=“simtbl01.csv”,time(2,4,6,8,12,24,30,36,42,48),C,CObs)

id(“zzzDummyId”)
time(“Time”)
dose(Z1<-“Z1”, “Z1 Rate”)

Run Options
Method: FOCE ELS
N Iter:1000
Input sorted by subject+time
Enabling automatic log transform (if applicable)
ODE solver method: matrix exponent
Seed: 14300
Method of computing standard errors: Central Diff
Hessian standard errors
Confidence Level %95
Maximum number of adaptive gaussian quadrature steps: 1
Performed Predictive check simulation
Predictive Check Options ##############
Main###
Number of replicates for predictive check: 1
Directory to which data files will be copied:
Stratification###
Binning###
Quantiles###
Quantiles are desired :5,50,95

Thanks Simon: I am trying to follow the basic data flow. Of course it has to have been run at an earlier date and transferred. I think I need a glossary of the terms used.

Angus