API Reference#
Base#
Convert an "ancestry matrix" to a vector |
|
Convert a list of edges to a Phylo2Vec vector |
|
Convert a Newick string to a Phylo2Vec vector or matrix |
|
Convert a list of pairs to a Phylo2Vec vector |
|
Convert a Phylo2Vec vector to an ancestry matrix |
|
Convert a Phylo2Vec vector to an edge list |
|
Convert a Phylo2Vec vector or matrix to Newick format |
|
Convert a Phylo2Vec vector to a list of pairs |
IO#
Read a text/csv file into a Phylo2Vec vector or matrix. |
|
Read a Newick string/file into a Phylo2Vec vector or matrix. |
|
Save a Phylo2Vec vector or matrix to a file. |
|
Save a Phylo2Vec vector or matrix to Newick format into a file. |
Statistics#
Compute the cophenetic distance matrix of a Phylo2Vec vector (topological) or matrix (from branch lengths). |
|
Compute the covariance matrix of a Phylo2Vec vector or matrix. |
|
Compute the incidence matrix of a Phylo2Vec vector. |
|
Compute a pairwise distance matrix for tree nodes from a Phylo2Vec vector. |
|
Compute the precision matrix of a Phylo2Vec vector or matrix. |
|
Compute the Robinson-Foulds distance between two trees. |
Utils#
Sample a random tree with branch lengths via Phylo2Vec, in matrix form. |
|
Sample a random tree via Phylo2Vec, in vector form. |
|
Input validation of a Phylo2Vec matrix |
|
Apply an integer-taxon label mapping (label_mapping) from a string-based newick (where leaves are strings) and produce a mapped integer-based newick (where leaves are integers) |
|
Create an integer-taxon label mapping (label_mapping) from a string-based newick (where leaves are strings) and produce a mapped integer-based newick (where leaves are integers) this also remove annotations pertaining to parent nodes |
|
Calculate the number of leaves in a tree from its Newick |
|
Remove branch lengths annotations from a Newick string |
|
Remove parent labels from the Newick string |
|
Add a leaf to a Phylo2Vec vector v |
|
Input validation of a Phylo2Vec vector |
|
Get the most recent common ancestor between two nodes in a Phylo2Vec tree. |
|
Get the depth of a node in a Phylo2Vec tree. |
|
Get the depths of all nodes in a Phylo2Vec tree. |
|
Produce an ordered version (i.e., birth-death process version) of a Phylo2Vec vector using the Queue Shuffle algorithm. |
|
Remove a leaf from a Phylo2Vec v |
|
Reroot a tree in phylo2vec format at a given node |
|
Reroot a tree in phylo2vec format at a random node |