Jump to content


Photo

QRPEM fatal error


  • Please log in to reply
50 replies to this topic

#1 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 29 March 2013 - 09:26 PM

Hi Pharsight team,

I've come across a new one for me. I'm attempting to run a target mediated drug disposition model and originally ran the FO method and then ran the ELS. The ELS took a long time to run but after about 20 hours convergence resulted in a plausible estimates for theta. however since standard errors were not computed for the theta's (and we know that publications like to see these in the data we submit) I elected to attempt to run a different algorithmn to see if it made a difference. Unfortunately I received this error:

 

FATAL ERROR IN QRPEM/IMPEM!

 Model not suitable for QRPEM analysis

 Possibly non linear covariate model or

 some other unimplemented feature

 

 

I've also received other errors that simply state the run aborted due to a "Fortran" error...please explain!

 

 

The model I am using is not that complicated as far as textual models go. ive modified a TMDD model proposed by Mager and Jusko in 2002 for a mixed absorption and paramaterized it for clearance as opposed to microconstants.

 

Is there some workarond, or is my model (below) somehow flawed for the QRPEM approach?

thanks

Elliot

 

 

test(){

    deriv(A1 = - (Cl * C) + (Aa * Ka)- (Cl2 * (C - C2)) + (Alymph * dur)-(kon*C*Rf)+(koff*DR) )

    deriv(Aa = - (Aa * Ka))

    deriv(A2 = (Cl2 * (C - C2)))

    deriv(Alymph = - (Alymph * dur))

    deriv(DR=(C*kon*Rf)-(koff+kint)*DR)

    Rf=Rmax-DR

    C = A1 / V

    dosepoint(Aa, bioavail = (F), idosevar = AaDose, infdosevar = AaInfDose, infratevar = AaInfRate)

    C2 = A2 / V2

    error(CEps = 0.50)

    observe(CObs = C * (1 + CEps))

    dosepoint(Alymph, tlag = (Tlag2), bioavail = (1-F), duration = (dur), idosevar = AlymphDose, infdosevar = AlymphInfDose, infratevar = AlymphInfRate)

    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(F = ilogit(tvF + nF))

    stparm(dur = tvdur * exp(ndur))

    stparm(Tlag2 = tvTlag2 * exp(nTlag2))

    stparm(kint = tvkint*exp(nkint))

    stparm(kon = tvkon*exp(nkon))

    stparm(koff = tvkoff*exp(nkoff))

    stparm(Rmax = tvRmax*exp(nRmax))


  • Thomasgaks likes this

#2 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 29 March 2013 - 11:19 PM

Dear Elliott

I looked at your code and found 1 error and 1 line of code to be changed for QRPEM.

 

1: A;ways look at mass balance to construct a valid model.

 

(Alymph * dur) is in 2 differential equations where dur ios defined as the duration of the infusion iinto lymphs (per your model, duration=dur).

 

However dur has units of time and Alymph of amout. The product is therefore amount x time while the left side is amount per unit of time. Therefore it is a big error in the model and I am not sure if all the fitting procedure has a meaning.

Now may be you just wanted to tell the program to infuse after tlag 1-F portion of the dose and this is doe through the statement:

dosepoint(Alymph, tlag = (Tlag2), bioavail = (1-F), duration = (dur), idosevar = AlymphDose, infdosevar = AlymphInfDose, infratevar = AlymphInfRate)

 

 

Now, you still have a transfer between the central and lymph and therefore 2 additional parameters are needed to define that transfer in terms of flow.

 

Now in order to use QRPEM you cannot use the ilogit form (I will tell the dev team to fix that).

you overcome that problem, you can just write the following:

 

stparm(XF = tvXF + nXF)

F=exp(XF)/(1+exp(XF))

 

fixef(tvXF = c(, 0, ))

and in the ranef statement, you will have XF instead of F

    ranef(diag(nV, nCl, nKa, nV2, nCl2, ndur, nTlag2, nXF, nVlymph, nQa1lymph, nkon, nkoff, nkint, nRmax) = c(0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,0.3, 0.3, 0.3, 0.3))

 

 

Of course I do not have your data but I made a simulation just to show you in principle how it works with QRPEM. I do not know if your model is identifiable but anyway this is attached an example showing how you can work it out with QRPEM.

Once you are there, let me know and we will work on the setting of QRPEM.

 

NOTE THAT MAY BE THE ERROR WITH ALYMPH*DUR is the one that made your model problematic.

The project is attached as well as the code below.

 

code:

 

 

 

test(){

    deriv(A1 = - (Cl * C) + (Aa * Ka)- (Cl2 * (C - C2))- (Qa1lymph * (C - Clymph))-(kon*C*Rf)+(koff*DR))

    urinecpt(A0 = (Cl * C))

    deriv(Aa = - (Aa * Ka))

    deriv(A2 = (Cl2 * (C - C2)))

    deriv(Alymph = (Qa1lymph * (C - Clymph)))

    deriv(DR = C*kon*Rf-(koff+kint)*DR)

    C = A1 / V

    dosepoint(Aa, bioavail = (F), idosevar = AaDose, infdosevar = AaInfDose, infratevar = AaInfRate)

    C2 = A2 / V2

    error(CEps = 0.5)

    observe(CObs = C * (1 + CEps))

    Clymph = Alymph / Vlymph

    dosepoint(Alymph, tlag = (Tlag2), bioavail = (1-F), duration = (dur), idosevar = AlymphDose, infdosevar = AlymphInfDose, infratevar = AlymphInfRate)

    Rf = Rmax-DR

    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(Vlymph = tvVlymph * exp(nVlymph))

    stparm(Qa1lymph = tvQa1lymph * exp(nQa1lymph))

    stparm(dur = tvdur * exp(ndur))

    stparm(Tlag2 = tvTlag2 * exp(nTlag2))

    stparm(XF = tvXF + nXF)

F=exp(XF)/(1+exp(XF))

    stparm(kon = tvkon * exp(nkon))

    stparm(koff = tvkoff * exp(nkoff))

    stparm(kint = tvkint * exp(nkint))

    stparm(Rmax = tvRmax * exp(nRmax))

    fixef(tvV = c(, 50, ))

    fixef(tvCl = c(, 5, ))

    fixef(tvKa = c(, 1, ))

    fixef(tvV2 = c(, 50, ))

    fixef(tvCl2 = c(, 5, ))

    fixef(tvVlymph = c(, 50, ))

    fixef(tvQa1lymph = c(, 5, ))

    fixef(tvdur = c(, 5, ))

    fixef(tvTlag2 = c(, 1, ))

    fixef(tvXF = c(, 0, ))

    fixef(tvkon = c(, 1, ))

    fixef(tvkoff = c(, 1, ))

    fixef(tvkint = c(, 1, ))

    fixef(tvRmax = c(, 1, ))

    ranef(diag(nV, nCl, nKa, nV2, nCl2, ndur, nTlag2, nXF, nVlymph, nQa1lymph, nkon, nkoff, nkint, nRmax) = c(0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,0.3, 0.3, 0.3, 0.3))

} [file name=ELLIOT_QRPEM.phxproj size=1603489]http://www.pharsight.com/extranet/media/kunena/attachments/legacy/files/ELLIOT_QRPEM.phxproj[/file]

Attached Files



#3 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 29 March 2013 - 11:35 PM

Thanks for the reply and for pointing out my error.

I want to make sure I understand what you are telling me though.

 

I actually want to show (a) 1st order absorption from Aa and (B) 0 order absorption from Alymph by fitting duration. I want this to occur in parallel as oppoed sequentially.

The predictions using FO and ELS had fit the data very well so thought I had it but guess not.

 

Can you confirm what code would be needed to show this?

Graphically I would want the absorption to look like this:

 

v



#4 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 29 March 2013 - 11:35 PM

Hi Elliott.

Here IS THE VERSION OF THE PROGLRAM THAT YOU SHOULD BE OPEN WITH YOUR OFFICIAL VERSION OF THE PROGRAM.

Standard errors have been working out in the upcoming version of the program and will take way less time than the current one.

Best

Serge [file name=ELLIOT_QRPEM_official_version.phxproj size=1524027]http://www.pharsight.com/extranet/media/kunena/attachments/legacy/files/ELLIOT_QRPEM_official_version.phxproj[/file]

Attached Files



#5 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 29 March 2013 - 11:40 PM

Dear Elliott

The code I sent you is assuming first order absorption of a fraction of the dose followed by tlag2 time later a zero order infusion from the lymph of the remaining fraction of the dose as you requested.

Before you fit, I suggest you to first put the initial estimates based on my code and then click on the initial estimates tab to make sure that each patient observed data is not too far from the average predicted profile you will see. The fact that you got good fit with a bad model is not strange. Apparently the error term had not too much impact but it is still not right to write it 9I hope you agree).

