From: "Garry Boswell" gboswell@tanox.com
Subject: [NMusers] ADVAN6 coding question
Date: Fri, 24 Mar 2006 17:17:09 -0600

NMUsers,

I would like to ask the group for some help.  I would like to know how to write the
NONMEM code for a particular model.  In a publication by Bauer et al (J Pharmacokinetics
and Biopharmaceutics 27(4), 1999. 397:420) the authors propose a PK/PD model that is
equivalent to an indirect response model.  The model is a 2 compartment model with
first order and MM elimination from the central compartment.  Their Model B has the
following differential equations:

A = amount compound A

B = amount CD11a cells

dA1/dt = -(k12+k10)*[A1]-Vm*[A1}*[B]/(Km+[A1]) + k21*[A2] + Dose_rate

dA2/dt = k12*[A1] - k21*[A2]

dB/dt = k03 – k30*[B] – Vm2*[A1}*[B]/(Km+[A1])

the $DES block  should be similar to this (for an IV bolus dose):

$DES

DADT(1) = -(K10+K12)*A(1) +K21*A(2) -(VM*A(1)*B)/(KM+A(1))

DADT(2) =  K12*A(1) -K21*A(2) 

D??DT =  K03 - B*K30 -(VM2*A(1)*B)/(KM+A(1))

Additionally, in previous posting to this group the comment has been made that the “Effect”
compartment needs to be initialized with a “dummy” AMT = 1 at t=0 for indirect models.  Would
this also apply to the above case where the measurement in the “Effect” compartment is not of
Compound A but of the number of CD11a cells?

TIA

Garry


_______________________________________________________

From: Sam Liao liao@pharmaxresearch.com
Subject: Re: [NMusers] ADVAN6 coding question
Date: Fri, 24 Mar 2006 19:19:18 -0500

Hi Garry:
I have a nmv control file and the data set I used to simulate Bauer's PKPD model.
Hope this can be helpful to you to write your model and preparing your input file.

$PROB A INDIRECT INHIBITION PK/PD MODEL, Raptiva human
$INPUT    ID AMT TIME RAP=DV CMT
$DATA     SIM1.PRN
$SUBROUTINES ADVAN8 TOL=5
$MODEL 
       NCOMP=3
       COMP=(CENTRAL)
       COMP=(PERI)
       COMP=(CD11A)
$PK
     CALLFL=1
     VC=THETA(1)*EXP(ETA(1))
     K12=THETA(2)
     K21=THETA(3)
     K10=THETA(4)

     K03=THETA(5)
     K30=K03/100
     VM=THETA(6)
     VM2=THETA(7)
     KM=THETA(8)
     S1=VC
     S3=1
     F3=100                 ;BOUNDARY CONDITION FOR EQUATION 1
;     K30=THETA(9)
$DES
     DADT(1)= K21*A(2) - (K12 + K10)*A(1) -VM*A(1)*A(3)/(KMC*VC +A(1))
     DADT(2)= - K21*A(2) + K12*A(1)
     DADT(3)= K03 - K30*A(3)  -VM2*A(1)*A(3)/(KMC*VC +A(1))
$ERROR
     Y= F + EPS(1)
$THETA
    0.072   ;1 Vc in L/kg
    0.283   ;2 k12 in 1/d
    0.506   ;3 k21 in 1/d 
    0.10    ;4 k10 in 1/d

    43.5    ;5 k03 in %CD11a/d
    .00147  ;6 Vm in mg/kg/d/%CD11a
    1.34    ;7 Vm2 in 1/d
    0.248   ;8 Kmc in mg/L
 
$OMEGA 0 FIX 
$SIGMA 0 FIX 
$SIM (243709) ONLY
;$EST POSTHOC SIG=5 MAXEVAL=9999 PRINT=10 MSFO=MSF1
;$COV
$TABLE ID TIME Y AMT CMT FILE=SIM1
 ONEHEADER NOPRINT
 
 #ID     AMT     TIME    DV      CMT
