Carl,
Almost certainly something is wrong with the taxon labels that you are
passing in. I say this because "000000000000000000000000" indicates that
not ONE of your taxa could be found in the taxon namespace of your trees.
DendroPy actually is designed to work with trees with incomplete
leafsets. The failure to map to a bipartition error is indicative of
being unable to find any taxa associated with one or more of your labels
*across the entire taxon namespace*, rather than any single tree.
It would be helpful if you could attach a minimal data file that
replicates this error.
You could also troubleshoot it by add a line like:
for t in trees.taxon_namespace:
print("'{}'".format(t.taxon_label))
to see what the taxon labels that you have actually ingested are.
You could also check if your labels are associated with taxa:
labels = [t.label for t in trees.taxon_namespace]
assert "a" in labels
assert "b" in labels
FYI, the following works for me:
~~~
#! /usr/bin/env python
import dendropy
trees_str1 = """\
(c, (b, (d, e)));
(a, (b, (c, d)));
(a,(b,(c,d)));
(f, (g, (a, (b, (c, d)))));
"""
def f1(trees_str):
trees = dendropy.TreeList.get_from_string(
trees_str,
schema="newick",
rooting="force-rooted",
)
labels = ['a', 'b', 'c', 'd']
freq = trees.frequency_of_bipartition(labels=labels)
print("---")
print(freq)
f1(trees_str1)
~~~
As an aside, you should probably explicitly tell DendroPy the rooting of
the trees unless (a) all your trees have [&R]/[&U] associated with them
or (b) you are OK with unrooted trees. The results of
splits/bipartitions operations on unrooted trees confuse a LOT of people
(it has recently been one of the more common pseudo-"bug" reports I get
...).
-- jeet
> --
> You received this message because you are subscribed to the Google
> Groups "DendroPy Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
dendropy-user...@googlegroups.com
> <mailto:
dendropy-user...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.
--
--------------------------------------
Jeet Sukumaran
--------------------------------------
jeetsu...@gmail.com
--------------------------------------
Blog/Personal Pages:
http://jeetworks.org/
GitHub Repositories:
http://github.com/jeetsukumaran
Photographs (as stream):
http://www.flickr.com/photos/jeetsukumaran/
Photographs (by galleries):
http://www.flickr.com/photos/jeetsukumaran/sets/
--------------------------------------