
Bio::Phylo::Generator - Generator of tree topologies

use Bio::Phylo::Factory;
my $fac = Bio::Phylo::Factory->new;
my $gen = $fac->create_generator;
my $trees = $gen->gen_rand_pure_birth(
'-tips' => 10,
'-model' => 'yule',
'-trees' => 10,
);
# prints 'Bio::Phylo::Forest'
print ref $trees;

The generator module is used to simulate trees under the Yule, Hey, or equiprobable model.

Generator constructor.
Type : Constructor Title : new Usage : my $gen = Bio::Phylo::Generator->new; Function: Initializes a Bio::Phylo::Generator object. Returns : A Bio::Phylo::Generator object. Args : NONE
This method generates a Bio::Phylo::Forest object populated with Yule/Hey trees.
Type : Generator
Title : gen_rand_pure_birth
Usage : my $trees = $gen->gen_rand_pure_birth(
'-tips' => 10,
'-model' => 'yule',
'-trees' => 10,
);
Function: Generates markov tree shapes,
with branch lengths sampled
from a user defined model of
clade growth, for a user defined
number of tips.
Returns : A Bio::Phylo::Forest object.
Args : -tips => number of terminal nodes,
-model => either 'yule' or 'hey',
-trees => number of trees to generate
This method generates a Bio::Phylo::Forest object populated with Yule/Hey trees whose branch lengths are proportional to the expected waiting times (i.e. not sampled from a distribution).
Type : Generator
Title : gen_exp_pure_birth
Usage : my $trees = $gen->gen_exp_pure_birth(
'-tips' => 10,
'-model' => 'yule',
'-trees' => 10,
);
Function: Generates markov tree shapes,
with branch lengths following
the expectation under a user
defined model of clade growth,
for a user defined number of tips.
Returns : A Bio::Phylo::Forest object.
Args : -tips => number of terminal nodes,
-model => either 'yule' or 'hey'
-trees => number of trees to generate
This method draws tree shapes at random, such that all shapes are equally probable.
Type : Generator
Title : gen_equiprobable
Usage : my $trees = $gen->gen_equiprobable(
'-tips' => 10,
'-trees' => 5,
);
Function: Generates an equiprobable tree
shape, with branch lengths = 1;
Returns : A Bio::Phylo::Forest object.
Args : -tips => number of terminal nodes,
-trees => number of trees to generate

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

$Id: Generator.pm 841 2009-03-04 23:07:30Z rvos $