phylox.generators.zods.zods
A module for generating (random) phylogenetic networks.
This implements the algorithm from the paper: Zhang, C., Ogilvie, H.A., Drummond, A.J., Stadler, T.: Bayesian inference of species networks from multilocus sequence data. Molecular biology and evolution 35(2), 504–517 (2018)
Functions
|
Converts a multree to a DiNetwork. |
- phylox.generators.zods.zods.multree_to_dinetwork(multree, hybrid_nodes)
Converts a multree to a DiNetwork.
- Parameters:
multree (networkx.DiGraph) – The multree to convert. Edges must have a LENGTH_ATTR attribute.
hybrid_nodes (dict) – A dictionary mapping hybrid nodes to their hybrid number.
- Returns:
network – The converted network.
- Return type:
- phylox.generators.zods.zods.generate_network_zods(time_limit, speciation_rate, hybridization_rate, seed=None)
Generates a network with the ZODS model.
- Parameters:
time_limit (float) – The time limit of the network.
speciation_rate (float) – The speciation rate of each lineage in the network.
hybridization_rate (float) – The hybridization rate of each pair of lineages in the network.
seed (int or None) – The seed to use for the random number generator.
- Returns:
network – The generated network.
- Return type: