- AUTHOR - Jason Stajich, Matthew Hahn
Bio::PopGen::Simulation::Coalescent - A Coalescent simulation factory
use Bio::PopGen::Simulation::Coalescent; my @taxonnames = qw(SpeciesA SpeciesB SpeciesC SpeciesD); my $sim1 = Bio::PopGen::Simulation::Coalescent->new(-samples => \@taxonnames); my $tree = $sim1->next_tree; # add 20 mutations randomly to the tree $sim1->add_Mutations($tree,20); # or for anonymous samples my $sim2 = Bio::PopGen::Simulation::Coalescent->new( -sample_size => 6, -maxcount => 50); my $tree2 = $sim2->next_tree; # add 20 mutations randomly to the tree $sim2->add_Mutations($tree2,20);
Builds a random tree every time next_tree is called or up to -maxcount times with branch lengths and provides the ability to randomly add mutations onto the tree with a probabilty proportional to the branch lengths.
This algorithm is based on the make_tree algorithm from Richard Hudson 1990.
Hudson, R. R. 1990. Gene genealogies and the coalescent process. Pp. 1-44 in D. Futuyma and J. Antonovics, eds. Oxford surveys in evolutionary biology. Vol. 7. Oxford University Press, New York.
This module was previously named Bio::Tree::RandomTree
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated.
email@example.com - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:
AUTHOR - Jason Stajich, Matthew Hahn
Email jason-at-bioperl-dot-org Email matthew-dot-hahn-at-duke-dot-edu
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
Title : new Usage : my $obj = Bio::PopGen::Simulation::Coalescent->new(); Function: Builds a new Bio::PopGen::Simulation::Coalescent object Returns : an instance of Bio::PopGen::Simulation::Coalescent Args : -samples => arrayref of sample names OR -sample_size=> number of samples (samps will get a systematic name) -maxcount => [optional] maximum number of trees to provide
Title : next_tree Usage : my $tree = $factory->next_tree Function: Returns a random tree based on the initialized number of nodes NOTE: if maxcount is not specified on initialization or set to a valid integer, subsequent calls to next_tree will continue to return random trees and never return undef Returns : Bio::Tree::TreeI object Args : none
Title : add_Mutations Usage : $factory->add_Mutations($tree, $mutcount); Function: Adds mutations to a tree via a random process weighted by branch length (it is a poisson distribution as part of a coalescent process) Returns : none Args : $tree - Bio::Tree::TreeI $nummut - number of mutations $precision - optional # of digits for precision
Title : maxcount Usage : $obj->maxcount($newval) Function: Returns : Maxcount value Args : newvalue (optional)
Title : samples Usage : $obj->samples($newval) Function: Example : Returns : value of samples Args : newvalue (optional)
Title : sample_size Usage : $obj->sample_size($newval) Function: Example : Returns : value of sample_size Args : newvalue (optional)
Title : random Usage : my $rfloat = $node->random($size) Function: Generates a random number between 0 and $size This is abstracted so that someone can override and provide their own special RNG. This is expected to be a uniform RNG. Returns : Floating point random Args : $maximum size for random number (defaults to 1)