simplicity.tree package
Submodules
simplicity.tree.filtered_infection_tree module
simplicity.tree.json_tree module
Created on Sun Mar 9 13:53:52 2025
@author: pietro
- simplicity.tree.json_tree.get_node_attributes(node)[source]
Extract all JSON-serializable attributes from an anytree Node, printing warnings for user-defined non-serializable ones.
simplicity.tree.newick module
Created on Tue Jan 18 19:57:13 2022
@author: pietro
simplicity.tree.nexus module
Created on Wed Jan 19 01:35:14 2022
@author: pietro
simplicity.tree.tree_builder module
Created on Thu Jan 16 09:51:20 2025
@author: pietro
- simplicity.tree.tree_builder.create_infection_node(row, parent_node)[source]
Creates a new infection node as a child of the given parent node.
- simplicity.tree.tree_builder.extend_parent_node(parent_node)[source]
Creates a duplicate of the parent node as a leaf child to prolong the branch.
- simplicity.tree.tree_builder.get_tree(experiment_name, seeded_simulation_output_dir, tree_type, tree_subtype='binary', coloring='lineage', save_plot=True, export_filetype='json', dashplot=False)[source]
Build the infection tree or the phylogenetic tree of the simulation.
- Parameters:
tree_type (str) – ‘infection’ or ‘phylogenetic’. Selects the type of tree to render.
tree_subtype (str)
TREE___________________________ (__________________________FOR INFECTION)
infection (binary - binary infection tree where each internal node is an) – event that has as offspring the newly infected individual and the parent that can continue to infect more individuals;
individual (compact - infection tree. Each node is an) – connected with all the people they infected
TREE__________________________ (_________________________FOR PHYLOGENETIC)
is (binary - binary phylogenetic tree where each internal node) – substitution event happening in the simulation
and (compact - lineages tree where each edge connects parent) – offspring lineages
________________________________________________________________________
save_plot (bool)
export (str) – file type to export tree (newick or nexus). The default is ‘nexus’.