This is a library to make computations over trees in parent array representation. I built it mainly to teach myself various algorithms related to trees, from transversal to simulation. Keep in mind that by tree I mainly have in mind rooted, phylogenetic trees, or latent trees in the language of graph theory. Trees and latent trees are obviously related concepts, but the code is organized a bit differently depending on what you have in mind.
The library consists of four modules:
neattrees_generate.py generates trees with some stochastic process, either without and with branch lengths. That is, every function takes as input some parameters about the stochastic process and gives back a tree.
neattrees_modify.py modifies pre-existing tree by adding leafs, removing them or re-wiring the current treee. That is, every function takes as input a tree and gives back another tree.
neattrees_compute.py is a module containing function that compute properties of tree. That is, every functions take as input a tree and gives back some properties of it.
neattrees_visualize.py is a module containing function that allow to visualize a tree. That is, every function takes as input a tree and output a graphical representatin of it.
The folder 'example' contains a simple non-trivial application of the library. I simulate a coalescent tree with a Kingman process and I compute the probability of adding an extra leaf at some time t back in the past.