1       0.3     0       .       1
1       1       0       .       3
1       .       0.5     .       1
1       .       0.5     .       3
1       .       1       .       1
1       .       1       .       3
1       .       1.5     .       1
1       .       1.5     .       3
1       .       2       .       1
1       .       2       .       3
1       .       2.5     .       1
1       .       2.5     .       3
1       .       3       .       1
1       .       3       .       3
1       .       3.5     .       1
1       .       3.5     .       3
1       .       4       .       1
1       .       4       .       3
1       .       4.5     .       1
1       .       4.5     .       3
1       .       5       .       1
1       .       5       .       3
1       .       5.5     .       1
1       .       5.5     .       3
1       .       6       .       1
1       .       6       .       3
1       .       6.5     .       1
1       .       6.5     .       3
1       .       7       .       1
1       .       7       .       3
1       .       7.5     .       1
1       .       7.5     .       3
1       .       8       .       1
1       .       8       .       3
1       .       10      .       1
1       .       10      .       3
1       .       12      .       1
1       .       12      .       3
1       .       14      .       1
1       .       14      .       3
1       .       16      .       1
1       .       16      .       3
1       .       18      .       1
1       .       18      .       3
1       .       20      .       1
1       .       20      .       3
1       .       22      .       1
1       .       22      .       3
1       .       24      .       1
1       .       24      .       3
1       .       26      .       1
1       .       26      .       3
1       .       28      .       1
1       .       28      .       3
1       .       30      .       1
1       .       30      .       3
1       .       32      .       1
1       .       32      .       3
1       .       34      .       1
1       .       34      .       3
1       .       36      .       1
1       .       36      .       3
1       .       38      .       1
1       .       38      .       3
1       .       40      .       1
1       .       40      .       3
1       .       45      .       1
1       .       45      .       3
1       .       50      .       1
1       .       50      .       3
1       .       55      .       1
1       .       55      .       3
1       .       60      .       1
1       .       60      .       3
1       .       65      .       1
1       .       65      .       3
1       .       70      .       1
1       .       70      .       3
1       .       75      .       1
1       .       75      .       3
1       .       80      .       1
1       .       80      .       3
1       .       85      .       1
1       .       85      .       3
1       .       90      .       1
1       .       90      .       3
2       1       0       .       1
2       1       0       .       3
2       .       0.5     .       1
2       .       0.5     .       3
2       .       1       .       1
2       .       1       .       3
2       .       1.5     .       1
2       .       1.5     .       3
2       .       2       .       1
2       .       2       .       3
2       .       2.5     .       1
2       .       2.5     .       3
2       .       3       .       1
2       .       3       .       3
2       .       3.5     .       1
2       .       3.5     .       3
2       .       4       .       1
2       .       4       .       3
2       .       4.5     .       1
2       .       4.5     .       3
2       .       5       .       1
2       .       5       .       3
2       .       5.5     .       1
2       .       5.5     .       3
2       .       6       .       1
2       .       6       .       3
2       .       6.5     .       1
2       .       6.5     .       3
2       .       7       .       1
2       .       7       .       3
2       .       7.5     .       1
2       .       7.5     .       3
2       .       8       .       1
2       .       8       .       3
2       .       10      .       1
2       .       10      .       3
2       .       12      .       1
2       .       12      .       3
2       .       14      .       1
2       .       14      .       3
2       .       16      .       1
2       .       16      .       3
2       .       18      .       1
2       .       18      .       3
2       .       20      .       1
2       .       20      .       3
2       .       22      .       1
2       .       22      .       3
2       .       24      .       1
2       .       24      .       3
2       .       26      .       1
2       .       26      .       3
2       .       28      .       1
2       .       28      .       3
2       .       30      .       1
2       .       30      .       3
2       .       32      .       1
2       .       32      .       3
2       .       34      .       1
2       .       34      .       3
2       .       36      .       1
2       .       36      .       3
2       .       38      .       1
2       .       38      .       3
2       .       40      .       1
2       .       40      .       3
2       .       45      .       1
2       .       45      .       3
2       .       50      .       1
2       .       50      .       3
2       .       55      .       1
2       .       55      .       3
2       .       60      .       1
2       .       60      .       3
2       .       65      .       1
2       .       65      .       3
2       .       70      .       1
2       .       70      .       3
2       .       75      .       1
2       .       75      .       3
2       .       80      .       1
2       .       80      .       3
2       .       85      .       1
2       .       85      .       3
2       .       90      .       1
2       .       90      .       3
3       3       0       .       1
3       1       0       .       3
3       .       0.5     .       1
3       .       0.5     .       3
3       .       1       .       1
3       .       1       .       3
3       .       1.5     .       1
3       .       1.5     .       3
3       .       2       .       1
3       .       2       .       3
3       .       2.5     .       1
3       .       2.5     .       3
3       .       3       .       1
3       .       3       .       3
3       .       3.5     .       1
3       .       3.5     .       3
3       .       4       .       1
3       .       4       .       3
3       .       4.5     .       1
3       .       4.5     .       3
3       .       5       .       1
3       .       5       .       3
3       .       5.5     .       1
3       .       5.5     .       3
3       .       6       .       1
3       .       6       .       3
3       .       6.5     .       1
3       .       6.5     .       3
3       .       7       .       1
3       .       7       .       3
3       .       7.5     .       1
3       .       7.5     .       3
3       .       8       .       1
3       .       8       .       3
3       .       10      .       1
3       .       10      .       3
3       .       12      .       1
3       .       12      .       3
3       .       14      .       1
3       .       14      .       3
3       .       16      .       1
3       .       16      .       3
3       .       18      .       1
3       .       18      .       3
3       .       20      .       1
3       .       20      .       3
3       .       22      .       1
3       .       22      .       3
3       .       24      .       1
3       .       24      .       3
3       .       26      .       1
3       .       26      .       3
3       .       28      .       1
3       .       28      .       3
3       .       30      .       1
3       .       30      .       3
3       .       32      .       1
3       .       32      .       3
3       .       34      .       1
3       .       34      .       3
3       .       36      .       1
3       .       36      .       3
3       .       38      .       1
3       .       38      .       3
3       .       40      .       1
3       .       40      .       3
3       .       45      .       1
3       .       45      .       3
3       .       50      .       1
3       .       50      .       3
3       .       55      .       1
3       .       55      .       3
3       .       60      .       1
3       .       60      .       3
3       .       65      .       1
3       .       65      .       3
3       .       70      .       1
3       .       70      .       3
3       .       75      .       1
3       .       75      .       3
3       .       80      .       1
3       .       80      .       3
3       .       85      .       1
3       .       85      .       3
3       .       90      .       1
3       .       90      .       3
4       10      0       .       1
4       1       0       .       3
4       .       0.5     .       1
4       .       0.5     .       3
4       .       1       .       1
4       .       1       .       3
4       .       1.5     .       1
4       .       1.5     .       3
4       .       2       .       1
4       .       2       .       3
4       .       2.5     .       1
4       .       2.5     .       3
4       .       3       .       1
4       .       3       .       3
4       .       3.5     .       1
4       .       3.5     .       3
4       .       4       .       1
4       .       4       .       3
4       .       4.5     .       1
4       .       4.5     .       3
4       .       5       .       1
4       .       5       .       3
4       .       5.5     .       1
4       .       5.5     .       3
4       .       6       .       1
4       .       6       .       3
4       .       6.5     .       1
4       .       6.5     .       3
4       .       7       .       1
4       .       7       .       3
4       .       7.5     .       1
4       .       7.5     .       3
4       .       8       .       1
4       .       8       .       3
4       .       10      .       1
4       .       10      .       3
4       .       12      .       1
4       .       12      .       3
4       .       14      .       1
4       .       14      .       3
4       .       16      .       1
4       .       16      .       3
4       .       18      .       1
4       .       18      .       3
4       .       20      .       1
4       .       20      .       3
4       .       22      .       1
4       .       22      .       3
4       .       24      .       1
4       .       24      .       3
4       .       26      .       1
4       .       26      .       3
4       .       28      .       1
4       .       28      .       3
4       .       30      .       1
4       .       30      .       3
4       .       32      .       1
4       .       32      .       3
4       .       34      .       1
4       .       34      .       3
4       .       36      .       1
4       .       36      .       3
4       .       38      .       1
4       .       38      .       3
4       .       40      .       1
4       .       40      .       3
4       .       45      .       1
4       .       45      .       3
4       .       50      .       1
4       .       50      .       3
4       .       55      .       1
4       .       55      .       3
4       .       60      .       1
4       .       60      .       3
4       .       65      .       1
4       .       65      .       3
4       .       70      .       1
4       .       70      .       3
4       .       75      .       1
4       .       75      .       3
4       .       80      .       1
4       .       80      .       3
4       .       85      .       1
4       .       85      .       3
4       .       90      .       1
4       .       90      .       3