Best Regards;

Serge

 

PS: I cannot see the graph you tried to send me



#6 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 29 March 2013 - 11:42 PM

About seeing that in parallel, you added a tlag for the lymph infusion. Therefore, the first tlag2 time only absorption occurs and then both occur in parallel. Is it what you want to do?

best

Serge



#7 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 29 March 2013 - 11:43 PM

Unfortunately I still cannot open these project files. Not sure why I'm getting locked out.



#8 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 29 March 2013 - 11:50 PM

yes, it is. I had tried parallel absorption with both with Tlag and both without Tlags and this seemed to fit the early part of the curve much better. Of course with a bad model who knows what that means.

 

I am not sure I understand why there is a Qlymph. doesn't that imply bi-directional flow?

In this case there should be only 1 direction so I'm not sure that this is appropriate cause it suggests bi-directional flow.

deriv(Alymph = (Qa1lymph * (C - Clymph)))

Qa1lymph * (C - Clymph)

 

what I want to model is

unidirectional flow from lymph via a zero order absorption from lymph to the central compartment with duration being fit. I suppose I could rather fit k0, if that is easier. it seems easier when switching to graphical but not sure.

 

I would have assumed it would look more like

deriv(Alymph = -Alymph * k0)

 

but I think I'm getting screwed up by the fact that Alymph is also a dosepoint.

 

