Branch/subtree colors as a function of taxonomy
2009.11.24 Leave a comment
Theory
In order to colorize subtrees/branches according to their associated taxonomies, the Archaeopteryx software needs to “know” two things:
- The taxonomies (‘species’) associated with tree nodes (oftentimes only on external nodes, so-called ‘tips’ or ‘leaves’)
- Information on what color to use for each taxonomy
In practice, the first information comes from the phyloXML formatted tree file, the second from a configuration file.
How-to
To colorize branches and (‘species specific’) subtrees according to their taxonomies:
1. Create a configuration file (see: http://www.phylosoft.org/forester/download/_aptx_configuration_file) containing lines like these:
species_color: NEMVE 0x00FFFF species_color: MOUSE 0x9620F0
Colors need to be encoded in RGB hexadecimal format (more information). For example, red would be ‘0xFF0000’, green ‘0x00FF00’.
2. Your tree file needs to be in phyloXML format (see: phyloXML) and contain matching taxonomy information (relative to the configuration file). The following elements are used for taxonomy colorization (in this order: taxonomy code (e.g. ‘NEMVE” for the sea anemone Nematostella vectensis), scientific name, common name. See http://phylosoft.org/forester/applications/phyloxml_converter/ on how to transform Newick/New Hampshire formatted tree files into phyloXML.
3. Start Archaeopteryx with the following console command:
java -cp path\to\forester.jar org.forester.archaeopteryx.Archaeopteryx -c path\to\_aptx_configuration_file
Needless to say, it is much more convenient to use a .bat file (Windows) or a link (Unix/Linux) instead of typing into a console each time Archaeopteryx is to be started.
4. On the Archaeopteryx application, check ‘Colorize Branches’ checkbox (this simply turns colored branch display on and off, it does not perform any color calculation) and execute ‘Tools’|’Taxonomy Colorize Branches’ (which will infer taxonomies for species specific subtrees).