computeLRF module¶
- 
pylabeledrf.computeLRF.computeELRF(intree1, intree2)¶
- Function to estimate the edge-based labeled Robinson-Foulds distance. This is a heuristic which returns an upper bound on the distance. - Trees need to have their inner nodes with a label attribute “speciation” or “duplication”. To correctly process gene trees from Ensembl, use the - parseEnsemblLabels().- Parameters: - intree1 – a labeled tree as Dendropy object
- intree2 – a labeled tree as Dendropy object
 
- 
pylabeledrf.computeLRF.computeLRF(intree1, intree2)¶
- Function to compute exactly the Labeled Robinson-Foulds (LRF) distance. - Trees need to have their inner nodes with a label attribute “speciation” or “duplication”. To correctly process gene trees from Ensembl, use the - parseEnsemblLabels().- Parameters: - intree1 – a labeled tree as Dendropy object
- intree2 – a labeled tree as Dendropy object
 
- 
pylabeledrf.computeLRF.mutateLabeledTree(tree, n, p_flip=0.3, model='LRF')¶
- Function to perform random edits to labeled tree. For each - nedit, the probability of a flip is specified by p_flip, and the rest of the probability density is evenly split among all potential edges to flip and all nodes with degree >3. Returns a new tree (leaves the input tree unchanged)- Parameters: - tree – a labeled tree as Dendropy object
- n – number of edits
- p_flip – probability of flipping between “duplication” and “speciation” state (0.3 by default)
- model – either ELRF, which requires edge additions/removals to be between same types, or LRF (default), which has no such requirement.
 
- 
pylabeledrf.computeLRF.parseEnsemblLabels(intree)¶
- Function to convert a Dendropy tree obtained from Ensembl (in NHX) format. Returns a new tree (leaves the input tree unchanged) - Parameters: - intree – a tree as Dendropy object 
- 
pylabeledrf.computeLRF.randomLabels(intree, p_speciation=0.7)¶
- Function to assign random speciation and duplication nodes to a tree. Returns a new tree (leaves the input tree unchanged) - Parameters: - intree – a tree as Dendropy object
- p_speciation – probability of a speciation node.