NAME
Bio::Taxonomy::Tree - An Organism Level Implementation of TreeI interface.
SYNOPSIS
# NB: This module is deprecated. Use Bio::Taxon in combination with# Bio::Tree::Tree instead# like from a TreeIOmy $treeio = Bio::TreeIO->new(-format => 'newick', -file => 'treefile.dnd');my $tree = $treeio->next_tree;my @nodes = $tree->get_nodes;my $root = $tree->get_root_node;my @leaves = $tree->get_leaves;
DESCRIPTION
This object holds handles to Taxonomic Nodes which make up a tree.
EXAMPLES
use Bio::Species;use Bio::Taxonomy::Tree;my $human=Bio::Species->new();my $chimp=Bio::Species->new();my $bonobo=Bio::Species->new();$human->classification(qw( sapiens Homo HominidaeCatarrhini Primates EutheriaMammalia Euteleostomi VertebrataCraniata ChordataMetazoa Eukaryota ));$chimp->classification(qw( troglodytes Pan HominidaeCatarrhini Primates EutheriaMammalia Euteleostomi VertebrataCraniata ChordataMetazoa Eukaryota ));$bonobo->classification(qw( paniscus Pan HominidaeCatarrhini Primates EutheriaMammalia Euteleostomi VertebrataCraniata ChordataMetazoa Eukaryota ));# ranks passed to $taxonomy match ranks of speciesmy @ranks = ('superkingdom','kingdom','phylum','subphylum','no rank 1','no rank 2','class','no rank 3','order','suborder','family','genus','species');my $taxonomy=Bio::Taxonomy->new(-ranks => \@ranks,-method => 'trust',-order => -1);my $tree1=Bio::Taxonomy::Tree->new();my $tree2=Bio::Taxonomy::Tree->new();$tree1->make_species_branch($human,$taxonomy);$tree2->make_species_branch($chimp,$taxonomy);my ($homo_sapiens)=$tree1->get_leaves;$tree1->splice($tree2);$tree1->add_species($bonobo,$taxonomy);my @taxa;foreach my $leaf ($tree1->get_leaves) {push @taxa,$leaf->taxon;}print join(", ",@taxa)."\n";@taxa=();$tree1->remove_branch($homo_sapiens);foreach my $leaf ($tree1->get_leaves) {push @taxa,$leaf->taxon;}print join(", ",@taxa)."\n";
FEEDBACK
See AUTHOR
AUTHOR - Dan Kortschak
Email [email protected]
CONTRIBUTORS
Mainly Jason Stajich
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : my $obj = Bio::Taxonomy::Tree->new();Function: Builds a new Bio::Taxonomy::Tree objectReturns : Bio::Taxonomy::TreeArgs :
get_nodes
Title : get_nodesUsage : my @nodes = $tree->get_nodes()Function: Return list of Bio::Taxonomy::Taxon objectsReturns : array of Bio::Taxonomy::Taxon 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::Taxonomy::Taxon objectArgs : none
set_root_node
Title : set_root_nodeUsage : $tree->set_root_node($node)Function: Set the Root Node for the TreeReturns : Bio::Taxonomy::TaxonArgs : Bio::Taxonomy::Taxon
get_leaves
Title : get_leavesUsage : my @nodes = $tree->get_leaves()Function: Return list of Bio::Taxonomy::Taxon objectsReturns : array of Bio::Taxonomy::Taxon objectsArgs :
make_species_branch
Title : make_species_branchUsage : @nodes = $tree->make_species_branch($species,$taxonomy)Function: Return list of Bio::Taxonomy::Taxon objects based on a Bio::Species objectReturns : array of Bio::Taxonomy::Taxon objectsArgs : Bio::Species and Bio::Taxonomy objects
make_branch
Title : make_branchUsage : $tree->make_branch($node)Function: Make a linear Bio::Taxonomy::Tree object from a leafish nodeReturns :Args : Bio::Taxonomy::Taxon object
splice
Title : spliceUsage : @nodes = $tree->splice($tree)Function: Return a of Bio::Taxonomy::Tree object that is a fusion of twoReturns : array of Bio::Taxonomy::Taxon added to treeArgs : Bio::Taxonomy::Tree object
add_species
Title : add_speciesUsage : @nodes = $tree->add_species($species,$taxonomy)Function: Return a of Bio::Taxonomy::Tree object with a new species addedReturns : array of Bio::Taxonomy::Taxon added to treeArgs : Bio::Species object
add_branch
Title : add_branchUsage : $tree->add_branch($node,boolean)Function: Return a of Bio::Taxonomy::Tree object with a new branch addedReturns : array of Bio::Taxonomy::Taxon objects of the resulting treeArgs : Bio::Taxonomy::Taxon objectboolean flag to force overwrite of descendent(see Bio::Node->add_Descendent)
remove_branch
Title : remove_branchUsage : $tree->remove_branch($node)Function: remove a branch up to the next multifurcationReturns :Args : Bio::Taxonomy::Taxon object