[Bioperl-l] FigTree extensions to nexus

Heikki Lehvaslaiho heikki at sanbi.ac.za
Fri Oct 17 07:41:59 UTC 2008


FigTree is a graphical viewer of phylogenetic trees and a program for 
producing publication-ready figures written by Andrew Rambaut: 
http://tree.bio.ed.ac.uk/software/figtree/.

I added code to Bio::TreeIO::nexus::write_tree (svn 14935) that adds labels 
and colors to the output as comments for FigTree to recognise. This code names 
and colors a cluster in a tree:

my $name = 'ClusterA';
my $color = '#ff0000'; #red
$stem_node->set_tag_value('label', $name);
$stem_node->set_tag_value('color', $color);
foreach my $node  ($stem_node->get_all_Descendents) {
    $node->set_tag_value('color', $color);
}

Currently these tags are always printed out. If needed, it will be easy to add 
a switch to the nexus module to write them out only on request.

Enjoy,

   -Heikki

-- 
______ _/      _/_____________________________________________________
      _/      _/
     _/  _/  _/  Heikki Lehvaslaiho    heikki at_sanbi _ac _za
    _/_/_/_/_/  Senior Scientist    skype: heikki_lehvaslaiho
   _/  _/  _/  SANBI, South African National Bioinformatics Institute
  _/  _/  _/  University of Western Cape, South Africa
     _/      Phone: +27 21 959 2096   FAX: +27 21 959 2512
___ _/_/_/_/_/________________________________________________________




More information about the Bioperl-l mailing list