Can you clarify this for me?



#9 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 30 March 2013 - 12:04 AM

Dear Elliott

You can change from bidirectional to one way flow. That is easy. now the current model you created a template is doing the following.

 

zero order absorption into the lymph for a duration =dur and during that time it goes to the central via first order transfer (just change the equations to reflect one way flow).

A zero order absorption is always linked with a dose point.

Therefore what you have is the fraction of the dose getting in as an infusion into the lymphs and passing then to the central with a rate proportional to lymph amount. Now after the duration of the infusion you still have some amount in the lymphs and it will continue to go to the central. Is it good enough?

best

Serge



#10 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 30 March 2013 - 12:14 AM

Serge,

I think I need it a bit more explanation on how one writes

first order transfer to the lympha and first order transfer from lymph to the central compartment

vs.

0 order transfer to the lymph and 0 order transfer from lymph to the central compartment

vs.

0 order transfer to the lymph and then first order transfer from lymph to the central compartment

 

 

how would these 3 situations be coded textually and how could they be set up graphically?



#11 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 30 March 2013 - 12:26 AM

Dear Elliott

Let us think together about these modeling aspects.

 

first order transfer to the lymph and first order transfer from lymph to the central compartment

 

first order transfer to the lympha : you mean having an absorption compartment linked to the lymph and the absorption is proportional to the amount in that extravascular compartment. This is done by just adding an absorption compartment linked to the lymphs.

 

 first order transfer from lymph to the central compartment: This is called transfer rate from lymph to central and it is just by adding a term in lymph (-ka*Alymph) and ka* Alymph in the mass balance of the central.

 

 

0 order transfer to the lymph and 0 order transfer from lymph to the central compartment: That may be a conceptual problem here. if I am giving a drug infused to the lymph and at the same time infused to the central, it is exactly the same as giving the drug infused into the central compartment because the process does not depend on the amount in lymph or on any other amount. Therefore these 2 zero order processes has no meaning and must be replaced just by the zero order input into the central compartment.

Therefore the model of your choice will depend on how you explain the drug journey into lymphs and plasma. When the drug is given extravascular, what happens in terms of process?

 

 

Is it that a fraction is absorbed by first order into plasma and the other fraction infused into lymphs and then go to plasma via first order? This makes sense to me. All the other one to me are not to be used.

Best

SERGE



#12 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 30 March 2013 - 12:38 AM

Dear Elliott

