NAME

Bio::Phylo::Forest::DrawNode - Tree node with extra methods for tree drawing

SYNOPSIS

# see Bio::Phylo::Forest::Node

DESCRIPTION

This module defines a node object and its methods. The node is fairly syntactically rich in terms of navigation, and additional getters are provided to further ease navigation from node to node. Typical first daughter -> next sister traversal and recursion is possible, but there are also shrinkwrapped methods that return for example all terminal descendants of the focal node, or all internals, etc.

Node objects are inserted into tree objects, although technically the tree object is only a container holding all the nodes together. Unless there are orphans all nodes can be reached without recourse to the tree object.

In addition, this subclass of the default node object Bio::Phylo::Forest::Node has getters and setters for drawing trees and nodes, e.g. X/Y coordinates, font and text attributes, etc.

METHODS

MUTATORS

set_collapsed()
Type    : Mutator
Title   : set_collapsed
Usage   : $node->set_collapsed(1);
Function: Sets whether the node's descendants are shown as collapsed into a triangle
Returns : $self
Args    : true or false value
set_collapsed_clade_width()

Sets collapsed clade width.

Type    : Mutator
Title   : set_collapsed_clade_width
Usage   : $tree->set_collapsed_clade_width(6);
Function: sets the width of collapsed clade triangles relative to uncollapsed tips
Returns :
Args    : Positive number
set_x()
Type    : Mutator
Title   : set_x
Usage   : $node->set_x($x);
Function: Sets x
Returns : $self
Args    : x
set_y()
Type    : Mutator
Title   : set_y
Usage   : $node->set_y($y);
Function: Sets y
Returns : $self
Args    : y
set_radius()
Type    : Mutator
Title   : set_radius
Usage   : $node->set_radius($radius);
Function: Sets radius
Returns : $self
Args    : radius
set_tip_radius()
Type    : Mutator
Title   : set_tip_node_radius
Usage   : $tree->set_tip_radius($node_radius);
Function: Sets tip radius
Returns : $self
Args    : tip radius
set_node_colour()
Type    : Mutator
Title   : set_node_colour
Usage   : $node->set_node_colour($node_colour);
Function: Sets node_colour
Returns : $self
Args    : node_colour
set_node_outline_colour()
Type    : Mutator
Title   : set_node_outline_colour
Usage   : $node->set_node_outline_colour($node_outline_colour);
Function: Sets node outline colour
Returns : $self
Args    : node_colour
set_node_shape()
Type    : Mutator
Title   : set_node_shape
Usage   : $node->set_node_shape($node_shape);
Function: Sets node_shape
Returns : $self
Args    : node_shape
set_node_image()
Type    : Mutator
Title   : set_node_image
Usage   : $node->set_node_image($node_image);
Function: Sets node_image
Returns : $self
Args    : node_image
set_branch_color()
Type    : Mutator
Title   : set_branch_color
Usage   : $node->set_branch_color($branch_color);
Function: Sets branch_color
Returns : $self
Args    : branch_color
set_branch_shape()
Type    : Mutator
Title   : set_branch_shape
Usage   : $node->set_branch_shape($branch_shape);
Function: Sets branch_shape
Returns : $self
Args    : branch_shape
set_branch_width()
Type    : Mutator
Title   : set_branch_width
Usage   : $node->set_branch_width($branch_width);
Function: Sets branch width
Returns : $self
Args    : branch_width
set_branch_style()
Type    : Mutator
Title   : set_branch_style
Usage   : $node->set_branch_style($branch_style);
Function: Sets branch style
Returns : $self
Args    : branch_style
set_font_face()
Type    : Mutator
Title   : set_font_face
Usage   : $node->set_font_face($font_face);
Function: Sets font_face
Returns : $self
Args    : font_face
set_font_size()
Type    : Mutator
Title   : set_font_size
Usage   : $node->set_font_size($font_size);
Function: Sets font_size
Returns : $self
Args    : font_size
set_font_style()
Type    : Mutator
Title   : set_font_style
Usage   : $node->set_font_style($font_style);
Function: Sets font_style
Returns : $self
Args    : font_style
set_url()
Type    : Mutator
Title   : set_url
Usage   : $node->set_url($url);
Function: Sets url
Returns : $self
Args    : url
set_text_horiz_offset()
Type    : Mutator
Title   : set_text_horiz_offset
Usage   : $node->set_text_horiz_offset($text_horiz_offset);
Function: Sets text_horiz_offset
Returns : $self
Args    : text_horiz_offset
set_text_vert_offset()
Type    : Mutator
Title   : set_text_vert_offset
Usage   : $node->set_text_vert_offset($text_vert_offset);
Function: Sets text_vert_offset
Returns : $self
Args    : text_vert_offset

ACCESSORS

get_collapsed()
Type    : Mutator
Title   : get_collapsed
Usage   : something() if $node->get_collapsed();
Function: Gets whether the node's descendants are shown as collapsed into a triangle
Returns : true or false value
Args    : NONE
get_first_daughter()

Gets invocant's first daughter.

