Hi,
I have a sequence phylogenetic tree in Newick format (with branch lengths). I want to traverse the tree bottom-up in a Perl program and edit merging/splitting of nodes based on additional information. I have not done tree traversal before, hence I need some help/advice. This part of the code will give me a cluster representation of the nodes:
use Bio::TreeIO;
use Bio::Tree::Node;
use Bio::Tree::Tree;
use Bio::Tree::Compatible;
my $input = new Bio::TreeIO(-file => "tree.fasttree",
-format => "newick");
my $tree = $input->next_tree;
map { print "(",join(',',@{$_}),")\n" } values %{Bio::Tree::Compatible::cluster_representation( $tree ) };
I want to know how to use information from the cluster_representation ( Bio::Tree::Compatible::cluster_representation code in http://doc.bioperl.org/bioperl-live/Bio/Tree/Compatible.html ) to traverse the tree bottom_up.
Am I in the right track at all?