-
Notifications
You must be signed in to change notification settings - Fork 5
Generating Species Trees
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
python3 Zombi.py Tb ./Parameters/SpeciesTreeParameters.tsv ./Output_folder
In this mode, 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).
python3 Zombi.py Tp ./Parameters/SpeciesTreeParameters.tsv ./Output_folder
This mode allows the user to fine control the number of lineages per unit of time. The user must give in a line different times followed by the goal population size for each time, as in:
TIME1-LINEAGEGOAL1;TIME2-LINEAGEGOAL2; TIMEn-LINEAGEGOALn
For instance:
LINEAGE_NUMBER 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 lineage number 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 lineage number is attained. If the lineage number is attained before the time is 100, then the species tree 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 lineage number goal is 15000. The same process is repeated. Only speciations will take place until the new goal is attained. After time 300, the lineage number 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
This mode 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
CompleteTree.nwk The complete 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
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 program will start again
SPECIATION, EXTINCTION
Rates of evolution for the different events
TURNOVER
Specific for Tp mode, 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 Tp mode, refer to the section above to understand