creating tree from distance matrix

152 views
Skip to first unread message

Kaustubh Patil

unread,
Mar 5, 2012, 6:09:12 PM3/5/12
to DendroPy Users
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.

Jeet Sukumaran

unread,
Mar 7, 2012, 1:23:32 PM3/7/12
to DendroPy Users
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')

Abdullah Sahyoun

unread,
Nov 14, 2012, 6:05:47 AM11/14/12
to dendrop...@googlegroups.com
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

Giulio Valentino Dalla Riva

unread,
Jun 28, 2013, 12:31:26 AM6/28/13
to dendrop...@googlegroups.com
Hi ifreak,

Did you figured out how to do it?

Thanks,
Giulio
Reply all
Reply to author
Forward
0 new messages