pub struct Tree {
pub id: Uuid,
pub name: String,
pub min_branch_support: f64,
pub root: Clade,
pub annotations: Option<Vec<Annotation>>,
pub kmers_map: Option<KmersMap>,
/* private fields */
}Fields§
§id: UuidThe unique identifier for the tree.
The id is a unique identifier for the tree. The id is a Universally Unique Identifier (UUID) that is generated when the tree is created.
name: StringThe human-readable name for the tree.
When the tree is created using the from_file function, the name is set from the file name where the tree is parsed from.
min_branch_support: f64The minimum branch support value.
The minimum branch support value is the minimum support value for a branch to be included in the tree. Branches with support values below this value are removed from the tree and children are reconnected to the parent node.
root: CladeThe root Clade of the tree.
The root is the root Clade of the tree. The root Clade is the starting point of the tree and contains the children nodes.
annotations: Option<Vec<Annotation>>The annotations associated with the tree.
The annotations are the taxonomic annotations associated with nodes in the tree. The annotations are stored as a vector of Annotation objects.
kmers_map: Option<KmersMap>Implementations§
source§impl Tree
impl Tree
sourcepub fn new(id: Uuid, name: String, min_branch_support: f64, root: Clade) -> Tree
pub fn new(id: Uuid, name: String, min_branch_support: f64, root: Clade) -> Tree
Create a new Tree object.
The function creates a new Tree object with an id, name, and root Clade. The id is a unique identifier for the tree. The name is a human-readable name for the tree. The root is the root Clade of the tree.
pub fn get_in_memory_size(&self) -> Option<String>
pub fn update_in_memory_size(&mut self)
sourcepub fn pretty_print(&self)
pub fn pretty_print(&self)
Pretty print the tree.
The function prints the tree in a human-readable format. The function prints the root node and recursively prints each child node.
pub fn from_yaml_file(file_path: &Path) -> Result<Tree, MappedErrors>
sourcepub fn init_from_file(
tree_path: &Path,
min_branch_support: f64,
) -> Result<Tree, MappedErrors>
pub fn init_from_file( tree_path: &Path, min_branch_support: f64, ) -> Result<Tree, MappedErrors>
Create a new Tree from a .newick file.
The phylotre::tree::Tree is parsed from the file and converted to a Tree object with a root Clade.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Tree
impl<'de> Deserialize<'de> for Tree
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more