This is an example of first order absorption into lymph (and central) and then first order from lymph into central (one way). You just add an extravascular compartment that is linked to the lymphs

 

test(){

    deriv(A1 = - (Cl * C) + (Aa1 * Ka1)- (Cl2 * (C - C2)))

    urinecpt(A0 = (Cl * C))

    deriv(Aa1 = - (Aa1 * Ka1))

    deriv(A2 = (Cl2 * (C - C2)) + (Alymph * Klymphcentral))

    deriv(Alymph = (Aa2 * Ka2)- (Alymph * Klymphcentral))

    deriv(Aa2 = - (Aa2 * Ka2))

    C = A1 / V

    dosepoint(Aa1, bioavail = (exp(xf)/(1+exp(xf))), idosevar = Aa1Dose, infdosevar = Aa1InfDose, infratevar = Aa1InfRate)

    C2 = A2 / V2

    error(CEps = 1)

    observe(CObs = C * (1 + CEps))

    Clymph = Alymph / Vlymph

    dosepoint(Aa2, idosevar = Aa2Dose, infdosevar = Aa2InfDose, infratevar = Aa2InfRate)

    stparm(V = tvV * exp(nV))

    stparm(Cl = tvCl * exp(nCl))

    stparm(Ka1 = tvKa1 * exp(nKa1))

    stparm(V2 = tvV2 * exp(nV2))

    stparm(Cl2 = tvCl2 * exp(nCl2))

    stparm(Vlymph = tvVlymph * exp(nVlymph))

    stparm(Ka2 = tvKa2 * exp(nKa2))

    stparm(Klymphcentral = tvKlymphcentral * exp(nKlymphcentral))

    stparm(xf = tvxf + nxf)

    fixef(tvV = c(, 1, ))

    fixef(tvCl = c(, 1, ))

    fixef(tvKa1 = c(, 1, ))

    fixef(tvV2 = c(, 1, ))

    fixef(tvCl2 = c(, 1, ))

    fixef(tvVlymph = c(, 1, ))

    fixef(tvKa2 = c(, 1, ))

    fixef(tvKlymphcentral = c(, 1, ))

    fixef(tvxf = c(, 0, ))

    ranef(diag(nV, nCl, nV2, nCl2, nVlymph, nKa2, nKa1, nKlymphcentral, nxf) = c(1, 1, 1, 1, 1, 1, 1, 1, 1))

}

 

 

Now zero order absorption into lymph for a duration dur and then first order into central is the one we have been talking about

 

 

Finally zero order into lymph and zero order from lymph to central during the same duration is equivalent to put a zero order dose into central for at least the central mass balance. This situation does not make sens to me for the lymph because you give let say 1 mg every second and at the same time these 1 mg in the lymph are transferred to the central. Therefore the net is zero in lymph. That is why it does not make sense to me and the best scenario to model is may be zero roder into lymphs with first order from lymph into central or first order into lymph with first order from lymph into central (first moel above).

I hope it helps.

best

serge



#13 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 30 March 2013 - 12:38 AM

I want to show that mass transfers at two different rates from the subcutaneous space....some directly into the vasculature at first order and some via the lymphatics at a zero order.

 

1st order directly to the central compartment or what I assumed to be -Aa*ka

and 0 order absorption to the lymphatic and then 1st order from lymph to the central compartment. But I'm not sure how to code this zero order part with differentials as a 1-way flow and dosepoinwith a second dosepoint to show it is occuring in parallel with the -Aa*ka

 

I see what you are saying about zero order into lymph and zero order out to central could be a single k0.

 

I guess what Im getting stuck on is how to code the parallel 1st and 2nd order without sticking a dosepoint directly to the central compartment and fitting for duration as opposed to k0.



#14 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 30 March 2013 - 12:44 AM

These are the equations for zero order dose input (fraction 1-F) into lymphs with first order transfer (one way) to central with first order dose input (fraction F) from extravascular to central. You need 2 columns for dose, one called dosecentral and one called doselymph with both having the total same dose (for example if you gave 100 mg, you will have 100 in both column). The F takes care of the split.

 

Best

Serge

 

 

