Bio::Tree::TreeI(3pm)
π Bio::Tree::TreeI π
okay bestie, so this is Bio::Tree::TreeI, straight out of the User Contributed Perl Documentation section of the perl manpages. It's a Tree object that's good for, like, lots of stuff β but it was originally designed for Phylogenetic Trees. π³β¨
πΈ NAME πΈ
Bio::Tree::TreeI β a Tree object suitable for lots of things, designed originally for Phylogenetic Trees. π
β¨ SYNOPSIS β¨
# get a Bio::Tree::TreeI somehow
# like from a TreeIO
my $treeio = Bio::TreeIO->new(-format => 'newick', -file => 'treefile.dnd');
my $tree = $treeio->next_tree;
my @nodes = $tree->get_nodes;
my @leaves = $tree->get_leaf_nodes;
my $root = $tree->get_root_node;
π¦ DESCRIPTION π¦
So basically this object just holds a pointer to the Root of a Tree, and that Root is a Bio::Tree::NodeI. That's it, that's the whole vibe. π«Ά
π FEEDBACK π
π Mailing Lists π
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. π₯Ή
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π©· Support π©·
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. π
π Reporting Bugs π
Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
π AUTHOR - Jason Stajich π
Email jason@bioperl.org
π CONTRIBUTORS π
Aaron Mackey, amackey@virginia.edu Elia Stupka, elia@fugu-sg.org Sendu Bala, bix@sendu.me.uk
β APPENDIX β
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ (iykyk π).
π get_nodes
- Title β get_nodes
- Usage β
my @nodes = $tree->get_nodes() - Function β Return list of Tree::NodeI objects
- Returns β array of Tree::NodeI objects
- Args β (named values) hash with one value
order => 'b|breadth' first order or 'd|depth' first order
π§ get_root_node
- Title β get_root_node
- Usage β
my $node = $tree->get_root_node(); - Function β Get the Top Node in the tree, in this implementation Trees only have one top node.
- Returns β Bio::Tree::NodeI object
- Args β none
π number_nodes
- Title β number_nodes
- Usage β
my $size = $tree->number_nodes - Function β Find the number of nodes in the tree.
- Returns β int
- Args β none
πΈ total_branch_length
- Title β total_branch_length
- Usage β
my $size = $tree->total_branch_length - Function β Returns the sum of the length of all branches
- Returns β integer
- Args β none
π₯ height
- Title β height
- Usage β
my $height = $tree->height - Function β Gets the height of tree - this LOG_2($number_nodes)
WARNING: this is only true for strict binary trees. The TreeIO system is capable of building non-binary trees, for which this method will currently return an incorrect value!! π
- Returns β integer
- Args β none
π id
- Title β id
- Usage β
my $id = $tree->id(); - Function β An id value for the tree
- Returns β scalar
- Args β
β score
- Title β score
- Usage β
$obj->score($newval) - Function β Sets the associated score with this tree. This is a generic slot which is probably best used for log likelihood or other overall tree score
- Returns β value of score
- Args β newvalue (optional)
π¦ get_leaf_nodes
- Title β get_leaf_nodes
- Usage β
my @leaves = $tree->get_leaf_nodes() - Function β Returns the leaves (tips) of the tree
- Returns β Array of Bio::Tree::NodeI objects
- Args β none
π Methods for associating Tag/Values with a Tree π
These methods associate tag/value pairs with a Tree. periodt. β¨
π©· set_tag_value
- Title β set_tag_value
- Usage β
$tree->set_tag_value($tag,$value)/$tree->set_tag_value($tag,@values) - Function β Sets a tag value(s) to a tree. Replaces old values.
- Returns β number of values stored for this tag
- Args β
$tag- tag name;$value- value to store for the tag
π add_tag_value
- Title β add_tag_value
- Usage β
$tree->add_tag_value($tag,$value) - Function β Adds a tag value to a tree
- Returns β number of values stored for this tag
- Args β
$tag- tag name;$value- value to store for the tag
π remove_tag
- Title β remove_tag
- Usage β
$tree->remove_tag($tag) - Function β Remove the tag and all values for this tag
- Returns β boolean representing success (0 if tag does not exist)
- Args β
$tag- tagname to remove
π§ remove_all_tags
- Title β remove_all_tags
- Usage β
$tree->remove_all_tags() - Function β Removes all tags
- Returns β None
- Args β None
π get_all_tags
- Title β get_all_tags
- Usage β
my @tags = $tree->get_all_tags() - Function β Gets all the tag names for this Tree
- Returns β Array of tagnames
- Args β None
π get_tag_values
- Title β get_tag_values
- Usage β
my @values = $tree->get_tag_values($tag) - Function β Gets the values for given tag (
$tag) - Returns β Array of values or empty list if tag does not exist
- Args β
$tag- tag name
π has_tag
- Title β has_tag
- Usage β
$tree->has_tag($tag) - Function β Boolean test if tag exists in the Tree
- Returns β Boolean
- Args β
$tag- tagname
and that's the whole page bestie!! this one came from perl v5.32.1, dated 2021-08-15, filed under Bio::Tree::TreeI(3pm). no cap, go build some trees π³πβ¨
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms