[BioPython] Phylogeny tree plotting? (was: Generating Figures in Python)

Rick Ree rree@oeb.harvard.edu
Wed, 11 Apr 2001 10:19:22 -0400 (EDT)


On Wed, 11 Apr 2001, Jan T. Kim wrote:

> Initial question: Are there any utilities for plotting trees already
> (which I might have overlooked)? Are there already plans for such a
> project?

I wrote a module for visualizing phylogenies using python using
gnome-python, at http://bioinformatics.org/mavric.  After I finish my
thesis (end of May) I'll work on integrating it into Biopython.

The reasons I haven't done this yet are many, the main ones being lack of
time (I still haven't learned CVS), and design considerations (ultimately
I want the tree data structures to be in a C extension for speed).  I was
concerned about the license issue, too (I prefer GPL), but I'm over it now
:)

Currently mavric has a kludgey way of rendering trees in Postscript, which
can be converted to Sketch files and edited.

Also see the pyphy system at Bioinformatics.org.  This might be more
useful at the moment, but I haven't tried it.


>     * Replacement of "computer friendly" sequence names with "scientist
>       friendly" ones (i.e. names containing slashes or other characters
>       unsuitable for file names, longer names that needed to be
>       abbreviated in the process of generating PHYLIP formatted
>       multiple alignments etc.).
>
>     * Addition of species names to sequence names

This is easily accomplished using custom scripts that could, e.g., look up
sequence names in a database.

>     * Adding colour and other additional visual elements to labels
>
>     * Comparing different trees and rendering common edges in
>       various ways (e.g. for bootstrap analyses, but also useful for
>       much broader applications).
>
>     * Adding "higher order" information, e.g. highlighting the least
>       common ancestor of a group of OTUs, generate shaded boxes or
>       braces showing groups of OTUs etc.

I have some code written for comparing trees.  Mavric currently has a
pretty decent API for manipulating trees, finding common ancestors, etc.,
but the visualzation aspect is lagging behind.

> Over a couple of years, I've produced a C program for generating PostScript
> tree graphics out of New Hampshire formatted trees which addresses these
> demands and satisfies them -- to a greater or lesser extent. This hack
> has reached a stage where a major redesign is due, and I started thinking
> that it might be a good idea to redo the whole thing in Python / Biopython.

I would be interested in discussing design issues, and would appreciate
your help in improving Mavric!

Rick