Wiki

Clone wiki

Flink / Launching Flink

Launching Flink

The program Flink is launched via the command line, and the user can choose among several tasks. The arguments have to be passed on the command line. The required syntax is as follows:

./Flink name=value

where “name” is the name of an argument and “value” is the corresponding value. The list of parameters that can be inferred or fixed are:

  • A_max
  • B
  • lnK
  • S
  • alpha_max
  • beta
  • lnkappa
  • Sg

Click here to have a graphical representation to understands the hierarchy of the several parameters.
When only a group is inferred, we can just use alpha_max, beta, kappa and Sg, without the necessity of fixing the other parameters.
The states S and Sg are defined in a range of values those are given by fixing the argument “s_max” (default value equal to 5), so they can be chosen in the range [0, 2*s_max].
You can also choose the parameter “mu” that is involved in the generating matrix (the default value is 0.9) and the maximum distance to group the sites of a chromosome (maxDist, with default value equal to 1000000).

Fixing a parameter

You can fix a parameter of the previous list in two ways:

  • a single value, which imply that all the groups or the populations (according to the parameter) will share the same value.
  • a list of values, which will attribute a different value to each group or population (according to the parameter), dividing the different values by a comma and adding square brackets for population parameters. The brackets of different populations have to be divided by a comma.

For example, having two groups with each one having two populations, we can fix all the beta (population parameter) and the alpha_max (group parameter) in the following way:

  • beta=-2.0 alpha_max=1.0
  • beta=[-2.0,-2.0],[-2.0,-2.0] alpha_max=1.0,1.0

Inferring a parameter

To infer a parameter, valid only with the task=estimate, we have to distinguish among world (A_max), group (B and alpha_max) and population parameters (beta) with the exception of lnK and lnkappa that will be discussed afterwards:

  • world parameter: write between quotes the mean of the prior and its standard deviation separated by a comma
  • groups parameter:
    1. write between quotes and round brackets the mean of the prior and its standard deviation separated by a comma. This imply that all the groups will be initialised with the same mean and the same standard deviation.
    2. write between quotes a list of round brackets. Each pair of round brackets will contain the mean of the prior and its standard deviation separated by a comma.

  • population parameter:
    1. write between quotes, square brackets and round brackets the mean of the prior and its standard deviation separated by a comma. This imply that all the populations will be initialised with the same mean and the same standard deviation.
    2. write between quotes, square brackets and round brackets the mean of the prior and its standard deviation separated by a comma for each group. Each pair of square brackets has to be divided by a comma. This imply that all the populations of a group will be initialised with the same mean and the same standard deviation.
    3. write between quotes a list of square brackets and round brackets. Each pair of round brackets will contain the mean of the prior and its standard deviation separated by a comma. Each pair of square brackets will contain the list of round brackets belonging to the same group, divided by a comma. Also the different couple of square brackets have to be divided by a comma.

The lnK and the lnkappa parameters can contain instead the minimum and the maximum of the range where the parameter can be inferred.
The range of lnK has to be written between quotes, with the minimum as the first value and the maximum as the second one, divided by a comma.
The range of lnkappa has to be written between quotes and round brackets, with the minimum as the first value and the maximum as the second one, divided by a comma. Each pair of round brackets has to be separated by a comma.

Example of inferring parameters for two groups containing three and one populations respectively:

A_max="1.0,0.1" B="(-1.0,0.1)" lnK=”-10,-0.1” beta="[(-2.0,0.1)]" alpha_max="(3.0,0.1)" lnkappa="(-20,-0.1),(-10,-0.2)"
or
A_max="1.0,0.1" B="(-1.0,0.1)" lnK=”-10,-0.1” beta="[(-2.0,0.1)],[(-3.0,0.2)]" alpha_max="(3.0,0.1),(2.5,0.2)" lnkappa="(-20,-0.1),(-10,-0.2)"
or
A_max="1.0,0.1" B="(-1.0,0.1)" lnK=”-10,-0.1” beta="[(-2.0,0.1),(-2.0,0.1),(-2.0,0.1)],[(-3.0,0.2)]" alpha_max="(3.0,0.1),(2.5,0.2)" lnkappa="(-20,-0.1),(-10,-0.2)"

Available Tasks

Flink is designed to perform multiple tasks. To specify the desired task, the mandatory argument task has to be specified on the command line. Available tasks are:

Input file

Except for the task=simulate where you can choose another procedure instead of giving an input file, you have to provide an input file fixing it with the argument data=NameInputFile. The first two rows of the input file have to contain the name of the groups and the name of the populations respectively (see the example input file). The following rows have to contain in the first column the name of the chromosome, in the second column the position of the site and in the others the population allele frequencies.

example of an input file:

-    -    Group_A    Group_A    Group_B    Group_B
-    -    Pop_A0    Pop_A1    Pop_B0    Pop_B1
Chr1    1    9554/10000    7763/10000    8945/10000    8003/10000
Chr1    5    41/10000    1/10000    1008/10000    2002/10000
Chr2    13    1183/10000    1723/10000    891/10000    720/10000
Chr2    24    20/10000    10/10000    1782/10000    2945/10000

N.B. The loci positions of the same chromosome have to be in ascending order.

##Progress Report & Log File

By default, Flink writes only minimal information to the screen. To get a more detailed progress report printed to the screen, simply add the argument verbose on the command line, for instance:

./Flink verbose

Alternatively, Flink can also write the progress report to a log file. To invoke this, simply use the argument logFile, followed by the name of the desired file. For instance,

./Flink logFile=example.log

will tell Flink to write the progress report to a file named example.log. Note that this will overwrite any existing file with that name. Note further that verbose and logFile can both be used at the same time.

Fixed Seed

The number random generator of the model can be fixed with the argument fixedSeed

example

./Flink fixedSeed=1234

Updated