Dendrogram drawing 1.0

Dendrogram drawing script draws a dendrogram (horizontal format used for evolutionary trees), as ASCII text, given as input a binary tree in the form of a tuple for each tree node.
This script draws a dendrogram (horizontal format used for evolutionary trees), as ASCII text, given as input a binary tree in the form of a tuple for each tree node. Tree leaves can be any Python object other than a length-2 tuple, and are converted to strings in the output.

Tree nodes at the same distance from the root will line up at the same column, with the distance between tree levels controlled by an optional "sep" parameter. The algorithm works by a straightforward inorder traversal, keeping some simple data structures to keep track of the tree edges that need to be drawn on each output line. Its output is via print statements but it could easily be modified to send its output lines to any other kind of stream.

last updated on:
June 2nd, 2007, 10:56 GMT
price:
FREE!
developed by:
David Eppstein
homepage:
aspn.activestate.com
license type:

Other Free / Open Source License: Python License

operating system(s):
Windows / Linux / Mac OS / BSD / Solaris
category:
C: \ Miscellaneous

FREE!

In a hurry? Add it to your Download Basket!

user rating 20

2.5/5
 

0/5

Rate it!

Add your review!

SUBMIT