test(){

    deriv(A1 = - (Cl * C) + (Aa1 * Ka1)- (Cl2 * (C - C2)))

    urinecpt(A0 = (Cl * C))

    deriv(Aa1 = - (Aa1 * Ka1))

    deriv(A2 = (Cl2 * (C - C2)) + (Alymph * Klymphcentral))

    deriv(Alymph = - (Alymph * Klymphcentral))

    C = A1 / V

    dosepoint(Aa1, bioavail = (exp(xf)/(1+exp(xf))), idosevar = Aa1Dose, infdosevar = Aa1InfDose, infratevar = Aa1InfRate)

    C2 = A2 / V2

    error(CEps = 1)

    observe(CObs = C * (1 + CEps))

    Clymph = Alymph / Vlymph

    dosepoint(Alymph, tlag = (Tlag2), bioavail = (1-exp(xf)/(1+exp(xf))), duration = (dur), idosevar = AlymphDose, infdosevar = AlymphInfDose, infratevar = AlymphInfRate)

    stparm(V = tvV * exp(nV))

    stparm(Cl = tvCl * exp(nCl))

    stparm(Ka1 = tvKa1 * exp(nKa1))

    stparm(V2 = tvV2 * exp(nV2))

    stparm(Cl2 = tvCl2 * exp(nCl2))

    stparm(Vlymph = tvVlymph * exp(nVlymph))

    stparm(Klymphcentral = tvKlymphcentral * exp(nKlymphcentral))

    stparm(xf = tvxf + nxf)

    stparm(Tlag2 = tvTlag2 * exp(nTlag2))

    fixef(tvV = c(, 1, ))

    fixef(tvCl = c(, 1, ))

    fixef(tvKa1 = c(, 1, ))

    fixef(tvV2 = c(, 1, ))

    fixef(tvCl2 = c(, 1, ))

    fixef(tvVlymph = c(, 1, ))

    fixef(tvKlymphcentral = c(, 1, ))

    fixef(tvxf = c(, 0, ))

    fixef(tvTlag2 = c(, 1, ))

    ranef(diag(nV, nCl, nV2, nCl2, nVlymph, nKa1, nKlymphcentral, nxf, nTlag2) = c(1, 1, 1, 1, 1, 1, 1, 1, 1))

}



#15 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 30 March 2013 - 11:29 AM

Thank you. I will try this and let you know how it works out.

I love this forum!



#16 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 30 March 2013 - 11:39 AM

Actually, two last questions:

(1) why is duration not a fixed effect in this model?

(2) are you assuming bi-directional flow between the lymphatice and central compartment cause it seems that is the case with deriv(A2 = (Cl2 * (C - C2)) + (Alymph * Klymphcentral))

 

(3) it looks like the lymph amount (Alymph) is flowing into the A2, but shouldn't it flow into the central compartment which would be A1?

 

Thanks,

Elliot



#17 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 30 March 2013 - 07:30 PM

Dear Elliott

I made some changes based on your reply

 

first order into lymph and first order from lymph into central (you were right about where it goes). I added also the TMDD part. please review it. Youa re the expert in the model itself. I am just helping you with the implementation.

About the duration of the zero order infusion, it is your call to assume fixed and random or only fixed. IF YOU KNOW THE DURATION , THEN YOU CAN PUT DUR AS ONLY A FIXED EFFECT WITH FREEZE. The code would be

 

stparm(dur = tvdur)

 

fixef(tvdur(freeze) = c(, 1, ))

 

where 1 here is the fixed value for the duration of the zero order infusion (whatever it is if you know it).

 

First order into lymph and then first order lymph into central

 

