NAME
Bio::Taxonomy::Taxon - Generic Taxonomic Entity object
SYNOPSIS
# NB: This module is deprecated. Use Bio::Taxon instead.use Bio::Taxonomy::Taxon;my $taxonA = Bio::Taxonomy::Taxon->new();my $taxonL = Bio::Taxonomy::Taxon->new();my $taxonR = Bio::Taxonomy::Taxon->new();my $taxon = Bio::Taxonomy::Taxon->new();$taxon->add_Descendents($taxonL);$taxon->add_Descendents($taxonR);my $species = $taxon->species;
DESCRIPTION
Makes a taxonomic unit suitable for use in a taxonomic tree
AUTHOR
Dan Kortschak email [email protected]
CONTRIBUTORS
Sendu Bala: [email protected]
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::Taxon->new();Function: Builds a new Bio::Taxonomy::Taxon objectReturns : Bio::Taxonomy::TaxonArgs : -descendents => array pointer to descendents (optional)-branch_length => branch length [integer] (optional)-taxon => taxon-id => unique taxon id for node (from NCBI's list preferably)-rank => the taxonomic level of the node (also from NCBI)
add_Descendent
Title : add_DescendentUsage : $taxon->add_Descendent($taxon);Function: Adds a descendent to a taxonReturns : number of current descendents for this taxonArgs : Bio::Taxonomy::Taxonboolean flag, true if you want to ignore the fact that you areadding a second node with the same unique id (typically memorylocation reference in this implementation). default is false andwill throw an error if you try and overwrite an existing node.
each_Descendent
Title : each_Descendent($sortby)Usage : my @taxa = $taxon->each_Descendent;Function: all the descendents for this taxon (but not their descendentsi.e. not a recursive fetchall)Returns : Array of Bio::Taxonomy::Taxon objectsArgs : $sortby [optional] "height", "creation" or coderef to be usedto sort the order of children taxa.
remove_Descendent
Title : remove_DescendentUsage : $taxon->remove_Descedent($taxon_foo);Function: Removes a specific taxon from being a Descendent of this taxonReturns : nothingArgs : An array of Bio::taxonomy::Taxon objects which have be previouslypassed to the add_Descendent call of this object.
remove_all_Descendents
Title : remove_all_DescendentsUsage : $taxon->remove_All_Descendents()Function: Cleanup the taxon's reference to descendents and resettheir ancestor pointers to undef, if you don't have a referenceto these objects after this call they will be cleanedup - soa get_nodes from the Tree object would be a safe thing to do firstReturns : nothingArgs : none
get_Descendents
Title : get_DescendentsUsage : my @taxa = $taxon->get_Descendents;Function: Recursively fetch all the taxa and their descendents*NOTE* This is different from each_DescendentReturns : Array or Bio::Taxonomy::Taxon objectsArgs : none
ancestor
Title : ancestorUsage : $taxon->ancestor($newval)Function: Set the AncestorReturns : value of ancestorArgs : newvalue (optional)
branch_length
Title : branch_lengthUsage : $obj->branch_length($newval)Function:Example :Returns : value of branch_lengthArgs : newvalue (optional)
description
Title : descriptionUsage : $obj->description($newval)Function:Returns : value of descriptionArgs : newvalue (optional)
rank
Title : rankUsage : $obj->rank($newval)Function: Set the taxonomic rankReturns : taxonomic rank of taxonArgs : newvalue (optional)
taxon
Title : taxonUsage : $obj->taxon($newtaxon)Function: Set the name of the taxonExample :Returns : name of taxonArgs : newtaxon (optional)
id
Title : idUsage : $obj->id($newval)Function:Example :Returns : value of idArgs : newvalue (optional)
internal_id
Title : internal_idUsage : my $internalid = $taxon->internal_idFunction: Returns the internal unique id for this taxon(a monotonically increasing number for this in-memory implementationbut could be a database determined unique id in otherimplementations)Returns : unique idArgs : none
_creation_id
Title : _creation_idUsage : $obj->_creation_id($newval)Function: a private method signifying the internal creation orderReturns : value of _creation_idArgs : newvalue (optional)
is_Leaf
Title : is_LeafUsage : if( $node->is_Leaf )Function: Get Leaf statusReturns : booleanArgs : none
to_string
Title : to_stringUsage : my $str = $taxon->to_string()Function: For debugging, provide a taxon as a stringReturns : stringArgs : none
height
Title : heightUsage : my $len = $taxon->heightFunction: Returns the height of the tree starting at thistaxon. Height is the maximum branchlength.Returns : The longest length (weighting branches with branch_length) to a leafArgs : none
invalidate_height
Title : invalidate_heightUsage : private helper methodFunction: Invalidate our cached value of the taxon's height in the treeReturns : nothingArgs : none
classify
Title : classifyUsage : @obj->classify()Function: a method to return the classification of a speciesReturns : name of taxon and ancestor's taxon recursivelyArgs : boolean to specify whether we want all taxa not just rankedlevels
has_rank
Title : has_rankUsage : $obj->has_rank($rank)Function: a method to query ancestors' rankReturns : booleanArgs : $rank
has_taxon
Title : has_taxonUsage : $obj->has_taxon($taxon)Function: a method to query ancestors' taxaReturns : booleanArgs : Bio::Taxonomy::Taxon object
distance_to_root
Title : distance_to_rootUsage : $obj->distance_to_rootFunction: a method to query ancestors' taxaReturns : number of links to rootArgs :
recent_common_ancestor
Title : recent_common_ancestorUsage : $obj->recent_common_ancestor($taxon)Function: a method to query find common ancestorsReturns : Bio::Taxonomy::Taxon of query or undef if no ancestor of rankArgs : Bio::Taxonomy::Taxon
species
Title : speciesUsage : $obj=$taxon->species;Function: Returns a Bio::Species object reflecting the taxon's tree positionReturns : a Bio::Species objectArgs : none