Skip to content

Generating Species Trees

AADavin edited this page May 6, 2018 · 22 revisions

Basic Mode (T)

Zombi uses a Birth-death model to generate a species tree. Lineages can speciate given rise to two new lineages or go extinct over time. The usage is:

python3 Zombi.py T ./Parameters/SpeciesTreeParameters.tsv ./Output_folder

Advanced Modes

Mode Tb - Branch-wise extinction and speciation rates

python3 Zombi.py Tb ./Parameters/SpeciesTreeParameters.tsv ./Output_folder

In this model, speciation and extinction rates are specific for each branch. Each time one new lineage emerges, a new value for its extinction and speciation rates its sampled from a user defined distribution (uniform, normal or lognormal).

Mode Tp - Fine control of population

python3 Zombi.py Tp ./Parameters/SpeciesTreeParameters.tsv ./Output_folder

This model allows the user to fine control the size of the population. The user must give in a line different times followed by the goal population size for each time, as in:

TIME1-POPULATIONGOAL1;TIME2-POPULATIONGOAL2; TIMEn-POPULATIONGOALn

For instance:

POPULATION_SIZES 100-200;300-15000;500-50

By running this, the simulation runs for 500 units of time. In the first 100 units of time, the population goal is 200. First, as we have only one lineage alive at the beginning (the root), there will be only speciation events at the rate given by the user until the population size is attained. If the population size is attained before the time is 100, then the population will reach an equilibrium, in which there is a turnover of species at the rate given by the parameter TURNOVER. Then, after time 100, the new population goal is 15000. The same process is repeated. Only speciations will take place until the new goal is attained. After time 300, the population goal is 50. In this case, only extinctions will take place until this final goal is attained. The simulation will end up when time == 500

Mode Ti - Preparing Zombi with an input tree by the user

This model allows the user to input a species tree. In this case, the command is slightly different:

python3 Zombi.py Ti YourTreeFileInNewick ./Output_folder

This command will translate your tree into a file with the events taken place on it, something used by the other modes of Zombi. If you want to simulate genomes in your own tree, running this command is a prerequisite.

Watch out! Your tree must be ultrametric, otherwise, Zombi has no way to know which species survive till the present time

Output

WholeTree.nwk The whole species tree including the dead lineages, in newick format

ExtantTree.nwk The surviving species tree, in newick format

Events.tsv: Events (speciation and extinction) taking place in the species tree

Parameters

STOPPING_RULE

  • 0: Time stops arriving at TOTAL_TIME
  • 1: Tree evolves until a total of species = N_LINEAGES (alive) have been generated

TOTAL_TIME

To use with the stopping rule 0. Otherwise is ignored

N_LINEAGES

To use in combination with the stopping rule 1. Otherwise is ignored

MIN_LINEAGES

When using with the stopping rule 0, if the alive lineages in the tree are <= MIN_LINEAGES the run will be considered a failure and the program will start again

MAX_LINEAGES

If the run attains this number of lineage the simulation is killed ant the progra will start again

SPECIATION, EXTINCTION

Rates of evolution for the different events

TURNOVER

Specific for mode Tp, it controls the rate at which new species appear and disappear at the equilibrium. Each time a turnover takes place, two random lineages are chosen. One goes extinct and the other speciates.

POPULATION_SIZES

Specific for mode Tp, refer to the section above to understand

Clone this wiki locally