Jump to content


Photo

Integration for AUC in PML model


  • Please log in to reply
22 replies to this topic

#1 Kathryn

Kathryn

    Member

  • Members
  • PipPip
  • 15 posts

Posted 19 September 2011 - 04:03 PM

In a PML model created using text edit mode, is it possible to include a line of code to calculate the AUC from the predicted c vs time profile, i.e. as a secondary parameter? If so, could anyone please provide me with the code?

Thanks



#2 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,119 posts

Posted 19 September 2011 - 04:06 PM

Hi Katherine if you initially use the "set WNL model" in version 6.2 it will insert the code for secondary parameters appropriate to that model e.g. Posted Image

then you'll see it will ask you to replace, keep or combine the Secondary parameters. Posted Image

Here is the example block for an extravascular 1 compartment defined in Ke terms, if you need the basics in CL or something else, please email me and I'll give you what I can dig up.

....
fixef(tvKe = c(, 1, ))
secondary(Tmax = log(tvKa/tvKe)/(tvKa-tvKe))
secondary(AUC = AaDose/tvV/tvKe)
secondary(Cmax = AaDose/tvV*exp(-tvKe*Tmax))
secondary(Cl = AaDose/AUC)
secondary(Ka_hl = log(2)/tvKa)
secondary(Ke_hl = log(2)/tvKe)
}
Simon.

Attached Thumbnails

  • set.jpg
  • set2.jpg


#3 Kathryn

Kathryn

    Member

  • Members
  • PipPip
  • 15 posts

Posted 19 September 2011 - 04:08 PM

Ah ok, is it only v6.2 though? We're still with v6.1 and I had a go at doing as you say with the set WNL model and there were no secondary params calculated - is that a new feature to 6.2?



#4 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,119 posts

Posted 19 September 2011 - 05:27 PM

Katherine, Someone much smarter than me showed a much more elegant suggestion than my previous idea of passing the output to an NCA object and using AUCs from that

deriv(myAUC = C)

This would give AUC from any differential equation model:

and then including it in a table, e.g. Posted Image

Attached Thumbnails

  • AUC_deriv.jpg


#5 Bertold Renner

Bertold Renner

    Member

  • Members
  • PipPip
  • 10 posts

Posted 18 October 2011 - 08:54 AM

Dear Simon,

 

I would like to send PHX WNL classic data to NCA, but the predicted data tab includes both predicted and observed data which are not separated by function values. NCA could not handle duplicates in the input data set.

 

Have you any idea to handle this?

 

Thank you

 

Bertold



#6 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,119 posts

Posted 18 October 2011 - 10:41 AM

Sorry Bertold - I don't think I understand the question, if you have WNL classic output from a compartmental model then the Predicted and Observed data are in different workbooks. Even in a Phoenix model the predicted and observed data are normally presented in different columns, can you perhaps show us the project or a fragment of the file that causes you these difficulties.



#7 Bertold Renner

Bertold Renner

    Member

  • Members
  • PipPip
  • 10 posts

Posted 18 October 2011 - 12:15 PM

Dear Simon,

Thank you for your reply!
I have attached a *.jpg file for you and hope it works here.
The red marked rows are the Obs conc data (but with function 1)
At the bottom you see the error message copied from NCA.

Meanwhile, I have edited the predicted tab by PHX (delete some rows) and NCA works. I could not export the tab to Excel, since the data rows a too many for Excel.
Perhaps I have to sort the table before performing NCA??

Best wishes

Bertold Posted Image

Attached Thumbnails

  • NCA.jpg


#8 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,119 posts

Posted 18 October 2011 - 01:52 PM

I guess your Predicted tab is also containing the observed time events hence the duplicate row times that NCA cannot accept. However I've not seen this from WNL classic models before - it would be interesting to see the whole project to understand how that came about. I just tried to perform an NCA on Predicted data from a simulation I had to hand and it executed with no issues

 

Your workaround is fine, in a PML model another option would be to explicitly request only the timepoints you wanted to see using a table statement; e..g seq(0,4,0.05),seq(0,48,1)

 

  Simon.



#9 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,119 posts

Posted 18 October 2011 - 02:17 PM

I guess your Predicted tab is also containing the observed time events hence the duplicate row times that NCA cannot accept. However I've not seen this from WNL classic models before - it would be interesting to see the whole project to understand how that came about. I just tried to perform an NCA on Predicted data from a simulation I had to hand and it executed with no issues

 

Your workaround is fine, in a PML model another option would be to explicitly request only the timepoints you wanted to see using a table statement; e..g seq(0,4,0.05),seq(0,48,1)

 

  Simon.



