Robinson-Foulds Error

87 views
Skip to first unread message

Kevin

unread,
Mar 14, 2012, 3:37:13 PM3/14/12
to DendroPy Users
Hello, I am trying to use Dendropy to calculate the Robinson-Foulds
distance, but it's not working. I'm using Python 2.5.1, and the error
I keep getting is:

ValueError: Edge length attribute is 'None': Tree: Tree20106544
('None'), Split: ((B), (A, C, D))

At first I thought my newick format was wrong, but I tried to
reproduce the example in Tutorial 3.1.4.1 and got the same error.

taxa = dendropy.TaxonSet()
t1 = dendropy.Tree.get_from_string('((A,B),(C,D))', schema='newick',
taxon_set=taxa)
t2 = dendropy.Tree.get_from_string('((A,B),(C,D))', schema='newick',
taxon_set=taxa)
treecalc.robinson_foulds_distance(t1, t2)

Can someone please tell me what I'm doing wrong? Thank you.

Jeet Sukumaran

unread,
Mar 14, 2012, 5:37:00 PM3/14/12
to DendroPy Users
Your trees do not have edge lengths, whereas the original ones in the
example. As noted in the DendroPy documentation *and* the tutorial to
which you reference, the "robinson_foulds()" distance method returns
"the sum of the square of differences in branch lengths for equivalent
splits between two trees". This follows Felsenstein, 2004. The metric
commonly referred to as "Robinsons-Foulds" distance in other usage is
given by the "symmetric_difference" method. Again, as noted in the
tutorial:

symmetric_difference()
This method returns the symmetric distance between two trees. The
symmetric distance between two trees is the sum of the number of
splits found in one of the trees but not the other. It is common to
see this statistic called the “Robinson-Foulds distance”, but in
DendroPy we reserve this term to apply to the Robinson-Foulds distance
in the strict sense, i.e., the weighted symmetric distance (see
below).


-- jeet
Reply all
Reply to author
Forward
0 new messages