creating tree from distance matrix

Showing 1-4 of 4 messages
creating tree from distance matrix kaustubh.patil 3/5/12 3:09 PM
Hi all,

First of all I would like to thank for the nice software.

I want to compare trees created by two distance matrices. DendroPy
provides a way to compare trees but I could not find a way create a
tree from distance matrix (e.g. NJ). Is there a way to do this, my
apologies if I missed it.

best regards

PS: currently I am creating tree in PyCogent and then reading is as
Newick in DendroPy to compare them, which slows down things as I want
to do this for thousands of trees.
Re: creating tree from distance matrix Jeet Sukumaran 3/7/12 10:23 AM
The dendropy.interop.paup.estimate_tree() function will allow you to
do this if you have PAUP* available on your system:

   from dendropy.interpop import paup
   .
   .
   (read data into `char_matrix`)
   .
   .
   tree = paup.estimate_tree(char_matrix, 'nj')
Re: creating tree from distance matrix ifreak 11/14/12 3:05 AM
Hi, i was trying your suggestion.

first of all there is an error : from dendropy.interpop import paup  should be -> from dendropy.interop import paup

and secondly, i have distance matrix as follows inside a numpy array:

[[ 0  2  7  8 16 17]
 [ 2  0  5  6 17 16]
 [ 7  5  0  9 15 13]
 [ 8  6  9  0 18 16]
 [16 17 15 18  0  5]
 [17 16 13 16  5  0]]


how can i generate the tree from it using your method. thank you
Re: creating tree from distance matrix Giulio Valentino Dalla Riva 6/27/13 9:31 PM
Hi ifreak,

Did you figured out how to do it?

Thanks,
Giulio