#10 Bertold Renner

Bertold Renner

    Member

  • Members
  • PipPip
  • 10 posts

Posted 19 October 2011 - 09:22 AM

Dear Simon,

 

the duplicates in the predicted tab resulted from my dosing regime, I guess. I have a 2 compartment model with i.v. dose (1st 0-0.5 hrs and 2nd 0.5-24 hrs). The model creates 2 (at 0.5 hrs) time events in the predicted results with identical concentrations.

 

I would like to use the PML model and have the same problem as Katherine above wit PHX version 6.1.

Could you please provide me the appropriate secondary parameters for (I am using micro constants as primary parameters):

 

Cl

AUC (=AUC inf)

AUC (24hrs to inf): I guess the best way would be "AUC - AUC (0-24 hrs)" (first dose at 0 hrs, second starting at 0.5 hrs)?

 

I am using a big data set wit many subject and have tried 3 ways (sparse sampling but we need individual results):

WNL classic mode (PK9), PML with WNL (PK9) and PML with 2 compartment (intraveneous plus infusion).

The latter PML is best because it could model nearly all subjects. However, some subjects in the PML analysis generate negative values for K10. In both WNL modes the same subject is modeled with acceptable results. Have you any idea what I could improve in PML? I have used same initial estimates.

 

Thank you



#11 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,119 posts

Posted 19 October 2011 - 03:44 PM

Bertold - I think these should be correct;

secondary(r1 = ((tvK12+tvK21+tvKe)^2-4*tvK21*tvKe)^0.5)
secondary(Alpha = 0.5*(tvK12+tvK21+tvKe+r1))
secondary(Beta = 0.5*((tvK12+tvK21+tvKe)-r1))
secondary(Tinf = A1Dose/A1InfRate)
secondary(a1 = (A1InfRate/tvV*(tvK21-Alpha))/(Alpha-Beta)/Alpha)
secondary(b1 = (-(A1InfRate/tvV)*(tvK21-Beta))/(Alpha-Beta)/Beta)
secondary(AUC = A1Dose/tvV/tvKe)
secondary(Cmax = a1*(exp(-Alpha*Tinf)-1)+b1*(exp(-Beta*Tinf)-1))
secondary(A = -a1*Tinf*Alpha)
secondary(B = -b1*Tinf*Beta)
secondary(Cl = A1Dose/AUC)
secondary(AUMCIV = A/(Alpha*Alpha)+B/(Beta*Beta))
secondary(AUMC = AUMCIV+(Tinf*AUC)/2)
secondary(MRT = AUMC/AUC-Tinf/2)
secondary(VSS = (A1Dose*(AUMC/AUC-Tinf/2))/AUC)
secondary(Ke_hl = log(2)/tvKe)
secondary(Alpha_hl = log(2)/Alpha)
secondary(Beta_hl = log(2)/Beta)
secondary(Cl2 = tvK12*tvV)
secondary(V2 = Cl2/tvK21)

Regarding negative K10, you can still set bounds; either in the UI as below; Posted Image

or directly in a model text;

fixef(tvKe = c(0, 0.5, 5))

where 0 is the lower limit,
0.5 initial estimate
and 5 the upper limit

Simon

Attached Thumbnails

  • lower_bounds.jpg


#12 Bertold Renner

Bertold Renner

    Member

  • Members
  • PipPip
  • 10 posts

Posted 21 October 2011 - 10:00 AM

Simon, thank you for your help!

Your secondary parameters are running in my 6.1 version after replacing A1Dose by A1 and A1InfRate by A2 (see below). However, my Cmax and AUCs are smaller than expected. I guess, something is wrong in my dosing tab, which I have attached below. In the doses result table, both dosages are shown but dosepoint is A1.
My setup for dosing according to the table below: Subject (Sort); A1 (dose); A1 Rate (dose_rate); Time (start); None (Dose_1_2 and end).

Have you any idea?

Is there any option to include the normalization (m2) for dosing in the PML?