test(){

    deriv(A1 = - (Cl * C) + (Aa1 * Ka1)- (Cl2 * (C - C2)) + (Alymph * KAlymph)-(kon*C*Rf)+(koff*DR))

    urinecpt(A0 = (Cl * C))

    deriv(Aa1 = - (Aa1 * Ka1))

    deriv(A2 = (Cl2 * (C - C2)))

    deriv(Alymph = (Aa2 * Ka2)- (Alymph * KAlymph))

    deriv(Aa2 = - (Aa2 * Ka2))

    deriv(DR = C*kon*Rf-(koff+kint)*DR)

    C = A1 / V

    dosepoint(Aa1, bioavail = (exp(xf)/(1+exp(xf))), idosevar = Aa1Dose, infdosevar = Aa1InfDose, infratevar = Aa1InfRate)

    C2 = A2 / V2

    error(CEps = 1)

    observe(CObs = C * (1 + CEps))

    Clymph = Alymph / Vlymph

    dosepoint(Aa2, bioavail = (1-exp(xf)/(1+exp(xf))), idosevar = Aa2Dose, infdosevar = Aa2InfDose, infratevar = Aa2InfRate)

    Rf = Rmax-DR

    stparm(V = tvV * exp(nV))

    stparm(Cl = tvCl * exp(nCl))

    stparm(Ka1 = tvKa1 * exp(nKa1))

    stparm(V2 = tvV2 * exp(nV2))

    stparm(Cl2 = tvCl2 * exp(nCl2))

    stparm(Vlymph = tvVlymph * exp(nVlymph))

    stparm(Ka2 = tvKa2 * exp(nKa2))

    stparm(xf = tvxf + nxf)

    stparm(KAlymph = tvKAlymph * exp(nKAlymph))

    stparm(kon = tvkon * exp(nkon))

    stparm(koff = tvkoff * exp(nkoff))

    stparm(kint = tvkint * exp(nkint))

    stparm(Rmax = tvRmax * exp(nRmax))

    fixef(tvV = c(, 1, ))

    fixef(tvCl = c(, 1, ))

    fixef(tvKa1 = c(, 1, ))

    fixef(tvV2 = c(, 1, ))

    fixef(tvCl2 = c(, 1, ))

    fixef(tvVlymph = c(, 1, ))

    fixef(tvKa2 = c(, 1, ))

    fixef(tvxf = c(, 0, ))

    fixef(tvKAlymph = c(, 1, ))

    fixef(tvkon = c(, 1, ))

    fixef(tvkoff = c(, 1, ))

    fixef(tvkint = c(, 1, ))

    fixef(tvRmax = c(, 1, ))

    ranef(diag(nV, nCl, nV2, nCl2, nVlymph, nKa2, nKa1, nxf, nKAlymph, nkon, nkoff, nkint, nRmax) = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))

}

 

 

 

zero order into lymph with duration dur and then first order into central

 

 

test(){

    deriv(A1 = - (Cl * C) + (Aa1 * Ka1)- (Cl2 * (C - C2)) + (Alymph * KAlymph))

    urinecpt(A0 = (Cl * C))

    deriv(Aa1 = - (Aa1 * Ka1))

    deriv(A2 = (Cl2 * (C - C2)))

    deriv(Alymph = - (Alymph * KAlymph))

    deriv(DR = C*kon*Rf-(koff+kint)*DR)

    C = A1 / V

    dosepoint(Aa1, bioavail = (exp(xf)/(1+exp(xf))), idosevar = Aa1Dose, infdosevar = Aa1InfDose, infratevar = Aa1InfRate)

    C2 = A2 / V2

    error(CEps = 1)

    observe(CObs = C * (1 + CEps))

    Clymph = Alymph / Vlymph

    dosepoint(Alymph, duration = (dur), idosevar = AlymphDose, infdosevar = AlymphInfDose, infratevar = AlymphInfRate)

    Rf = Rmax-DR

    stparm(V = tvV * exp(nV))

    stparm(Cl = tvCl * exp(nCl))

    stparm(Ka1 = tvKa1 * exp(nKa1))

    stparm(V2 = tvV2 * exp(nV2))

    stparm(Cl2 = tvCl2 * exp(nCl2))

    stparm(Vlymph = tvVlymph * exp(nVlymph))

    stparm(xf = tvxf + nxf)

    stparm(KAlymph = tvKAlymph * exp(nKAlymph))

    stparm(kon = tvkon * exp(nkon))

    stparm(koff = tvkoff * exp(nkoff))

    stparm(kint = tvkint * exp(nkint))

    stparm(Rmax = tvRmax * exp(nRmax))

    stparm(dur = tvdur * exp(ndur))

    fixef(tvV = c(, 1, ))

    fixef(tvCl = c(, 1, ))

    fixef(tvKa1 = c(, 1, ))

    fixef(tvV2 = c(, 1, ))

    fixef(tvCl2 = c(, 1, ))

    fixef(tvVlymph = c(, 1, ))

    fixef(tvxf = c(, 0, ))

    fixef(tvKAlymph = c(, 1, ))

    fixef(tvkon = c(, 1, ))

    fixef(tvkoff = c(, 1, ))

    fixef(tvkint = c(, 1, ))

    fixef(tvRmax = c(, 1, ))

    fixef(tvdur = c(, 1, ))

    ranef(diag(nV, nCl, nV2, nCl2, nVlymph, nKa1, nxf, nKAlymph, nkon, nkoff, nkint, nRmax, ndur) = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))

}



