NAME
Bio::Phylo::Forest - The forest object, a set of phylogenetic trees.
SYNOPSIS
use Bio::Phylo::Forest;
use Bio::Phylo::Forest::Tree;
my $forest = Bio::Phylo::Forest->new;
my $tree = Bio::Phylo::Forest::Tree->new;
$forest->insert($tree);
print $forest->to_nexus;
DESCRIPTION
The Bio::Phylo::Forest object models a set of trees. The object subclasses the Bio::Phylo::Listable object, so look there for more methods available to forest objects.
METHODS
CONSTRUCTOR
- new()
-
Forest constructor.
Type : Constructor Title : new Usage : my $trees = Bio::Phylo::Forest->new; Function: Instantiates a Bio::Phylo::Forest object. Returns : A Bio::Phylo::Forest object. Args : None required, though see the superclass Bio::Phylo::Listable from which this object inherits.
METHODS
- insert()
-
Inserts trees in forest.
Type : Method Title : insert Usage : $trees->insert( $tree1, $tree2, ... ); Function: Inserts trees in forest. Returns : A Bio::Phylo::Forest object. Args : Trees Comment : The last seen tree that is set as default becomes the default for the entire forest
- get_default_tree()
-
Gets the default tree in the forest.
Type : Method Title : get_default_tree Usage : my $tree = $trees->get_default_tree; Function: Gets the default tree in the forest. Returns : A Bio::Phylo::Forest::Tree object. Args : None Comment : If no default tree has been set, returns first tree.
- check_taxa()
-
Validates taxon links of nodes in invocant's trees.
Type : Method Title : check_taxa Usage : $trees->check_taxa; Function: Validates the taxon links of the nodes of the trees in $trees Returns : A validated Bio::Phylo::Forest object. Args : None
- make_matrix()
-
Creates an MRP matrix object.
Type : Method Title : make_matrix Usage : my $matrix = $obj->make_matrix Function: Creates an MRP matrix object Returns : $matrix Args : NONE
- make_taxa()
-
Creates a taxa block from the objects contents if none exists yet.
Type : Method Title : make_taxa Usage : my $taxa = $obj->make_taxa Function: Creates a taxa block from the objects contents if none exists yet. Returns : $taxa Args : NONE
- to_newick()
-
Serializes invocant to newick string.
Type : Stringifier Title : to_newick Usage : my $string = $forest->to_newick; Function: Turns the invocant forest object into a newick string, one line per tree Returns : SCALAR Args : The same arguments as Bio::Phylo::Forest::Tree::to_newick
- to_nexus()
-
Serializer to nexus format.
Type : Format convertor Title : to_nexus Usage : my $data_block = $matrix->to_nexus; Function: Converts matrix object into a nexus data block. Returns : Nexus data block (SCALAR). Args : Trees can be formatted using the same arguments as those passed to Bio::Phylo::Unparsers::Newick. In addition, you can provide: # as per mesquite's inter-block linking system (default is false): -links => 1 (to create a TITLE token, and a LINK token, if applicable) # rooting is determined based on basal trichotomy. "token" means 'TREE' or 'UTREE' # is used, "comment" means [&R] or [&U] is used, "nhx" means [%unrooted=on] or # [%unrooted=off] if used, default is "comment" -rooting => one of (token|comment|nhx) # to map taxon names to indices (default is false) -make_translate => 1 (autogenerate translation table, overrides -translate => {}) Comments:
SEE ALSO
- Bio::Phylo::Listable
-
The forest object inherits from the Bio::Phylo::Listable object. The methods defined therein are applicable to forest objects.
- Bio::Phylo::Taxa::TaxaLinker
-
The forest object inherits from the Bio::Phylo::Taxa::TaxaLinker object. The methods defined therein are applicable to forest objects.
- Bio::Phylo::Manual
-
Also see the manual: Bio::Phylo::Manual and http://rutgervos.blogspot.com.
REVISION
$Id: Forest.pm 810 2009-03-03 02:07:21Z rvos $