+--------------------------------------------------------------------+
 |                                                                    |
 |                             NMTEMPLATE                             |
 |                                                                    |
 +--------------------------------------------------------------------+

 MEANING: NMTEMPLATE program
 CONTEXT: NONMEM run

 USAGE:

 ..\util\nmtemplate   source-template-file  destination-file  var1=val1
 var2=val2 ...

 where var1=val1 is a variable name, and value  to  substitute  in  the
 template file.  The variable var1 must in turn appear as <var1> in the
 template file, and is case sensitive.  Similarly for var2, var3, etc.

 DISCUSSION:

 The utility program nmtemplate in the ..\util directory  will  perform
 variable  substitution on appropriately tagged control stream template
 files, and produce executable control stream files.

 SAMPLE:
 nmtemplate nmtemp.nmt nmtemp.ctl NMID=47 TH1=1.7 TH2=1.4 TH3=0.8 TH4=2.0

 The lines of interest in file ..\util\nmtemp.nmt are:

 $DATA nmtemp2.csv IGNORE=C ACCEPT=(ID.EQ.<NMID>)
 $THETA <TH1> <TH2> <TH3> <TH4>

 Note that <NMID> is to be replaced with a particular NONMEM ID  number
 by  nmtemplate,  and the <THX> are to be replaced with specific values
 of thetas.  The resulting file nmtemp.ctl will have the various values
 substituted  into the various <> placeholders, and is ready to be read
 by NMTRAN:

 nmfe7 nmtemp.ctl nmtemp.res

 In the above nmtemp.nmt example, because FNLETA=2,  then  NONMEM  will
 simply  evaluate  the  IPRED  values  using the inputted etas from the
 $ETAS record without performing an estimation.

 Another example template file is example6.nmt listed  in  the  ..\util
 directory, that you may inspect for other ideas.

 Actually,  nmtemplate  is a general variable substitution program, and
 can process any text file in the manner shown above.  Consider a FINE-
 DATA control stream file template (nmtemp.fnt):

 $INPUT C SET ID JID TIME  DV=CONC AMT=DOSE RATE EVID MDV
        CMT CLX V1X QX V2X SDIX SDSX
 $DATA nmtemp.csv IGNORE=C
 $FINEDATA AXIS=TIME(LIN) TSTOP=<TSTOP> TSTART=<TSTART>
           NEVAL=<NEVAL> FILE=nmtemp2.csv

 in which the tstart, tstop, and neval parameters are to be inserted:

 nmtemplate nmtemp.fnt nmtemp.fnd TSTART=0 TSTOP=100 NEVAL=200

 resulting in the FINEDATA control stream file nmtemp.fnd:

 $INPUT C SET ID JID TIME  DV=CONC AMT=DOSE RATE EVID MDV CMT
        CLX V1X QX V2X SDIX SDSX
 $DATA nmtemp.csv IGNORE=C
 $FINEDATA AXIS=TIME(LIN) TSTOP=100 TSTART=0 NEVAL=200
           FILE=nmtemp2.csv

 Note  that  only  words that match the variable list at the nmtemplate
 command line, and have enclosing brackets <>, will  be  replaced  with
 the  suggested  values.  The values may also be text with no spaces in
 them.

 Nmtemplate may be used with a DOS patch script (which  could  also  be
 converted to an R/S-PLUS script or function).

 Another  feature  of  nmtemplate is that the user may request a random
 number to be generated to serve as a value, by referring to
  R(a1,a2,a3).  R(a1,a2,a3) is a special function of nmtemplate,  which
 obtains  a  uniform random variate between a1 and a2.  If a seed a3 is
 given that is not 0, it means to initialize the seed.  The initializa-
 tion should be done once in a series.

 For example, the following line sets the seed:

 nmtemplate wexample12.nmt dummy.ctl SAMPLE= R(1,10000,113345)
 to be substituted wherever <SAMPLE> shows up in the template file with
 a throw-away result file dummy.ctl.  The template file  wexample12.nmt
 may contain:
 $EST METHOD=CHAIN FILE=wexample12.txt NSAMPLE=0 ISAMPLE=<SAMPLE>
 and the resulting files will contain random ISAMPLE values.

 See Guide Introduction_7 for details and examples.

REFERENCES: Guide Introduction_7

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