[Bioperl-guts-l] [BioPerl - Feature #1874] fixedtopo random tree Bio::Tree::RandomFactory

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Tue Mar 15 13:20:06 EDT 2011

Issue #1874 has been updated by Chris Fields.

Tracker changed from Bug to Feature

Feature #1874: fixedtopo random tree Bio::Tree::RandomFactory

Author: Albert Vilella
Status: New
Priority: Low
Assignee: Bioperl Guts
Category: Unclassified
Target version: unspecified

A method for a Bio::Tree object that will generate a number of trees
with the same topology as the input tree but with random branch
lengths for each branch given.

One would call the method with something similar to this:

my $treeio = new Bio::TreeIO(-format => 'newick', -file =>
my $tree = $treeio->next_tree;
my $out = Bio::TreeIO->new
     -format => 'newick',
     -file   => ">$outfile"
my $factory = new Bio::Tree::RandomFactory(
        -tree => $tree,
        -maxcount => $maxcount,
        -method => "fixedtopo",

while(my $generatedtree = $factory->next_tree) {

There would be something like a "fixedtopo_maxlen" so that the random
lengths fall inside the (0..maxlen) range.

One can just add code in next_tree to see if tree object is already
stored and the method is 'fixedtopo', then return trees from that in
the same fashion as the rest of the random topos are generated.

To consider - Branch lengths to be distributed

One can see how time is applied to each node in the
rand_birthdeath_backwards_tree() function in the Tree::RandomFactory -
but I think I assign brlens first and then build up the tree from that
so the lengths are distributed properly on each level.

Look at tree generation code from Mike Sanderson's r8s package - one
may want to trawl around in the tree building literature to get a
better sense of how to best generate branch lengths.

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org

More information about the Bioperl-guts-l mailing list