secondary(r1 = ((tvK12+tvK21+tvKe)^2-4*tvK21*tvKe)^0.5)
secondary(Alpha = 0.5*(tvK12+tvK21+tvKe+r1))
secondary(Beta = 0.5*((tvK12+tvK21+tvKe)-r1))
secondary(Tinf = A1/A2)
secondary(a1 = (A2/tvV*(tvK21-Alpha))/(Alpha-Beta)/Alpha)
secondary(b1 = (-(A2/tvV)*(tvK21-Beta))/(Alpha-Beta)/Beta)
secondary(AUC = A1/tvV/tvKe)
secondary(Cmax = a1*(exp(-Alpha*Tinf)-1)+b1*(exp(-Beta*Tinf)-1))
secondary(A = -a1*Tinf*Alpha)
secondary(B = -b1*Tinf*Beta)
secondary(Cl = A1/AUC)
secondary(AUMCIV = A/(Alpha*Alpha)+B/(Beta*Beta))
secondary(AUMC = AUMCIV+(Tinf*AUC)/2)
secondary(MRT = AUMC/AUC-Tinf/2)
secondary(VSS = (A1*(AUMC/AUC-Tinf/2))/AUC)
secondary(Ke_hl = log(2)/tvKe)
secondary(Alpha_hl = log(2)/Alpha)
secondary(Beta_hl = log(2)/Beta)
secondary(Cl2 = tvK12*tvV)
secondary(V2 = Cl2/tvK21)


Posted Image




Bertold

Attached Thumbnails

  • Dosing_c.jpg


#13 Kathryn

Kathryn

    Member

  • Members
  • PipPip
  • 15 posts

Posted 21 October 2011 - 01:54 PM

Hi Simon

 

Belated thanks for the deriv(myAUC = C) idea - it seems to work!............

 

My problem now is that I'm using the text edit mode for my model, since it is not a classic PK model. Therefore in the Run Options tab there is no option for adding a table - how can I visualise the AUC in the output then?

 

I have come up with a very non-elegant idea for a workaround - that is, making myAUC an observation, then creating a dummy observation workbook with a column called myAUC. Then I only need 1 row, in which I set time to be the time I want the AUC at (e.g. 24), I then do the simulation in SIMULATION mode, and in the Residuals results sheet, I have the AUC at 24h. (see screenshot)

 

Is there any other/better way of doing it, given that I don't use microconstants etc...?

 

Kathryn [file name=screenshot_AUC.bmp size=649782]http://pharsight.com/extranet/media/kunena/attachments/legacy/files/screenshot_AUC.bmp[/file]

Attached Files



#14 Jason Chittenden

Jason Chittenden

    Member

  • Members
  • PipPip
  • 17 posts

Posted 21 October 2011 - 03:22 PM

Kathryn,

The Table option *should* be on the Run Options tab, regardless. Before I report a bug, let me verify a few things:

 

version of Phoenix (from help | about)

population model or not (I think not)?

Run Model = Simple?

Warnings tab messages (last tab in the model object) if any.

 

Can you post a screen shot of the Run Options tab?

 

Thanks,

-Jason



#15 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,119 posts

Posted 21 October 2011 - 08:14 PM

I just heard from the Product Manager about a recent bug fix, QC_PHX_11186, that could be related to to your problem.

 

"A1Dose" should have been replaced with "A1InfDose" since they are infusion models

 

This will be corrected in 6.3. Have a good w.e Simon.



#16 Bertold Renner

Bertold Renner

    Member

  • Members
  • PipPip
  • 10 posts

Posted 26 October 2011 - 04:29 PM

Dear Simon,

Thank you for your help! I have tried different ways, but unfortunately the A1InfDose was not accepted. I have used different variables, see log-file from PML model:

log2.txt:

Variable 'A1InfDose' undefined

Variable 'A2InfRate' undefined

log2.txt:

Variable 'A1InfDose' undefined

Variable 'A1InfRate' undefined

log2.txt:

Variable 'dose' undefined

Variable 'dose_rate' undefined

log2.txt:

Variable 'A1Dose' undefined

log2.txt:

Variable 'A1Rate' undefined

log2.txt:

Variable 'A1_Rate' undefined

log2.txt:

Variable 'Rate' undefined using”A1 Rate”

 

In the settings under results, I could find: dose(A1<-"dose", "dose_rate").

I guess, there is only one dose accepted (A1) - possibly at different time events as seen in the result tab under "dosing".

"myAUC" calculations seems to be o.k. within the model.

 

Do we need a special declaration for both doses in the text mode?

 

Thanks,

Bertold



#17 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,119 posts

Posted 28 October 2011 - 09:11 AM

Bert - if you have the GENERAL tab displayed then probably you will see the offending piece of code identified before you execute; Posted Image

in the example above AaDose is undefined since I have typed it as AaDoseXXX, also remember PML is CASE sensitive.

Simon

If you still have issues it's probably easier to review the project as a whole so we can see data and code together.

Attached Thumbnails

  • general.jpg


#18 Bertold Renner

Bertold Renner

    Member

  • Members
  • PipPip
  • 10 posts

