This folder contains scripts at the core of the fitness estimation and prediction machinery.

############################################################
solve_survival.py

this scripts provides a class that solves the branching process equation numerically and uses it to integrate the branch propagator between the desired time points. 

############################################################
fitness_inference.py

this script provdies a class with the basic fitness inference. It uses the actual numerical solution for the propagator rather than the tree length approximation. 

############################################################
node_ranking.py

this scripts provides a number of utility functions for trees, in particular building trees, labeling, translating, etc. It also contains the class that establises a tree, infers the ancestral states and then infers fitness of all nodes. It provides functions for ranking nodes by different  methods, the major being the inferred fitness. It also colors its own trees.

############################################################
sequence_ranking.py

this script provides two classes: An alignment class which dresses an biopython alignment with an outgroup, a tree and an amino acid alignment if a coding region is provided. 

The other class is a subclass of node_ranking that takes an alignment as input and runs a prediction.

############################################################
ancestral.py

inference of ancestral sequences on a tree using a variant of dynamic programming to calculate the most likely sequences of internal nodes.
