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 TreeIOmy $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
This object holds a pointer to the Root of a Tree which is a Bio::Tree::NodeI.
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.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
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 [email protected]
CONTRIBUTORS
Aaron Mackey, [email protected] Elia Stupka, [email protected] Sendu Bala, [email protected]
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
get_nodes
Title : get_nodesUsage : my @nodes = $tree->get_nodes()Function: Return list of Tree::NodeI objectsReturns : array of Tree::NodeI objectsArgs : (named values) hash with one valueorder => 'b|breadth' first order or 'd|depth' first order
get_root_node
Title : get_root_nodeUsage : my $node = $tree->get_root_node();Function: Get the Top Node in the tree, in this implementationTrees only have one top node.Returns : Bio::Tree::NodeI objectArgs : none
number_nodes
Title : number_nodesUsage : my $size = $tree->number_nodesFunction: Find the number of nodes in the tree.Returns : intArgs : none
total_branch_length
Title : total_branch_lengthUsage : my $size = $tree->total_branch_lengthFunction: Returns the sum of the length of all branchesReturns : integerArgs : none
height
Title : heightUsage : my $height = $tree->heightFunction: Gets the height of tree - this LOG_2($number_nodes)WARNING: this is only true for strict binary trees. The TreeIOsystem is capable of building non-binary trees, for which thismethod will currently return an incorrect value!!Returns : integerArgs : none
id
Title : idUsage : my $id = $tree->id();Function: An id value for the treeReturns : scalarArgs :
score
Title : scoreUsage : $obj->score($newval)Function: Sets the associated score with this treeThis is a generic slot which is probably best usedfor log likelihood or other overall tree scoreReturns : value of scoreArgs : newvalue (optional)
get_leaf_nodes
Title : get_leaf_nodesUsage : my @leaves = $tree->get_leaf_nodes()Function: Returns the leaves (tips) of the treeReturns : Array of Bio::Tree::NodeI objectsArgs : none
Methods for associating Tag/Values with a Tree
These methods associate tag/value pairs with a Tree
set_tag_value
Title : set_tag_valueUsage : $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 tagArgs : $tag - tag name$value - value to store for the tag
add_tag_value
Title : add_tag_valueUsage : $tree->add_tag_value($tag,$value)Function: Adds a tag value to a treeReturns : number of values stored for this tagArgs : $tag - tag name$value - value to store for the tag
remove_tag
Title : remove_tagUsage : $tree->remove_tag($tag)Function: Remove the tag and all values for this tagReturns : boolean representing success (0 if tag does not exist)Args : $tag - tagname to remove
remove_all_tags
Title : remove_all_tagsUsage : $tree->remove_all_tags()Function: Removes all tagsReturns : NoneArgs : None
get_all_tags
Title : get_all_tagsUsage : my @tags = $tree->get_all_tags()Function: Gets all the tag names for this TreeReturns : Array of tagnamesArgs : None
get_tag_values
Title : get_tag_valuesUsage : 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 existArgs : $tag - tag name
has_tag
Title : has_tagUsage : $tree->has_tag($tag)Function: Boolean test if tag exists in the TreeReturns : BooleanArgs : $tag - tagname