pub struct PhylogeneticTree {
pub labels: Vec<String>,
pub edges: Vec<(usize, usize, f64)>,
pub root: Option<usize>,
/* private fields */
}Expand description
A weighted tree over leaves labelled leaves (ids 0..leaves) and internal nodes (ids
leaves..). UPGMA trees are rooted; neighbour-joining trees are unrooted and are drawn rooted
at the final join for printing.
Fields§
§labels: Vec<String>§edges: Vec<(usize, usize, f64)>Undirected edges (a, b, length).
root: Option<usize>The root node, for rooted (UPGMA) trees.
Implementations§
Source§impl PhylogeneticTree
impl PhylogeneticTree
pub fn leaves(&self) -> usize
pub fn nodes(&self) -> usize
Sourcepub fn patristic_distances(&self) -> R2D
pub fn patristic_distances(&self) -> R2D
The path-length (patristic) distance between every pair of leaves along the tree.
Sourcepub fn to_newick(&self) -> String
pub fn to_newick(&self) -> String
The tree in Newick format, e.g. ((A:1.00000,B:1.00000):0.50000,C:1.50000);.
Sourcepub fn root_to_leaf_distances(&self) -> Option<Vec<f64>>
pub fn root_to_leaf_distances(&self) -> Option<Vec<f64>>
For rooted trees: the distance from the root to every leaf (equal for an ultrametric tree).
Trait Implementations§
Source§impl Clone for PhylogeneticTree
impl Clone for PhylogeneticTree
Source§impl Debug for PhylogeneticTree
impl Debug for PhylogeneticTree
Source§impl PartialEq for PhylogeneticTree
impl PartialEq for PhylogeneticTree
impl StructuralPartialEq for PhylogeneticTree
Auto Trait Implementations§
impl Freeze for PhylogeneticTree
impl RefUnwindSafe for PhylogeneticTree
impl Send for PhylogeneticTree
impl Sync for PhylogeneticTree
impl Unpin for PhylogeneticTree
impl UnsafeUnpin for PhylogeneticTree
impl UnwindSafe for PhylogeneticTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more