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

!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.

!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.

Return to start