Type    : Accessor
Title   : get_first_daughter
Usage   : my $f_daughter = $node->get_first_daughter;
Function: Retrieves a node's leftmost daughter.
Returns : Bio::Phylo::Forest::Node
Args    : NONE
get_last_daughter()

Gets invocant's last daughter.

Type    : Accessor
Title   : get_last_daughter
Usage   : my $l_daughter = $node->get_last_daughter;
Function: Retrieves a node's rightmost daughter.
Returns : Bio::Phylo::Forest::Node
Args    : NONE
get_children()

Gets invocant's immediate children.

Type    : Query
Title   : get_children
Usage   : my @children = @{ $node->get_children };
Function: Returns an array reference of immediate
          descendants, ordered from left to right.
Returns : Array reference of
          Bio::Phylo::Forest::Node objects.
Args    : NONE
get_x()
Type    : Accessor
Title   : get_x
Usage   : my $x = $node->get_x();
Function: Gets x
Returns : x
Args    : NONE
get_y()
Type    : Accessor
Title   : get_y
Usage   : my $y = $node->get_y();
Function: Gets y
Returns : y
Args    : NONE
get_radius()
Type    : Accessor
Title   : get_radius
Usage   : my $radius = $node->get_radius();
Function: Gets radius
Returns : radius
Args    : NONE
get_node_colour()
Type    : Accessor
Title   : get_node_colour
Usage   : my $node_colour = $node->get_node_colour();
Function: Gets node_colour
Returns : node_colour
Args    : NONE
get_node_outline_colour()
Type    : Accessor
Title   : get_node_outline_colour
Usage   : my $node_outline_colour = $node->get_node_outline_colour();
Function: Gets node outline colour
Returns : node_colour
Args    : NONE
get_node_shape()
Type    : Accessor
Title   : get_node_shape
Usage   : my $node_shape = $node->get_node_shape();
Function: Gets node_shape
Returns : node_shape
Args    : NONE
get_node_image()
Type    : Accessor
Title   : get_node_image
Usage   : my $node_image = $node->get_node_image();
Function: Gets node_image
Returns : node_image
Args    : NONE
get_collapsed_clade_width()

Gets collapsed clade width.

Type    : Mutator
Title   : get_collapsed_clade_width
Usage   : $w = $tree->get_collapsed_clade_width();
Function: gets the width of collapsed clade triangles relative to uncollapsed tips
Returns : Positive number
Args    : None
get_branch_color()
Type    : Accessor
Title   : get_branch_color
Usage   : my $branch_color = $node->get_branch_color();
Function: Gets branch_color
Returns : branch_color
Args    : NONE
get_branch_shape()
Type    : Accessor
Title   : get_branch_shape
Usage   : my $branch_shape = $node->get_branch_shape();
Function: Gets branch_shape
Returns : branch_shape
Args    : NONE
get_branch_width()
Type    : Accessor
Title   : get_branch_width
Usage   : my $branch_width = $node->get_branch_width();
Function: Gets branch_width
Returns : branch_width
Args    : NONE
get_branch_style()
Type    : Accessor
Title   : get_branch_style
Usage   : my $branch_style = $node->get_branch_style();
Function: Gets branch_style
Returns : branch_style
Args    : NONE
get_font_face()
Type    : Accessor
Title   : get_font_face
Usage   : my $font_face = $node->get_font_face();
Function: Gets font_face
Returns : font_face
Args    : NONE
get_font_size()
Type    : Accessor
Title   : get_font_size
Usage   : my $font_size = $node->get_font_size();
Function: Gets font_size
Returns : font_size
Args    : NONE
get_font_style()
Type    : Accessor
Title   : get_font_style
Usage   : my $font_style = $node->get_font_style();
Function: Gets font_style
Returns : font_style
Args    : NONE
get_url()
Type    : Accessor
Title   : get_url
Usage   : my $url = $node->get_url();
Function: Gets url
Returns : url
Args    : NONE
get_text_horiz_offset()
Type    : Accessor
Title   : get_text_horiz_offset
Usage   : my $text_horiz_offset = $node->get_text_horiz_offset();
Function: Gets text_horiz_offset
Returns : text_horiz_offset
Args    : NONE
get_text_vert_offset()
Type    : Accessor
Title   : get_text_vert_offset
Usage   : my $text_vert_offset = $node->get_text_vert_offset();
Function: Gets text_vert_offset
Returns : text_vert_offset
Args    : NONE

SERIALIZERS

to_json()

Serializes object to JSON string

Type    : Serializer
Title   : to_json()
Usage   : print $obj->to_json();
Function: Serializes object to JSON string
Returns : String 
Args    : None
Comments:

SEE ALSO

Bio::Phylo::Forest::Node

This object inherits from Bio::Phylo::Forest::Node, so methods defined there are also applicable here.

Bio::Phylo::Manual

Also see the manual: Bio::Phylo::Manual and http://rutgervos.blogspot.com.

CITATION

If you use Bio::Phylo in published research, please cite it:

Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63. http://dx.doi.org/10.1186/1471-2105-12-63

REVISION

$Id: DrawNode.pm 1593 2011-02-27 15:26:04Z rvos $