Phylogeny Projects
There are currently three programs that can be downloaded from this site in this area. The three programs are :
Tree Viewer
The Tree viewer software is written in Python and uses wxPython modules. Especially the FloatCanvas module. The good thing about FloatCanvas is it gives an infinite canvas to work with which makes life easy. Another nifty tool in FloatCanvas is pre-defined buttons for zooming, dragging and "Zoom to fit". All one has to specify is what object we would like to draw and where (with optional properties). The algorithm for parsing Newick format is taken from Ed's Big Plans
The algorithm for the Tree Viewer is simple. Take a newick format file and first make parent-child and child-parent hashes (dict in python). Then, use a recursive function to find the number of children of children of .... till the leaves of the tree. Now, once we get the number of descendants, allot space for that many children. In other words, if node 1 has 5 descendants, then since each node needs 20 pixels to display, allot space for 20 * 5 pixels. Since the trees are binary, one can allot half this value to left node and other half to right node. So, the tree looks well resolved when used for 'balanced' trees, but for highly asymmetric trees, the algorithm does not work very well. I am working on it. One way to do that is to query for descendants of left node and allot that much for left node, and similarly for right node. Should'nt be too difficult. Anyway, then the FloatCanvas modules to add Scaled Text Box is used to draw the leaf info recursively. That is all. Oh one more thing. Middle click anywhere in the canvas will open a dialog to save the current view as PNG file. The Download link is given below :
Program : tree_viewer.py
Example tree : Newick format tree of PKC
One of the things that is in the list of features to be added is setting the background color for each leaf. Too often in a big tree, it is difficult to find which nodes belong to which category. For example, lets say you are drawing a tree of Kinases, then one would like to know how the various sub-families cluster. Doing this individually for each node is difficult. So, at least for known cases, one can assign a color, and assign a different color for each unknown protein to see how the clusters intermingle. This is easy to do, but I have not yet done that. One more thing that is to be done is make circular layouts
SCOP classification Viewer
The design of the classification viewer is exactly the same as that for Tree Viewer. Its just that the classification is a one-to-many type of tree, and so the space allocation algorithm is slightly complicated. Actually, the space allocation occurs exactly as explained in the tree-viewer section when I desribe a better algorithm for space allocation. Due to the one-to-many nature of classification schemes, the depth is usually limited whereas the breadth is quite high. So, the algorithm in its current form is not directly applicable for Newick trees. Download links for classification viewer is given below. Note that currently only SCOP is supported but others are easy to implement. The program needs a heir.txt file which contains the SCOP classification.
Program : classification_viewer.py
Example tree : SCOP heirarchy file