It is a shame that you downgraded your DendroPy version.
And a little puzzling, because both (1) and (2) are not only supported
in DendroPy 4, but actually a lot easier to do than in DendroPy 3.
For (2), in DendroPy 4, there are so many ways to skin the cat, so to
speak, depending on what you want, all making using the
DendroPy4-specific nifty and handy "Bipartition" class.
~~~
#! /usr/bin/env python
import dendropy
tree = dendropy.Tree.get(
path="pythonidae.mle.nex",
schema="nexus")
tree.encode_bipartitions()
## Get all taxa as Taxon objects
for nd in tree:
print(nd.bipartition.leafset_taxa(taxon_namespace=tree.taxon_namespace))
## Print taxa names
for nd in tree:
print(", ".join(t.label for t in
nd.bipartition.leafset_taxa(taxon_namespace=tree.taxon_namespace)))
## Print as newick string
for nd in tree:
print(nd.bipartition.leafset_as_newick_string(taxon_namespace=tree.taxon_namespace))
~~~
-- 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/
--------------------------------------