Listing 1: General NONMEM codes for the major EHC modeling strategies
1a: NONMEM code for Simple Two-Compartment Models: 2
1b: NONMEM code for Tgap-Based Compartmental Models: 3
1c: NONMEM code for Continuous Release gallbladder based Models: 4
1d: NONMEM code for Single Bolus Release gallbladder based Models: 5
1e: NONMEM code for Switch Function Release gallbladder based Models: 6
1f: NONMEM code for Sigmoid Function Release gallbladder based Models: 7
1g: NONMEM code for Sine Function Release gallbladder based Models: 8
2: Example of the data set structure 10
1a: NONMEM code for Simple Two-Compartment Models:
;; 1. Based on:
;; 2. Description: Ex: Simple Two-Compartment EHC Model
;; 3. Label:
;; x1. Author: Malek Okour
$PROBLEM
$INPUT C ID TIME MDV EVID DV AMT CMT
$DATA simData.csv IGNORE=@
$SUBROUTINES ADVAN6 TOL=10
$MODEL
COMP=(GUT)
COMP=(body)
$PK
;KA=THETA(1)
CL =THETA(1)* EXP(ETA(1))
V = THETA(2)
S2 = V
K20=(CL/V)
K10= THETA(3)
K12=THETA(4)
K21=THETA(5)
$DES
DADT(1)= K21*A(2)-K10*A(1)-K12*A(1)
DADT(2)= K12*A(1)-K20*A(2)-K21*A(2)
$ERROR
IPRED = F
Y=F+F*ERR(1)
W=IPRED
IRES=DV-IPRED
IWRES=IRES/W
IND = IREP
$THETA
(0,20) ;CL
(0,36) ;V
(0,0.2) ;K10
(0,0.8) ;K12
(0,0.4) ;K21
$OMEGA
0.04;
$SIGMA
0.04; ERR
$EST METHOD=1 INTER MAXEVAL=2000 NOABORT SIG=3 PRINT=1
$TABLE IND ID TIME DV MDV EVID CMT IWRES IPRED IWRES CWRES IRES PRED NOAPPEND ONEHEADER NOPRINT FILE=sdtab1
$TABLE IND ID TIME CL V K10 K12 K21 CMT IPRED DV PRED ONEHEADER NOPRINT FILE=patab1
1b: NONMEM code for Tgap-Based Compartmental Models:
;; 1. Based on: run1
;; 2. Description: Ex: Tgap-Based Compartmental Model
;; x1. Author: Malek Okour
;; 3. Label:
$PROBLEM
$INPUT C ID TIME MDV EVID DV AMT CMT
$DATA simData.csv IGNORE=@
$SUBROUTINES ADVAN6 TOL=10
$MODEL
COMP=(GUT)
COMP=(body)
$PK
;KA=THETA(1)
CL =THETA(1)* EXP(ETA(1))
V = THETA(2)
S2 = V
K20=(CL/V)
K10= THETA(3)
K12=THETA(4)
; Tgap at 6 hrs TAD
K21=0 ; or very small value like 0.00001
IF(TIME.GE.6) K21=THETA(5)
$DES
DADT(1)= K21*A(2)-K10*A(1)-K12*A(1)
DADT(2)= K12*A(1)-K20*A(2)-K21*A(2)
$ERROR
IPRED = F
Y=F+F*ERR(1)
W=IPRED
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0,20) ;CL
(0,36) ;V
(0,0.2) ;K10
(0,0.3) ;K12
(0,1) ;K21
$OMEGA
0.04;
$SIGMA
0.04; ERR
$EST METHOD=1 INTER MAXEVAL=2000 NOABORT SIG=3 PRINT=1
$TABLE IND ID TIME DV MDV EVID CMT IWRES IPRED IWRES CWRES IRES PRED NOAPPEND ONEHEADER NOPRINT FILE=sdtab2
$TABLE IND ID TIME CL V K10 K12 K21 CMT IPRED DV PRED ONEHEADER NOPRINT FILE=patab2
1c: NONMEM code for Continuous Release gallbladder based Models:
;; 1. Based on: run1
;; 2. Description: Ex: Gallbladder -Continuous Release Model
;; x1. Author: Malek Okour
;; 3. Label:
$PROBLEM
$INPUT C ID TIME MDV EVID DV AMT CMT
$DATA simData.csv IGNORE=@
$SUBROUTINES ADVAN6 TOL=5
$MODEL
COMP=(GUT)
COMP=(body)
COMP=(GB)
$PK
KA=THETA(1)
CL =THETA(2)* EXP(ETA(1))
V = THETA(3)
S2 = V
K20=(CL/V)
K23= THETA(4)
K31=THETA(5)
$DES
DADT(1)= -KA*A(1)+K31*A(3)
DADT(2)= KA*A(1)-K20*A(2)-K23*A(2)
DADT(3)= K23*A(2)-K31*A(3)
$ERROR
IPRED = F
Y=F+F*ERR(1)
W=IPRED
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0,0.8) ;KA
(0,20) ;CL
(0,36) ;V
(0,0.2) ;K23
(0,0.7) ;K31
$OMEGA
0.04;
$SIGMA
0.04; ERR
$EST METHOD=1 INTER MAXEVAL=2000 NOABORT SIG=3 PRINT=1
$TABLE IND ID TIME DV MDV EVID CMT IWRES IPRED IWRES CWRES IRES PRED NOAPPEND ONEHEADER NOPRINT FILE=sdtab3
$TABLE IND ID TIME CL V K23 K31 CMT IPRED DV PRED ONEHEADER NOPRINT FILE=patab3
1d: NONMEM code for Single Bolus Release gallbladder based Models:
;; 1. Based on: run3
;; 2. Description: Ex: Gallbladder -Single Bolus Release Model
;; x1. Author: Malek Okour
;; 3. Label:
$PROBLEM
$INPUT C ID TIME MDV EVID DV AMT CMT
$DATA simData.csv IGNORE=@
$SUBROUTINES ADVAN6 TOL=5
$MODEL
COMP=(GUT)
COMP=(body)
COMP=(GB)
$PK
KA=THETA(1)
CL =THETA(2)* EXP(ETA(1))
V = THETA(3)
S2 = V
K20=(CL/V)
K23= THETA(4)
; Tgap at 6 hrs TAD
K31=0 ; or very small value like 0.00001
IF(TIME.GE.6) K31=THETA(5)
$DES
DADT(1)= -KA*A(1)+K31*A(3)
DADT(2)= KA*A(1)-K20*A(2)-K23*A(2)
DADT(3)= K23*A(2)-K31*A(3)
$ERROR
IPRED = F
Y=F+F*ERR(1)
W=IPRED
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0,0.8) ;KA
(0,20) ;CL
(0,36) ;V
(0,0.2) ;K23
(0,0.7) ;K31
$OMEGA
0.04;
$SIGMA
0.04; ERR
$EST METHOD=1 INTER MAXEVAL=2000 NOABORT SIG=3 PRINT=1
$TABLE IND ID TIME DV MDV EVID CMT IWRES IPRED IWRES CWRES IRES PRED NOAPPEND ONEHEADER NOPRINT FILE=sdtab4
$TABLE IND ID TIME CL V K23 K31 CMT IPRED DV PRED ONEHEADER NOPRINT FILE=patab4
1e: NONMEM code for Switch Function Release gallbladder based Models:
;; 1. Based on: run4
;; 2. Description: Ex: Gallbladder -Switch Function Release Model
;; x1. Author: Malek Okour
;; 3. Label:
$PROBLEM
$INPUT C ID TIME MDV EVID DV AMT CMT
$DATA simData.csv IGNORE=@
$SUBROUTINES ADVAN6 TOL=5
$MODEL
COMP=(GUT)
COMP=(body)
COMP=(GB)
$PK
KA=THETA(1)
CL =THETA(2)* EXP(ETA(1))
V = THETA(3)
S2 = V
K20=(CL/V)
K23= THETA(4)
; Tgap at 6 hrs TAD
K31=0 ; or very small value like 0.00001
IF(TIME.GE.6.AND.TIME.LE.8) K31=THETA(5)
$DES
DADT(1)= -KA*A(1)+K31*A(3)
DADT(2)= KA*A(1)-K20*A(2)-K23*A(2)
DADT(3)= K23*A(2)-K31*A(3)
$ERROR
IPRED = F
Y=F+F*ERR(1)
W=IPRED
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0,0.8) ;KA
(0,20) ;CL
(0,36) ;V
(0,0.2) ;K23
(0,0.7) ;K31
$OMEGA
0.04;
$SIGMA
0.04; ERR
$EST METHOD=1 INTER MAXEVAL=2000 NOABORT SIG=3 PRINT=1
$TABLE IND ID TIME DV MDV EVID CMT IWRES IPRED IWRES CWRES IRES PRED NOAPPEND ONEHEADER NOPRINT FILE=sdtab5
$TABLE IND ID TIME CL V K23 K31 CMT IPRED DV PRED ONEHEADER NOPRINT FILE=patab5
1f: NONMEM code for Sigmoid Function Release gallbladder based Models:
;; 1. Based on: run3
;; 2. Description: Ex: Gallbladder -Sigmoid Function Release Model
;; x1. Author: Malek Okour
;; 3. Label:
$PROBLEM
$INPUT C ID TIME MDV EVID DV AMT CMT
$DATA simData.csv IGNORE=@
$SUBROUTINES ADVAN6 TOL=5
$MODEL
COMP=(GUT)
COMP=(body)
COMP=(GB)
$PK
KA=THETA(1)
CL =THETA(2)* EXP(ETA(1))
V = THETA(3)
S2 = V
K20=(CL/V)
K23= THETA(4)
K31=THETA(5)
; EHC Sigmoid Function
DOSET = 0 ; TIME OF THE DOSE
THAT= THETA(6) ; TIME OF EHC
$DES
; EHC Sigmoid Function
EHC= ((T-DOSET)**100)/(((T-DOSET)**100)+THAT**100)
IF(T.GT.7) EHC=0; sometimes used in literature to limit the gb opening to certain period of time; here for ;1 hr
DADT(1)= -KA*A(1)+K31*A(3)*EHC
DADT(2)= KA*A(1)-K20*A(2)-K23*A(2)
DADT(3)= K23*A(2)-K31*A(3)*EHC
$ERROR
IPRED = F
Y=F+F*ERR(1)
W=IPRED
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0,0.8) ;KA
(0,20) ;CL
(0,36) ;V
(0,0.2) ;K23
(0,0.7) ;K31
(0,6) ;THAT
$OMEGA
0.04;
$SIGMA
0.04; ERR
$EST METHOD=1 INTER MAXEVAL=2000 NOABORT SIG=3 PRINT=1
$TABLE IND ID TIME DV MDV EVID EHC CMT IWRES IPRED IWRES CWRES IRES PRED NOAPPEND ONEHEADER NOPRINT FILE=sdtab6
$TABLE IND ID TIME CL V K23 K31 EHC CMT IPRED DV PRED ONEHEADER NOPRINT FILE=patab6
1g: NONMEM code for Sine Function Release gallbladder based Models:
;; 1. Based on: run6
;; 2. Description: Ex: Gallbladder -Sine Function Release Model
;; x1. Author: Malek Okour
;; 3. Label:
$PROBLEM
$INPUT C ID TIME MDV EVID DV AMT CMT
$DATA simData.csv IGNORE=@
$SUBROUTINES ADVAN6 TOL=5
$MODEL
COMP=(GUT)
COMP=(body)
COMP=(GB)
$PK
KA=THETA(1)
CL =THETA(2)* EXP(ETA(1))
V = THETA(3)
S2 = V
K20=(CL/V)
K23= THETA(4)
K31=THETA(5)
; EHC Sine Function
ACR= 6 ; The time of the appearance the first full sine wave; EHC peak; In other words, it is the time of the beginning of the first gallbladder opening
PRD= 6 ; The duration of one complete sine wave
PI= 3.1415; PI Value
$DES
; EHC Sigmoid Function
SINE= SIN(2*PI*(T-ACR)/PRD)
EHC=SINE
IF(SINE.LE.0) EHC=0
DADT(1)= -KA*A(1)+K31*A(3)*EHC
DADT(2)= KA*A(1)-K20*A(2)-K23*A(2)
DADT(3)= K23*A(2)-K31*A(3)*EHC
$ERROR
IPRED = F
Y=F+F*ERR(1)
W=IPRED
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0,0.8) ;KA
(0,20) ;CL
(0,36) ;V
(0,0.2) ;K23
(0,0.7) ;K31
(0,6) ;THAT
$OMEGA
0.04;
$SIGMA
0.04; ERR
$EST METHOD=1 INTER MAXEVAL=2000 NOABORT SIG=3 PRINT=1
$TABLE IND ID TIME DV MDV EVID EHC SINE CMT IWRES IPRED IWRES CWRES IRES PRED NOAPPEND ONEHEADER NOPRINT FILE=sdtab7
$TABLE IND ID TIME CL V K23 K31 EHC SINE CMT IPRED DV PRED ONEHEADER NOPRINT FILE=patab7
2: Example of the data set structure
C / ID / TIME / MDV / EVID / DV / AMT / CMT. / 1 / 0 / 1 / 1 / . / 1000 / 1
. / 1 / 0 / 0 / 0 / . / . / 2
. / 1 / 0.25 / 0 / 0 / . / . / 2
. / 1 / 0.5 / 0 / 0 / . / . / 2
. / 1 / 1 / 0 / 0 / . / . / 2
. / 1 / 2 / 0 / 0 / . / . / 2
. / 1 / 3 / 0 / 0 / . / . / 2
. / 1 / 4 / 0 / 0 / . / . / 2
. / 1 / 6 / 0 / 0 / . / . / 2
. / 1 / 8 / 0 / 0 / . / . / 2
. / 1 / 12 / 0 / 0 / . / . / 2
. / 1 / 14 / 0 / 0 / . / . / 2
. / 1 / 18 / 0 / 0 / . / . / 2
. / 1 / 24 / 0 / 0 / . / . / 2