Posted 28 October 2011 - 01:37 PM

Simon,

thank you for your tip with the General tab. It works faster than running the whole model but with the same results (undefined). Attached is the PML code which works only using A1 and A2 (instead of A1Dose/A1InfDose and A1InfRate/A1DoseRate). However, A2 is not the correct parameter for the secondary parameters, I guess. E.g. in my dosing setup infusion durations are set to 0.5 and 23.5 hours and the estimated Tinf values differ from that (values estimated below 0.5 in most cases).

                     deriv(A1 = - Ke * A1 - K12 * A1 + K21 * A2)

    deriv(A2 = K12 * A1 - K21 * A2)

    deriv(myAUC = C)

    dosepoint(A1)

    C = A1 / V

    error(CEps = 1)

    observe(CObs = C + CEps)

    stparm(V = (tvV))

    stparm(Ke = (tvKe))

    stparm(K12 = (tvK12))

    stparm(K21 = (tvK21))

    fixef(tvV = c(, 10, ))

    fixef(tvKe = c(, 0.5, ))

    fixef(tvK12 = c(, 0.07, ))

    fixef(tvK21 = c(, 0.12, ))

    secondary(r1 = ((tvK12+tvK21+tvKe)^2-4*tvK21*tvKe)^0.5)

    secondary(Alpha = 0.5*(tvK12+tvK21+tvKe+r1))

    secondary(Beta = 0.5*((tvK12+tvK21+tvKe)-r1))

    secondary(Tinf = A1/A2)

    secondary(a1 = (A2/tvV*(tvK21-Alpha))/(Alpha-Beta)/Alpha)

    secondary(b1 = (-(A2/tvV)*(tvK21-Beta))/(Alpha-Beta)/Beta)

    secondary(AUC = A1/tvV/tvKe)

    secondary(Cmax = a1*(exp(-Alpha*Tinf)-1)+b1*(exp(-Beta*Tinf)-1))

    secondary(A = -a1*Tinf*Alpha)

    secondary(B = -b1*Tinf*Beta)

    secondary(Cl = A1/AUC)

    secondary(AUMCIV = A/(Alpha*Alpha)+B/(Beta*Beta))

    secondary(AUMC = AUMCIV+(Tinf*AUC)/2)

    secondary(MRT = AUMC/AUC-Tinf/2)

    secondary(VSS = (A1*(AUMC/AUC-Tinf/2))/AUC)

    secondary(Ke_hl = log(2)/tvKe)

    secondary(Alpha_hl = log(2)/Alpha)

    secondary(Beta_hl = log(2)/Beta)

    secondary(Cl2 = tvK12*tvV)

    secondary(V2 = Cl2/tvK21)

}

 

I observed the same problems with builtin models.

 

Bertold



#19 Bertold Renner

Bertold Renner

    Member

  • Members
  • PipPip
  • 10 posts

Posted 04 November 2011 - 12:38 PM

Hi,

 

I am using a PML text model with AUC calculated by secondary paramters and using the myAUC command. I observed a decimal shift between both AUC calculations and can't find the reason.

 

The model includes an i.v. dose at 2 time events (0 and 0.5 hours) by infusion.

 

I have attached my project with AUC results in Table 02/04 (myAUC) and AUC from sec parameters (see Table Secondary).

 

Has anyone any idea why the AUCs from sec. parameters are lower in this case?

 

 [file name=AUCs.phxproj size=520288]http://pharsight.com/extranet/media/kunena/attachments/legacy/files/AUCs.phxproj[/file]

 

Thanks

 

Bertold

Attached Files



#20 Jason Chittenden

Jason Chittenden

    Member

  • Members
  • PipPip
  • 17 posts

Posted 07 November 2011 - 05:10 PM

The AUC from the secondary parameters is computing AUC = Dose/CL, but is only using the first dose which is 10% of the total dose. Hence, the factor of 10 difference.

 

The AUC computed by integration does not consider dose. It is also only the AUC to the final observed time. You can extrapolate the AUC like this:

 

  deriv(myAUC = C)

  AUCextrap = C/Ke

  AUCinf = myAUC+AUCextrap

 

The extrapolated value is good when given at a time on the terminal phase.

 

Maybe this will work better for you, as the model is linear:

 

    deriv(elim = Ke*A1)

    AUCcalc = (A1+A2+elim)/Ke/V

 

add in the elimination compartment, then total dose is sum over all compartments. This should provide an accurate and constant AUC value over all times. Note this is only valid for linear PK.

 

Happy modeling,

-Jason






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users