Bio::NEXUS::Tree - Provides functions for manipulating trees
new Bio::NEXUS::Tree;
Provides a few useful functions for trees.
All feedback (bugs, feature enhancements, etc.) are all greatly appreciated. There are no mailing lists at this time for the Bio::NEXUS::Tree module, so send all relevant contributions to Dr. Weigang Qiu (weigang@genectr.hunter.cuny.edu).
Eugene Melamud (melamud@carb.nist.gov) Thomas Hladish (tjhladish at yahoo) Weigang Qiu (weigang@genectr.hunter.cuny.edu) Chengzhi Liang (liangc@umbi.umd.edu) Peter Yang (pyang@rice.edu)
Title : new Usage : $tree = new Bio::NEXUS::Tree(); Function: Creates a new Bio::NEXUS::Tree object Returns : Bio::NEXUS::Tree object Args : none
Name : clone Usage : my $new_tree = $self->clone(); Function: clone a Bio::NEXUS::Tree (self) object. All the nodes are also cloned. Returns : new Bio::NEXUS::Tree object Args : none
Title : set_rootnode Usage : $tree->set_rootnode($newnode); Function: Sets the root node to a new node Returns : none Args : root node (Bio::NEXUS::Node object)
Title : get_rootnode Usage : $node = $tree->get_rootnode(); Function: Returns the tree root node Returns : root node (Bio::NEXUS::Node object) Args : none
Title : set_name Usage : $tree->set_name($name); Function: Sets the tree name Returns : none Args : name (string)
Title : get_name Usage : $name = $tree->get_name(); Function: Returns the tree's name Returns : name (string) or undef if name doesn't exist Args : none
Title : set_as_default Usage : $tree->set_as_default(); Function: assigns is_default variable for this object to 1. (default : 0) Returns : none Args : none
Title : is_default Usage : $is_default_tree = $tree->is_default(); Function: check whether the tree is assigned as the default. Returns : 0 (false) or 1 (true) Args : none
Title : set_as_unrooted Usage : $tree->set_as_unrooted(); Function: assigns is_unrooted variable for this object to 1. (default : 0) Returns : none Args : none
Title : is_rooted Usage : $is_rooted_tree = $tree->is_rooted(); Function: Check whether the tree is rooted. Returns : 0 (false) or 1 (true) Args : none
Title : determine_cladogram Usage : $tree->determine_cladogram(); Function: Determine if a tree is a cladogram or not (that is, whether branch lengths are present) Returns : none Args : none
Title : set_output_format Usage : $tree->set_output_format('STD'); Function: Sets the output format for the Tree, (options : STD or NHX) Returns : none Args : string: 'STD' or 'NHX'
Title : get_output_format Usage : $output_format = $tree->get_output_format(); Function: Returns the output format for the Tree, (options : STD or NHX) Returns : string: 'STD' or 'NHX' Args : none
Title : is_cladogram Usage : &dothis() if $tree->is_cladogram(); Function: Returns whether tree is a cladogram or not Returns : 0 (no) or 1 (yes) Args : none
Title : as_string Usage : $treestring = $tree->as_string(); Function: Returns the tree as a string Returns : tree string (string) Args : none
Title : as_string_inodes_nameless Usage : $treestring = $tree->as_string_inodes_nameless(); Function: Returns the tree as a string without internal node names Returns : tree string (string) Args : none
Title : get_nodes Usage : @nodes = @{$tree->get_nodes()}; Function: Returns the list of ALL nodes in the tree Returns : reference to array of nodes (Bio::NEXUS::Node objects) Args : none
Title : get_node_names Usage : @otu_names = @{$tree->get_node_names()}; Function: Returns the list of names of otus (terminal nodes) Returns : array ref of node names Args : none
Title : get_distances Usage : %distances = %{$tree->get_distances()}; Function: Finds the distances from the root node for all OTUs Returns : reference to a hash of OTU names as keys and distances as values Args : none
Title : get_tree_length Usage : $tre_length = $self->get_tree_length; Function: Gets the total branch lengths in the tree. Returns : total branch length Args : none
Title : get_support_values Usage : %bootstraps = %{$tree->get_support_values()}; Function: Finds all branch support values for all OTUs Returns : reference to a hash where OTU names are keys and branch support values are values Args : none
Title : set_depth Usage : $tree->set_depth(); Function: Sets depth of root node Returns : none Args : none
Title : get_depth Usage : %depth=%{$tree->get_depth()}; Function: Get depth in tree of all OTUs and internal nodes Returns : reference to hash with keys = node names and values = depth Args : none
Title : max_depth Usage : $maxdepth=%{$tree->max_depth()}; Function: Get maximum depth of tree Returns : integer indicating maximum depth Args : none
Title : find Usage : $node = $tree->find($name); Function: Finds the first occurrence of a node called 'name' in the tree Returns : Bio::NEXUS::Node object Args : name (string)
Title : find_all Usage : @nodes = @{ $tree->find_all($name) }; Function: find all occurrences of nodes called 'name' in the tree Returns : Bio::NEXUS::Node objects Args : name (string)
Name : prune Usage : $tree->prune($OTUlist); Function: Removes everything from the tree except for OTUs specified in $OTUlist Returns : none Args : list of OTUs (string)
Name : equals Usage : $tree->equals($another_tree); Function: compare if two trees are equivalent in topology Returns : 1 if equal or 0 if not Args : another Bio::NEXUS::Tree object
Name : reroot Usage : $tree = $tree->reroot($outgroup_name); Function: re-root a tree with a node as outgroup Returns : Args : the node name to be used as new outgroup
Name : select_subtree Usage : $new_tree_obj = $self->select_subtree($node_name); Function: selects the subtree (the given node and all its children) from the tree object. Returns : new Bio::NEXUS::Tree object Args : Node name
Name : exclude_subtree Usage : $new_tree_obj = $self->exclude_subtree($node_name); Function: removes the given node and all its children from the tree object. Returns : new Bio::NEXUS::Tree object Args : Node name
Name : get_mrca_of_otus Usage : $node = $self->get_mrca_of_otus($otus); Function: gets the most recent common ancestor for the input $otus Returns : Bio::NEXUS::Node object Args : $otus : Array reference of the OTUs
To install Bio::NEXUS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::NEXUS
CPAN shell
perl -MCPAN -e shell install Bio::NEXUS
For more information on module installation, please visit the detailed CPAN module installation guide.