Methods and parameter sets are Bash scripts. This means that you may use any Bash code in them. It is useful, however, to know what environment this scripts are executed in.
Please recollect that actually there is no difference between parameters and methods. This separation only suggest you the better usage.
Assume that Makefile contains statement:
MXP_MAKEFILE[target]="(t1_DIR = target1, t2_DIR = target2) param1 + param2 : method1 + method2"
This means that target
target will be obtained in the following way:
t1_DIRwill be set to the full path to directory of
target1; similarly, variable
t2_DIRwill be set to the full path to directory of
target2. These variables will be
method2.shwill be sequentially
sourced in subshell. In nother words, MXP will execute Bash statement:
( source param1.params.sh; source param2.params.sh; source method1.sh; source method2.sh )
Sourcing scripts allows you to define Bash arrays in parameter scripts and use them in method scripts. Note that arrays cannot be
In addition to environmental variables
t2_DIR explicitly specified in Makefile statement, MXP will export the following environmental variables:
- Full path to the analysis directory.
- Dataset name (taken from
- The name of the target being built.
- Full path to the directory of the target being built. All output files should be written to this directory.
- Space-separated list of required target names, in the order they appear in Makefile statement.
- Space-separated list of full paths to required target directories. In our example, it is the same as
In addition, subdirectory
tmp is created inside
$MXP_TARGET_DIR. The script(s) should write all intermediate output to this directory. It is recommended to preserve the contents of this directory until it is clear that pipeline works correctly — if something went wrong, the intermediate output may help to find a reason. Later
tmp subdirectory may be safely removed with all its contents.