#18 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 30 March 2013 - 11:29 PM

Hi Serge,

the 2nd example is very close to what I was attempting to do.

Is there a reason why the dose point cannot be the Alymph?

meaning can the model not be represented as if the fraction (1-F) be administered to the lymphatic space and then move zero order to the central compartment?

or would it be the same as simply delivering it to the central compartment with a dosepoint.

 

I'm struggling to understand this WinNonlin parlance. But graphically it would be another absorption compartment, with a zero order transfer rate to the central compartment.

the rest of the model (above from the 2nd example) makes perfect sense to me.

 

Elliot



#19 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 31 March 2013 - 12:15 AM

Dear Elliot

You can do that but it is more tricky because you need to tell the program that the zero order infusion should stop when there is no drug anymore in the lymph unlike when it is first order absorption where if no drug, no transfer intoc entral.

If you want to do what you just suggest, I can do it for at least a single dose.

Here is the code:

 

In the A1 mass balance you put the zero order I called ratelymphcentral valid only as long as t is less than dur. When that inequality is not true, it is zero.

2: in the lymph you put the dose as a bolus (look at the dosepoint) getting there after t =Tlag2. In the mass balance for the lymph you put a positive zero order rate (same like in A1 except the sign).

Finally you define an additional covariate called dosing to have the program remembering the current dose that is given and then you define ratelymphcentral=dosing/dur

This should work with single dose but not multiple dose because t is the current time and you start at t=0 and then it is Ok with single dose. Multiple dose would be more complicate but I guess possible. For multiple doses we would need to know all the dosing times and use sequence statement but let us not go there.

Hope it helps.

Where are you located BY THE WAY?

BEST

SERGE

 

 