Best regards,

Sam Liao
Pharmax Research
201-9882043 
_______________________________________________________

From:  "Serge Guzy" GUZY@xoma.com
Subject: RE: [NMusers] ADVAN6 coding question
Date: Sat, 25 Mar 2006 13:58:35 -0800

Hi Garry
This model should have the initial conditions in the B-cell compartment:
t=0, B=K03/K30
 
This assumes that at =0, you are at steady state and no drug yet enter the B-cell compartment:
Therefore:

DBDT =  K03 - B*K30 -(VM2*A(1)*B)/(KM+A(1))=0 and A(1)=0

Then, K03-B*K30=0, Therefore, t=0, B=K03/K30

 

This model is by the way available as a part of the PK/PD libraries in the PDX-MC-PEM 
program (model name is model56pd).

The differential equations are written below for the generalized (up to 3) non linear 
compartment model linked to the indirect response model you want.

Serge Guzy

President POP-PHARM
 
 
 SUBROUTINE fcn56pk (N, T, Y, YPRIME)
C SPECIFICATIONS FOR ARGUMENTS
 IMPLICIT real*8 (A-H,O-Z)
 REAL*8  T, Y(N), YPRIME(N)
  REAL*8 K10,K12,K21,K01,KA,K13,K31,KM,K42
 REAL*8 KIN,KOUT,IC50
 REAL*8 TOL
 
