Paths and Loops
Introduction
ASReml was designed to analyse just one model per run.
However, the analysis of a data set typically requires many runs,
fitting different models to different traits. It is often
convenient to have all these runs coded into a single
.as file and control the details from the command line
(or top job control line) using arguments. The highlevel qualifiers
!CYCLE
and !DOPATH
with !RENAME and
!ARGS
enable multiple analyses to be defined
and run in one execution of ASReml.
!CYCLE [!SAMEDATA]
!CYCLE list
is a mechanism whereby ASReml can loop through a series of jobs,
writing all the output to a single file (of each output type).
The !CYCLE qualifier must
appear on its own line, starting in character 1. list is
a series of values which are substituted into the job wherever the $I
string appears.
For example
!CYCLE 0.4 0.5 0.6
20 0 mat2 1.9 $I !GPF
would result in three runs and the results would be appended
to a single file.
When
list
contains an integer sequence, the sequence can be given as
i:j
for example
!CYCLE 1:1000
would generate 1000 analyses in one job.
A cycle string may consist of up to 4 substrings, separated by
a semicolon and referenced as
$I $J $K and $L
respectively. For example
!CYCLE Y1;X1 Y2;X2
$I ~ mu $J
When cycling is active, an extra line is written to the .asr
file containing some details of the cycle in a form
which can be extracted to form an analysis summary by searching for LogL:.
A heading for this extra line is written in the first cycle. For
example
LogL: LogL Residual NEDF NIT Cycle Text
LogL: -208.97 0.703148 587 6 1466 "LogL Converged"
LogL: line with the highest LogL value
repeated at the end of the .asr file.
All the standard output from use of CYCLE is written sequentially to the respective
output files. Consequently, some output files may become huge. Therefore,
if particular output is not required, it should be suppressed.
Use
!SLNFORM -1 to suppress the .sln file;
!YHTFORM -1 to suppress the .yht file;
!TXTFORM -1 to suppress the .sln, .yht and .pvs files.
ASReml will reduce the output to the .asr file after the first cycle,
in particular the data summary. Use !BRIEF -1 to prevent that reduction.
!SAMEDATA
Reading the data file can be a significant component of execution time when the data file is large.
If the data used in each CYCLE is the same, this overhead can be avoided by specifying !SAMEDATA.
Note that 'same data' means the same records and variables in the data summary,
not necessarily the same response variable or model variables.
!DOPATH and !PATH
The qualifiers !DOPART
and !PART have been extended in release 2.0 and !DOPATH and
!PATH
are thought to be more appropriate names. Both spellings
can be used interchangably.
!DOPATH n
allows
several analyses to be coded and run sequentially without
having to edit the .as file between runs.
Which particular lines in the .as file are honoured
is controlled by the argument n
in conjunction with !PATH
(or !PART)
statements.
The argument (n) is often
given as $1 indicating that the actual path to use
is specified as the first
argument
on the command line.
The default value of n is 1.
!DOPATH n
can be located anywhere in the job
but if placed on the top job control line, it cannot have the form
!DOPATH $1 unless the arguments are on the command line
as the !DOPATH qualifier will be parsed before any job arguments
on the same line are parsed.
!PATH list
must be at the beginning of its own line anywhere in the job
after the DOPATH qualifier.
list contains the path numbers for the following lines
(until the next !PATH statement)
so that the following lines are honoured if any one of the listed path numbers
is active.
For example
...
mydata.asd !DOPATH 4
!PATH 2 4 6
...
situation where this might be useful is where it is necessary to run simpler models to get reasonable starting values for more complex variance models.
The more complex models are specified in later parts and the !CONTINUE command is used to pick up the previous estimates.
Back to general qualifiers
Highlevel directives
Return to index