Dear NonMEM users,
I want to code a two sequential absorption processes with 2 CMT: zero-order
absorption for the first 2.99 hours and then
first-order absorption for the rest time. My code is listed as below. My
question is when I change K0 (zero-order absorpption rate),
the predicted concentrations in the first 2.99 hours does not change. It seems
like AL is useless.
I am very appreciated if anyone can tell me the problem in my code or other
things. Thanks a lot!
$DES
IF (AMT.GT.0) THEN
TDOS=TIME ;dosing time
TL=TDOS+2.99 ;lag time=2.99 hour
ENDIF
AL=0
BL=0
K0=14100
IF (TIME .LE. TDOS) THEN ; for PD baseline
INPT=0
ELSE
IF (TIME .LE. TL .AND.TIME .GT. TDOS ) THEN
AL=1
ELSE
BL=1
ENDIF
ENDIF
INPT=AL*K0+BL*KA*A(1)
C2=A(2)/V1
C3=A(3)/V2
DADT(1) = -INPT
DADT(2) = INPT-CL*C2- CLD*(C2-C3)
DADT(3) = CLD*(C2-C3)
Best regards,
Liu, Dongyang, PhD, Postdoc Fellow
Department of Pharmaceutical sciences,
State University of New York at Buffalo.
Tel(o):01-716-645-4840,
Cell: 01-716-908-6644,
Two sequential absorption processes
5 messages
5 people
Latest: Apr 12, 2011
Hello,
I think that the model that you refer to is called the KOKA absorption model
(Holford et al. J Pharmacokinet Biopharm. 1992; 20:421-42). You don't need
$DES, it can be easily coded using ADVAN4 (it will greatly reduce your run
time). I guess you know what fraction of the dose enters as a zero order
process and what remaining fraction enters as the first order process (I see
that you have KO in the code). The fraction that enters as the zero order
process is the THETA(2) in the code below. Moreover, you will need 2 dosing
records per dose that enters the system, see example dataset for 1 individual
below as well.
In my experience, the duration of the zero order input and its corresponding
fraction was unknown. You can even estimate these parameters. The only trick is
that if you estimate the fraction, please put THETA(2) inside a logit function
[you can find more details here: Samtani MN, Vermeulen A, Stuyckens, K.
Population pharmacokinetics of intramuscular paliperidone palmitate in patients
with schizophrenia. A novel once-monthly, long-acting formulation of an
atypical antipsychotic. Clin Pharmacokinet. 48: 585-600 (2009)]
Good luck,
Mahesh
_______________________________________________________________________________________________
$PK
CALLFL=-2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; KA
TVKA=THETA(1)
KA =TVKA*EXP(ETA(1))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALAG & DN
DUR = 2.99
D2 = DUR
ALAG1 = DUR
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FN
TVF=THETA(2) ; replace THETA(2) with your known fraction.
F2 = TVF
F1 = 1-TVF
#ID TIME DV CMT AMT RATE
6001 0 0 1 10 0
6001 0 0 2 10 -2
6001 1 0.2 2 0 0
6001 6 1.9 2 0 0
6001 24 0.1 2 0 0
Quoted reply history
________________________________
From: [email protected] on behalf of Liu Dongyang
Sent: Wed 4/6/2011 9:33 AM
To: nmusers
Subject: [NMusers] Two sequential absorption processes
Dear NonMEM users,
I want to code a two sequential absorption processes with 2 CMT: zero-order
absorption for the first 2.99 hours and then
first-order absorption for the rest time. My code is listed as below. My
question is when I change K0 (zero-order absorpption rate),
the predicted concentrations in the first 2.99 hours does not change. It seems
like AL is useless.
I am very appreciated if anyone can tell me the problem in my code or other
things. Thanks a lot!
$DES
IF (AMT.GT.0) THEN
TDOS=TIME ;dosing time
TL=TDOS+2.99 ;lag time=2.99 hour
ENDIF
AL=0
BL=0
K0=14100
IF (TIME .LE. TDOS) THEN ; for PD baseline
INPT=0
ELSE
IF (TIME .LE. TL .AND.TIME .GT. TDOS ) THEN
AL=1
ELSE
BL=1
ENDIF
ENDIF
INPT=AL*K0+BL*KA*A(1)
C2=A(2)/V1
C3=A(3)/V2
DADT(1) = -INPT
DADT(2) = INPT-CL*C2- CLD*(C2-C3)
DADT(3) = CLD*(C2-C3)
Best regards,
Liu, Dongyang, PhD, Postdoc Fellow
Department of Pharmaceutical sciences,
State University of New York at Buffalo.
Tel(o):01-716-645-4840,
Cell: 01-716-908-6644,
2011/4/6 Liu Dongyang <[email protected]>
> Dear NonMEM users,
>
> I want to code a two sequential absorption processes with 2 CMT:
> zero-order absorption for the first 2.99 hours and then
> first-order absorption for the rest time. My code is listed as below. My
> question is when I change K0 (zero-order absorpption rate),
> the predicted concentrations in the first 2.99 hours does not change. It
> seems like AL is useless.
> I am very appreciated if anyone can tell me the problem in my code or
> other things. Thanks a lot!
>
> $DES
>
> IF (AMT.GT.0) THEN
> TDOS=TIME ;dosing time
> TL=TDOS+2.99 ;lag time=2.99 hour
> ENDIF
>
> AL=0
> BL=0
> K0=14100
>
> IF (TIME .LE. TDOS) THEN ; for PD baseline
> INPT=0
> ELSE
> IF (TIME .LE. TL .AND.TIME .GT. TDOS ) THEN
> AL=1
> ELSE
> BL=1
> ENDIF
> ENDIF
>
> INPT=AL*K0+BL*KA*A(1)
>
> C2=A(2)/V1
> C3=A(3)/V2
>
> DADT(1) = -INPT
> DADT(2) = INPT-CL*C2- CLD*(C2-C3)
> DADT(3) = CLD*(C2-C3)
>
>
> Best regards,
>
> Liu, Dongyang, PhD, Postdoc Fellow
> Department of Pharmaceutical sciences,
> State University of New York at Buffalo.
> Tel(o):01-716-645-4840,
> Cell: 01-716-908-6644,
>
Liu,
The info that I sent to you allows the following to happen:
(1) A constant rate of infusion to the central cmt begins immediately at
the time of dose.
(2) At time=alag1=d2, the constant rate of infusion shuts off and
first-order absorption begins at the same time that the infusion shuts
off (not at a lagged time). The alag is just used to keep first-order
turned off until the zero-order infusion is done.
(3) The way that I coded F1 & F2 is to ensure that 100% of the drug will
go into the central compartment. However, to implement the model it
requires that a dose of 100 mg be put it 2 times (100 mg into cmt=1 and
100 mg into cmt=2 or 200 mg total). You don't really want 200 mg of drug
going into the system (But putting in the dose 2 times allows the use of
D2 & ALAG1 to turn on & off zero-order vs. first-order). So the
following trick is used to get back to a dose of 100 mg .
F1=THETA(N) where 0<Theta(N)<1
F2=1-F1
NONMEM DOSE = F1*AMT in CMT=1 + F2*AMT in CMT=2
Example: F1*100 + F2*100
or F1*100 + (1-F1)*100 (substitute definition of f2)
or F1*100 + 100 - F1*100
which equals 100 which is 100% of the original dose.
You can still use ADVAN6 or ADVAN8 with this set up. However, unless the
PD feeds back and impacts the PK, I suggest figuring out the PK model
alone first (using ADVAN4 for speed).
$DES
;Q=intercompartmental clearance
;Note: NONMEM inputs all doses based upon the description in the dataset
;So with the data description provided earlier, the des below has a
;zero-order input starting at the time of dose that turns off at
;time=d2. The 1st cmt (-ka*a(1)) is turned off until time=d2=alag1.
;At that time the first-order absorption from cmt 1 is turned on.
K10=CL/V1
K12=Q/V1
K21=Q/V2
DADT(1) = -KA*A(1)
DADT(2) = K21*A(3) - K10*A(2) - K12*A(2)
DADT(3) = K12*A(2) - K21*A(3)
Best regards,
Luann Phillips
Director, PK/PD
Cognigen Corporation
LiuDongyang wrote:
> Hello Mahesh and Luann Phillips,
>
> Thanks a lot for your kind help and detailed information. My case is a
> little bit complicated:
> The drug is filled in a mini-pump, which is implant in rats. Drug could
> infuse in a constant rate
> into rat body. Because of anesthesia in the first couple hours, the drug
> is absorbed very slowly.
> Based on the fact that drug is absorbed and eliminated rapidly after SC
> injection, I construct
> this sequential absorption PK model. ALAG is not a little appropriate
> because plasma concentration
> go down quickly after completion of infusion. If I use ALAG, the
> infusion completing time will expand to
> the true completing time plus lag time, witch is not expected. These
> above are one of reason to
> use $DES. The other reason I use $DES because I want to do Pop-PKPD
> modeling, which need
> ADVAN6 or ADVAN8.
>
> I did not set absorption fraction because all drug put in CMT 1 will
> go into CMT2 with either zero-
> or first-order absorption constant. The value of K0 come from mean data
> fitting using ADAPT. When
> I change k0, the predicted concentration does not change. I think the
> problem might come from
> the IF statement or other sources. But I do not know how to fix it. The
> whole code and data are listed as below:
>
> $DATA ANK2.PKtime.CSV IGNORE=#
> $INPUT ID,GRP, TIME,EVID,DV, WT,AMT,RATE,MDV,CMT
> ;MASS NG, VOLUME ML, TIME HR, PAW UNIT
> $SUBROUTINES ADVAN6 TOL=5
>
> $MODEL
> COMP=(DEPOT) ;1
> COMP=(CENTRAL) ;2
> COMP=(TISSUE) ;3
>
> $PK
> KA=THETA(1)*EXP(ETA(1)) ;KA
> TVCL=THETA(2)
> CL=TVCL*EXP(ETA(2)) ;LINEAR CLEARANCE
> V1=THETA(3)
> ;VOLUME OF CENTRAL COMPARTMENT (L)
> CLD=THETA(4)
> V2=THETA(5)
>
> $DES
> IF (AMT.GT.0) THEN
> TDOS=TIME
> TL=TDOS+2.99
> ENDIF
> AL=0
> BL=0
> K0=141
> IF (TIME .LE. TDOS) THEN
> INPT=0
> ELSE
> IF (TIME .LE. TL .AND.TIME .GT. TDOS ) THEN
> AL=1
> ELSE
> BL=1
> ENDIF
> ENDIF
> INPT=AL*K0+BL*KA*A(1)
> C2=A(2)/V1
> C3=A(3)/V2
> DADT(1) = -INPT
> DADT(2) = INPT-CL*C2- CLD*(C2-C3)
> DADT(3) = CLD*(C2-C3)
>
> $THETA
> (0,0.4,2) ;KA
> (0,660,1000) ;CL/F
> (149.3 FIXED) ;V1
> (21.6) ;CLD
> (201.6 FIXED) ;V2
>
> $OMEGA
> 0.2 ;ETA_KA
> 0.05 ;ETA_CL/F
>
> $ERROR
> IF (CMT.EQ.2) THEN
> IPRED=A(2)/V1
> Y=IPRED*(1+EPS(1))+EPS(2)
> ELSE
> ENDIF
>
> $SIGMA
> .4 ;EPS(1)
> 0.0 FIXED;EPS(2)
>
> $EST MAXEVAL=9999 METHOD=0 POSTHOC PRINT=5 SIGDIGITS=3 NOABORT MSFO=.MSF
>
>
> #ID
>
> Group
>
> TIME
>
> EVID
>
> DV
>
> WT
>
> AMT
>
> RATE
>
> MDV
>
> CMT
> 24
>
> 2
>
> 506.42
>
> 1
>
>
>
> 0.2544
>
> 1.28E+08
>
> 4166509
>
> 1
>
> 1
> 24
>
> 2
>
> 509.8
>
> 0
>
> 4101
>
> 0.2544
>
>
>
>
>
> 0
>
> 2
> 24
>
> 2
>
> 515.03
>
> 0
>
> 11107
>
> 0.2544
>
>
>
>
>
> 0
>
> 2
> 24
>
> 2
>
> 534.18
>
> 0
>
> 11703
>
> 0.2544
>
>
>
>
>
> 0
>
> 2
>
> .......................
> 2011-04-07
> ------------------------------------------------------------------------
> Liu Dongyang
> ------------------------------------------------------------------------
> *发件人:* Luann.Phillips
> *发送时间:* 2011-04-06 22:44:00
> *收件人:* Liu Dongyang
> *抄送:*
> *主题:* Re: [NMusers] Two sequential absorption processes
> Liu,
> I think the following should work for you and it allows you to use the
> standard ADVAN for a 2 cmt model with a depot cmt (I think its ADVAN4).
> (A) Setting up your data
> In your data set, you will need to input each dose twice with the same
> value of TIME. First time set RATE=-2 with CMT=2(central cmt). The 2nd
> time you input the dose set RATE=. and CMT=1 (depot).
> The first dose record tells NONMEM that the dose is using a zero-order
> input with an estimated duration (which you will fix to 2.99). The 2nd
> dose record will allow NONMEM to input a dose via first-order absorption.
> I know this sounds very odd because it's putting in twice the dose that
> you actually gave. But as you continue reading, other code will ensure
> that only the dose amount that you actually gave will go into the system.
> EXAMPLE:
> TIME AMT RATE CMT DV
> 0 100 -2 2 .
> 0 100 . 1 .
> 0.25 . . 2 10
> 0.5 . . 2 20
> 0.75 . . 2 30
> 1.0 . . 2 40
> ETC.
> 24 100 -2 2 .
> 24 100 . 1 .
> conc records
> etc.
> (B) Setting up your model
> $PK
> ;Call prediction routine at lagged dose times
> ;I think its a value of -1 but double check in the nmhelp. It may be -2.
> ;I don't have access to my help guide because I'm out of the office.
> CALLFL=-1
> ;dose records in dataset are putting in twice the dose
> ;the following code will reduce it back to the actual dose
> ;The parameter F1 is multiplied to AMT for CMT=1 at the time the dose is
> ;introduced into CMT=1. F2 is multiplied to AMT for CMT=2 at the time that
> ;dose is introduced into the system.
> ;So, NONMEM will see F1*AMT + F2*AMT of drug introduced into the system.
> ;If F2 is set = 1-F1 then F1*AMT + (1-F1)*AMT will be introduced.
> ;F1*AMT + (1-F1)*AMT is really just 1*AMT the original dose.
> ;F1 = fraction of dose absorbed via first-order process -> bounds (0,x,1)
> ;F2 = fraction of dose absorbed via zero-order process
> ;Note: If you put an eta on F1, remember to use a logit transform so that
> ;the individual values of F1 remain between 0 and 1.
> F1=THETA(N)
> F2= 1-F1
> ;set up the parameters to deal with length of zero-order process
> ;set up the parameters to deal with the start of the first-order process
> ;ALAG1 tells NONMEM to delay entering the CMT=1 doses by the value of ALAG1
> ;D2 in conjunction with RATE=-2 tells NONMEM to introduce a dose into CMT2
> ;using a zero-order process with a duration of D2 and rate=F2*AMT/D2.
> ;In your case, you have determined this value to be 2.99 hr
> ;NONMEM will automatically apply each parameter to every dose record
> ;Note: If you have a lot of absorption data, you may be able to estimate
> ; the time of the transition by setting ALAG1=THETA(M) and D2=ALAG1
> ALAG1=2.99
> D2=2.99
> You will not need a $DES block, this model will run with a regular 2 cmt
> ADVAN. This will also help speed up run times.
> I hope you find this helpful.
> Best regards,
> Luann Phillips
> Cognigen Corporation
> Director, PK/PD
> > Dear NonMEM users,
> >
> > I want to code a two sequential absorption processes with 2 CMT:
> > zero-order absorption for the first 2.99 hours and then
> > first-order absorption for the rest time. My code is listed as below. My
> > question is when I change K0 (zero-order absorpption rate),
> > the predicted concentrations in the first 2.99 hours does not change. It
> > seems like AL is useless.
> > I am very appreciated if anyone can tell me the problem in my code or
> > other things. Thanks a lot!
> >
> > $DES
> >
> > IF (AMT.GT.0) THEN
> > TDOS=TIME ;dosing time
> > TL=TDOS+2.99 ;lag time=2.99 hour
> > ENDIF
> >
> > AL=0
> > BL=0
> > K0=14100
> >
> > IF (TIME .LE. TDOS) THEN ; for PD baseline
> > INPT=0
> > ELSE
> > IF (TIME .LE. TL .AND.TIME .GT. TDOS ) THEN
> > AL=1
> > ELSE
> > BL=1
> > ENDIF
> > ENDIF
> >
> > INPT=AL*K0+BL*KA*A(1)
> >
> > C2=A(2)/V1
> > C3=A(3)/V2
> >
> > DADT(1) = -INPT
> > DADT(2) = INPT-CL*C2- CLD*(C2-C3)
> > DADT(3) = CLD*(C2-C3)
> >
> >
> > Best regards,
> >
> > Liu, Dongyang, PhD, Postdoc Fellow
> > Department of Pharmaceutical sciences,
> > State University of New York at Buffalo.
> > Tel(o):01-716-645-4840,
> > Cell: 01-716-908-6644,
> >
Hi Liu,
One reason why you don't get the expected result with your current code
is that you probably confuse TIME (which is the time of the current
record) and T (which is the "running" time in the $DES block).
Quoted reply history
On 4/6/2011 3:33 PM, Liu Dongyang wrote:
[...]
> $DES
> IF (AMT.GT.0) THEN
> TDOS=TIME ;dosing time
... this is correct
[...]
> IF (TIME .LE. TDOS) THEN ; for PD baseline
[...]
> IF (TIME .LE. TL .AND.TIME .GT. TDOS ) THEN
... here, you should probably use T instead of TIME.
However, I'd vote for "putting the model into the data" as Luann
suggested by using two dose records; one for the zero-order and one for
the first order absorption.
Kind regards,
--
Paul Matthias Diderichsen, PhD
Quantitative Solutions B.V.
+31 624 330 706