C WE PASS THE VALUE OF THE INDEPENDENT VARIABLE (TSAMPLING(I,J))
 COMMON/PKINFO/KIN,KOUT,IC50,EC50,EMAX,K10,K12,K21,K01,KA,K13,
 1 K31,TLAG,F,KM,VMAX,V,V2,V3,V4,Q,K42,DK42,raterv  
 COMMON/TOTALRATE/SUMRATE
 COMMON/LINEAR/LIN
 

 
 

C IF NON LINEAR pk, not parallel, then lin=2 and k10=0
  IF(LIN.EQ.2)THEN
  K10=0
  ENDIF
 
 CONTINUE
C
 
C C WILL BE OBTAINED FOR EACH T VALUE FROM MNODEL_SELECTION_PK_DIFF
CORAL EQUATION
 

C IF K01 IS ZERO, THEN WE FORCE YPRIME(1) TO BE ZERO
 
 IF(K01.EQ.0)THEN
 YPRIME(1)=0
 ELSE
 YPRIME(1)=-K01*Y(1)
 ENDIF
C BLOOD: ORAL INPUT, K10 OUTPUT, K12 OUTPUT, K21INPUT
C K13 OUTPUT, K31 INPUT, SATURATED CLEARANCE OUTPUT
 
 
 
C IF VMAX =0, THEN WE ARBITRARILY PUT KM=1 TO PREVENT 0/0
 IF(VMAX.EQ.0)THEN
 KM=1
 ENDIF
 YPRIME(2)=K01*Y(1)*F-K10*Y(2)-K12*Y(2)+K21*Y(3)-K13*Y(2)+K31*Y(4)
 1 -VMAX*Y(5)*Y(2)/(Y(2)+KM*V)+SUMRATE
 

 IF(K12.EQ.0.AND.K21.EQ.0)THEN
 YPRIME(3)=0
 ELSE
 YPRIME(3)=K12*Y(2)-K21*Y(3)
 ENDIF
 
 IF(K13.EQ.0.AND.K31.EQ.0)THEN
 YPRIME(4)=0
 ELSE
 YPRIME(4)=K13*Y(2)-K31*Y(4)
 ENDIF
 
 YPRIME(5) = KIN-KOUT*Y(5)-EMAX*Y(5)*Y(2)/(EC50*V+Y(2))
 CONTINUE
  
 RETURN
 END
_______________________________________________________