test(){

    deriv(A1 = - (Cl * C) + (Aa1 * Ka1)- (Cl2 * (C - C2)) + ratelymphcentral*(t

# ratelymphcentral should occur only for time =dur. (t

 

# in he data set put a covariate that will read the dose and called dosing

    covariate(dosing)

# ratelymphcentral=dosing/dur

ratelymphcentral=dosing/dur

urinecpt(A0 = (Cl * C))

    deriv(Aa1 = - (Aa1 * Ka1))

    deriv(A2 = (Cl2 * (C - C2)))

    deriv(Alymph = ratelymphcentral*(t

    deriv(DR = C*kon*Rf-(koff+kint)*DR)

    C = A1 / V

    dosepoint(Aa1, bioavail = (exp(xf)/(1+exp(xf))), idosevar = Aa1Dose, infdosevar = Aa1InfDose, infratevar = Aa1InfRate)

    C2 = A2 / V2

    error(CEps = 1)

    observe(CObs = C * (1 + CEps))

    Clymph = Alymph / Vlymph

 

# bolus into lymph

dosepoint(Alymph, tlag=Tlag2,idosevar = AlymphDose, infdosevar = AlymphInfDose, infratevar = AlymphInfRate)

stparm(Tlag2 = tvTlag2 * exp(nTlag2))

 

    fixef(tvTlag2 = c(, 1, ))

 

 

Rf = Rmax-DR

    stparm(V = tvV * exp(nV))

    stparm(Cl = tvCl * exp(nCl))

    stparm(Ka1 = tvKa1 * exp(nKa1))

    stparm(V2 = tvV2 * exp(nV2))

    stparm(Cl2 = tvCl2 * exp(nCl2))

    stparm(Vlymph = tvVlymph * exp(nVlymph))

    stparm(xf = tvxf + nxf)

    stparm(KAlymph = tvKAlymph * exp(nKAlymph))

    stparm(kon = tvkon * exp(nkon))

    stparm(koff = tvkoff * exp(nkoff))

    stparm(kint = tvkint * exp(nkint))

    stparm(Rmax = tvRmax * exp(nRmax))

    stparm(dur = tvdur * exp(ndur))

    fixef(tvV = c(, 1, ))

    fixef(tvCl = c(, 1, ))

    fixef(tvKa1 = c(, 1, ))

    fixef(tvV2 = c(, 1, ))

    fixef(tvCl2 = c(, 1, ))

    fixef(tvVlymph = c(, 1, ))

    fixef(tvxf = c(, 0, ))

    fixef(tvKAlymph = c(, 1, ))

    fixef(tvkon = c(, 1, ))

    fixef(tvkoff = c(, 1, ))

    fixef(tvkint = c(, 1, ))

    fixef(tvRmax = c(, 1, ))

    fixef(tvdur = c(, 1, ))

    ranef(diag(nV, nCl, nV2, nCl2, nVlymph, nKa1, nxf, nKAlymph, nkon, nkoff, nkint, nRmax, ndur,nTlag2) = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1))

}



#20 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 31 March 2013 - 12:18 AM

Code for what you want. Apply only to single dose (is it your case?). bolus into lymph and then zero order until no drug in lymphs (that is the difficult part).

 

test(){

    deriv(A1 = - (Cl * C) + (Aa1 * Ka1)- (Cl2 * (C - C2)) + ratelymphcentral*(t

# ratelymphcentral should occur only for time =dur. (t

 

# in he data set put a covariate that will read the dose and called dosing

    covariate(dosing)

# ratelymphcentral=dosing/dur

ratelymphcentral=dosing/dur

urinecpt(A0 = (Cl * C))

    deriv(Aa1 = - (Aa1 * Ka1))

    deriv(A2 = (Cl2 * (C - C2)))

    deriv(Alymph = ratelymphcentral*(t

    deriv(DR = C*kon*Rf-(koff+kint)*DR)

    C = A1 / V

    dosepoint(Aa1, bioavail = (exp(xf)/(1+exp(xf))), idosevar = Aa1Dose, infdosevar = Aa1InfDose, infratevar = Aa1InfRate)

    C2 = A2 / V2

    error(CEps = 1)

    observe(CObs = C * (1 + CEps))

    Clymph = Alymph / Vlymph

 

# bolus into lymph

dosepoint(Alymph, tlag=Tlag2,idosevar = AlymphDose, infdosevar = AlymphInfDose, infratevar = AlymphInfRate)

stparm(Tlag2 = tvTlag2 * exp(nTlag2))

 

    fixef(tvTlag2 = c(, 1, ))

 

 

Rf = Rmax-DR

    stparm(V = tvV * exp(nV))

    stparm(Cl = tvCl * exp(nCl))

    stparm(Ka1 = tvKa1 * exp(nKa1))

    stparm(V2 = tvV2 * exp(nV2))

    stparm(Cl2 = tvCl2 * exp(nCl2))

    stparm(Vlymph = tvVlymph * exp(nVlymph))

    stparm(xf = tvxf + nxf)

    stparm(KAlymph = tvKAlymph * exp(nKAlymph))

    stparm(kon = tvkon * exp(nkon))

    stparm(koff = tvkoff * exp(nkoff))

    stparm(kint = tvkint * exp(nkint))

    stparm(Rmax = tvRmax * exp(nRmax))

    stparm(dur = tvdur * exp(ndur))

    fixef(tvV = c(, 1, ))

    fixef(tvCl = c(, 1, ))

    fixef(tvKa1 = c(, 1, ))

    fixef(tvV2 = c(, 1, ))

    fixef(tvCl2 = c(, 1, ))

    fixef(tvVlymph = c(, 1, ))

    fixef(tvxf = c(, 0, ))

    fixef(tvKAlymph = c(, 1, ))

    fixef(tvkon = c(, 1, ))

    fixef(tvkoff = c(, 1, ))

    fixef(tvkint = c(, 1, ))

    fixef(tvRmax = c(, 1, ))

    fixef(tvdur = c(, 1, ))

    ranef(diag(nV, nCl, nV2, nCl2, nVlymph, nKa1, nxf, nKAlymph, nkon, nkoff, nkint, nRmax, ndur,nTlag2) = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1))

}






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users