
Bio::Phylo::Adaptor::Bioperl::Node - Adaptor class for bioperl compatibility

use Bio::Phylo::Forest::Node;
use Bio::Phylo::Adaptor;
my $node = Bio::Phylo::Forest::Node->new;
$Bio::Phylo::COMPAT = 'Bioperl';
my $bpnode = Bio::Phylo::Adaptor->new($node);
print "compatible!" if $bpnode->isa('Bio::Tree::NodeI');

This class wraps Bio::Phylo::Forest::Node objects to give them an interface compatible with bioperl.

Adds a descendent to a node.
Title : add_Descendent Usage : $node->add_Descendant($node); Function: Adds a descendent to a node Returns : number of current descendents for this node Args : Bio::Node::NodeI
All the descendents for this Node.
Title : each_Descendent
Usage : my @nodes = $node->each_Descendent;
Function: all the descendents for this Node (but not their descendents
i.e. not a recursive fetchall)
Returns : Array of Bio::Tree::NodeI objects
Args : none
Recursively fetch all the nodes and their descendents.
Title : get_all_Descendents($sortby)
Usage : my @nodes = $node->get_all_Descendents;
Function: Recursively fetch all the nodes and their descendents
*NOTE* This is different from each_Descendent
Returns : Array or Bio::Tree::NodeI objects
Args : $sortby [optional] "height", "creation" or coderef to be used
to sort the order of children nodes.
Alias to get_all_Descendents for backward compatibility.
Get Leaf status.
Title : is_Leaf Usage : if( $node->is_Leaf ) Function: Get Leaf status Returns : boolean Args : none
Counts the number of descendents a node has.
Title : descendent_count
Usage : my $count = $node->descendent_count;
Function: Counts the number of descendents a node has
(and all of their subnodes)
Returns : integer
Args : none
For debugging, provide a node as a string.
Title : to_string Usage : my $str = $node->to_string() Function: For debugging, provide a node as a string Returns : string Args : none
Returns the height of the tree starting at this.
Title : height
Usage : my $len = $node->height
Function: Returns the height of the tree starting at this
node. Height is the maximum branchlength.
Returns : The longest length (weighting branches with branch_length) to a leaf
Args : none
Get/Set the branch length.
Title : branch_length Usage : $obj->branch_length() Function: Get/Set the branch length Returns : value of branch_length Args : newvalue (optional)
The human readable identifier for the node.
Title : id Usage : $obj->id($newval) Function: The human readable identifier for the node Returns : value of human readable id Args : newvalue (optional)
Returns the internal unique id for this Node.
Title : internal_id Usage : my $internalid = $node->internal_id Function: Returns the internal unique id for this Node Returns : unique id Args : none
Get/Set the description string.
Title : description Usage : $obj->description($newval) Function: Get/Set the description string Returns : value of description Args : newvalue (optional)
Get/Set the bootstrap value.
Title : bootstrap Usage : $obj->bootstrap($newval) Function: Get/Set the bootstrap value Returns : value of bootstrap Args : newvalue (optional)
Get/Set the ancestor node pointer for a Node.
Title : ancestor Usage : my $node = $node->ancestor; Function: Get/Set the ancestor node pointer for a Node Returns : Null if this is top level node Args : none
Invalidate our cached value of the node height in the tree.
Title : invalidate_height Usage : private helper method Function: Invalidate our cached value of the node height in the tree Returns : nothing Args : none
Adds a tag value to a node.
Title : add_tag_value
Usage : $node->add_tag_value($tag,$value)
Function: Adds a tag value to a node
Returns : number of values stored for this tag
Args : $tag - tag name
$value - value to store for the tag
Remove the tag and all values for this tag.
Title : remove_tag Usage : $node->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
Removes all tags.
Title : remove_all_tags Usage : $node->remove_all_tags() Function: Removes all tags Returns : None Args : None
Gets all the tag names for this Node.
Title : get_all_tags Usage : my @tags = $node->get_all_tags() Function: Gets all the tag names for this Node Returns : Array of tagnames Args : None
Gets the values for given tag.
Title : get_tag_values Usage : my @values = $node->get_tag_value($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
Boolean test if tag exists in the Node.
Title : has_tag Usage : $node->has_tag($tag) Function: Boolean test if tag exists in the Node Returns : Boolean Args : $tag - tagname

The base class for the adaptor architecture, instantiates the appropriate wrapper depending on $Bio::Phylo::COMPAT
Bio::Phylo::Adaptor::Bioperl::Node is an adaptor that makes Bio::Phylo nodes compatible with the Bio::Tree::NodeI interface.
Also see the manual: Bio::Phylo::Manual.

$Id: Node.pm 4265 2007-07-20 14:14:44Z rvosa $