+--------------------------------------------------------------------+
 |                                                                    |
 |                        PLASMA URINE EXAMPLE                        |
 |                                                                    |
 +--------------------------------------------------------------------+

 Here  are  several  examples  of simultaneous modelling of plasma  and
 urine data.  The examples are adapted from a model for the analysis of
 Dextromethorphan  data  provided  by  Khaled Mohammed Abduljalil.  The
 first involves data from the parent drug.  The  second  involves  both
 parent  and metabolite data.  In the control streams of these examples
 plasma and urine data are simulated.  The same control  streams  could
 also  be used for analysis of the data.  MU_ modelling is used for the
 simulation to maintain consistency with subsequent analysis  runs  but
 MU_  modelling  has  no  effect  on  simulation.  If MU_ variables are
 renamed to avoid the character "_" (e.g., rename  MU_1  as  MU1),  the
 same control streams may be run with NONMEM VI.

 EXAMPLE 1 sim_parent_a2.ctl

 The  data  dextroparent.dat  contains  data from only the parent drug.
 The parent drug is elimated directly to urine, and also via conversion
 to  metabolite,  but there are no measurements of metabolite in plasma
 or urine.  The fraction F0 of parent drug in the urine is computed  as
 in  Guide  V,  Chapter 4, Section 3.1 equation (4.6) and Section 3.4.1
 equation (4.7).
 (See Guide V, Chapter 4.3)

 The L2 data item is not required, but is used because multiple  obser-
 vations  at  the  same  TIME  are in effect multivariate observations.
 Values of SIGMA corresponding to unused elements EPS(3) and EPS(4) are
 defined  so  that the EPS vector has the same length in both examples.
 See Remarks below.

 Although ADVAN2 is used, the same control stream could be  implemented
 with ADVAN5 or ADVAN6 or ADVAN7, with minor changes.

 $PROBLEM  Parent drug, using ADVAN2
 $INPUT ID TIME AMT UVOL DV CMT MDV EVID L2
 $DATA dextroparent.dat IGNORE=#
 $SUBROUTINES ADVAN2 TRANS1
 $PK
   K12=THETA(1)
   KA=K12
   MU_1=LOG(THETA(2))
   V2=EXP(MU_1+ETA(1))
   MU_2=LOG(THETA(3))
   CLP=EXP(MU_2+ETA(2)) ; RENAL CL FOR PARENT
   CLB=THETA(4)         ; METABOLIC CL FOR METABOLIC
   K23=CLP/V2+CLB/V2
   K=K23
   F0=CLP/(CLP+CLB)
   S2=V2
   S3=UVOL
 $ERROR (EVERY EVENT)
   ACMT=ABS(CMT) ; output compt. may have neg. value of CMT
   IF(ACMT.EQ.2) Y=F*(1+EPS(1))
   IF(ACMT.EQ.3) Y=F*(1+EPS(2))
 $THETA
   (0.01,0.8,6) ;KA
   (0.01,43,1000);V2
   (0.0001,20,190);CLP
   (0.01,15,90);CLB
 $OMEGA
   0.05  0.05
 $SIGMA
   .01 .01
   .01 .01 ; eps(3), eps(4) for consistent EPS with sim_metab_a6 example
 $SIM (111111) ONLYSIM
 $TABLE ID TIME AMT UVOL DV SIMP=PRED CMT MDV
        EVID L2 NOAPPEND FILE=sim_parent_a2.tab

 A fragment of the data file is as follows:

 #  ID TIME  AMT        UVOL   DV    CMT    MDV   EVID  L2
 2.000 0.000 30000.000  0.000  0.000  1.000 1.000 1.000 1
 2.000 0.171     0.000   0.000 0.000  3.000 1.000 2.000 1
 2.000 2.000     0.000   0.000 0.000  2.000 0.000 0.000 1
 2.000 2.000     0.000  93.100 0.000 -3.000 0.000 0.000 1
 2.000 2.000     0.000   0.000 0.000  3.000 1.000 2.000 2
 2.000 3.150     0.000   0.000 0.000  2.000 0.000 0.000 2
 2.000 3.150     0.000 133.600 0.000 -3.000 0.000 0.000 2

 There is a dose at TIME=0.  At TIME=.171, the urine compartment (which
 is the default compartment for output) is turned on.  At TIME=2, there
 are  observations of both plasma and urine.  The urine amount is reset
 to 0 and the compartment turned back on for the start of a  new  urine
 collection.  At TIME 3.15 there are observations of plasma and urine.

 In  the  model,  different EPS variables are used for the two types of
 observations.  In the table, values of PRED (SIMP) are  computed  with
 ETA and EPS equal to 0.  The DV values are computed with simulated ETA
 and EPS, and would be used as the DV in subsequent analysis runs.

 EXAMPLE 2 sim_metab_a6.ctl

 The data  dextrometab.dat   includes  measurements  of  metabolite  in
 plasma  and  urine.  The model also include predictions of the metabo-
 lite in both plasma (CMT=4) and urine (CMT=5; the default  compartment
 for  output).   Different compartments are used for parent and metabo-
 lite in urine, but the same value of UVOL applies  to  both.   The  F0
 parameter  is  not needed because the model for K23 now uses only CLP,
 the clearance of the parent drug.  No analytic  ADVAN  model  has  two
 output  compartments,  so a general ADVAN (ADVAN6 or ADVAN5 or ADVAN7)
 must be used.

 Note that Compartment 3 is no longer the default for output.   Instead
 of being computed by PREDPP using mass balance, it is computed explic-
 itly by the  ADVAN routine itself (e.g., using a differential equation
 when  ADVAN6  is  used).   If  compartment 3 is defined in $MODEL with
 default attributes, e.g.,
 COMP=(DEXURIN)
 there is an error messsage from PREDPP:
 SPECIFIED COMPARTMENT MAY NOT BE TURNED OFF WITH AN OBSERVATION RECORD
 Instead, the compartment may be defined as an output-type compartment:
 COMP=(DEXURIN INITIALOFF NODOSE)
 Now observations with CMT=-3 are permitted and no change to the origi-
 nal data records is needed.

 $PROBLEM  Parent drug and metabolite, using ADVAN6
 $INPUT ID TIME AMT UVOL DV CMT MDV EVID L2
 $DATA dextrometab.dat IGNORE=#
 $SUBROUTINES ADVAN6 TRANS1 TOL=4
 $MODEL
   COMP=(DEPOT)
   COMP=(PLASMA DEFOBS) ; PARENT IN PLASMA
   COMP=(DEXURIN INITIALOFF NODOSE)  ;PARENT IN URINE
   COMP=METAB    ;METABOLITE IN PLASMA
 $PK
   K12=THETA(1)
   MU_1=LOG(THETA(2))
   V2=EXP(MU_1+ETA(1))
   MU_2=LOG(THETA(3))
   CLP=EXP(MU_2+ETA(2)) ; RENAL CL FOR PARENT
   CLB=THETA(4)         ; METABOLIC CL FOR METABOLIC
   CLMR=THETA(5)        ; RENAL CL FOR METABOLITE
   V4=1
   K24=CLB/V2
   K23=CLP/V2
   ; F0=CLP/(CLP+CLB) Omit F0 because parent and
   ; metab have different urine compts.
   K45=CLMR/V4
   S2=V2
   S4=V4
   S3=UVOL
   S5=UVOL
 $ERROR (EVERY EVENT)
   ACMT=ABS(CMT) ; output compart. may have neg. value of CMT
   IF(ACMT.EQ.2) Y=F*(1+EPS(1))
   IF(ACMT.EQ.3) Y=F*(1+EPS(2))
   IF(ACMT.EQ.4) Y=F*(1+EPS(3))
   IF(ACMT.EQ.5) Y=F*(1+EPS(4))
 $DES
   DADT(1)=-K12*A(1)
   DADT(2)=K12*A(1)-K23*A(2)-K24*A(2)
   DADT(3)=K23*A(2)
   DADT(4)=K24*A(2)-K45*A(4)
 $THETA
   (0.01,0.8,6) ;KA
   (0.01,43,1000);V2
   (0.0001,20,190);CLP
   (0.01,15,90);CLB
   (0.0001,5,90);CLMR
 $OMEGA
   0.05  0.05
 $SIGMA
   .01 .01 .01 .01
 $SIM (111111) ONLYSIM
 $TABLE ID TIME AMT UVOL DV SIMP=PRED CMT MDV EVID L2 NOAPPEND
        FILE=sim_metab_a6.tab

 A fragment of the data dextrometab.dat is:

 #  ID  TIME  AMT         UVOL  DV    CMT    MDV   EVID  L2
 2.000  0.000 30000.000   0.000 0.000  1.000 1.000 1.000 1
 2.000  0.171     0.000   0.000 0.000  3.000 1.000 2.000 1
 2.000  0.171     0.000   0.000 0.000  5.000 1.000 2.000 1
 2.000  2.000     0.000   0.000 0.000  2.000 0.000 0.000 1
 2.000  2.000     0.000   0.000 0.000  4.000 0.000 0.000 1
 2.000  2.000     0.000  93.100 0.000 -3.000 0.000 0.000 1
 2.000  2.000     0.000  93.100 0.000 -5.000 0.000 0.000 1
 2.000  2.000     0.000   0.000 0.000  3.000 1.000 2.000 2
 2.000  2.000     0.000   0.000 0.000  5.000 1.000 2.000 2
 2.000  3.150     0.000   0.000 0.000  2.000 0.000 0.000 2
 2.000  3.150     0.000   0.000 0.000  4.000 0.000 0.000 2
 2.000  3.150     0.000 133.600 0.000 -3.000 0.000 0.000 2
 2.000  3.150     0.000 133.600 0.000 -5.000 0.000 0.000 2

 Observations  of  metabolite in plasma (CMT=4) and metabolite in urine
 (CMT=5) are present at the same values of TIME as observations of par-
 ent  in  plasma (CMT=2) and parent in urine (CMT=3), respectively, and
 have the same values of L2.

 Remarks:

 After the control streams are run, the predictions SIMP  for  compart-
 ments  2  and  3 are the same in the two table files sim_parent_a2.tab
 and sim_metab_a6.tab,  as expected, because  they  are  computed  with
 EPS=0,  i.e., they are not simulated values.  Because of the use of L2
 and the same-length EPS vector in both examples,  the  simulated  DV's
 for compartments 2 and 3 are also the same.  This is useful for illus-
 trative and debugging purposes, but is not usually the case  when  the
 EPS structure is different, or the L2 data item is not used.
 To summarize:
 With  L2,  during  simulation SIMEPS generates a new set of values for
 EPS only when L2 changes value.
 Without L2, during simulation SIMEPS generates a new set of values for
 EPS  with  every record, even when MDV is 1 or the PREDPP item EVID is
 not 0.

 (See simeps).

 All control streams and data files are found in the NONMEM  7.4  exam-
 ples\dextro directory.

 dextroparent.dat (also displayed here)
 sim_parent_a2.ctl (also displayed here)
 sim_parent_a5.ctl
 sim_parent_a6.ctl
 dextrometab.dat (also displayed here)
 sim_metab_a5.ctl
 sim_metab_a6.ctl (also displayed here)

 REFERENCES: None.


  
Go to main index.
  
Created by nmhelp2html v. 1.0 written by Niclas Jonsson (Modified by AJB 5/2006,11/2007,10/2012)