[Biopython] tree traversal
Jan Kim
jttkim at googlemail.com
Wed Jul 10 11:01:04 UTC 2013
On Tue, Jul 09, 2013 at 04:08:33PM -0400, Jessica Grant wrote:
> Hello,
>
> I have been working with phylogenetic trees, and am trying to write a
> script that traverses the tree and returns sister taxa to monophyletic
> clades. I've been using the Phylo module in Biopython, but find it
> confusing.
>
> Briefly, my script takes all leaves and checks to see if the parent clade
> is monophyletic based on the names of the leaves. If so, it checks the
> parent of that clade, and so on. When it gets to a clade that is
> non-monophyletic, it should return the name of the leaf or leaves that
> aren't in the monophyletic group.
it's not really clear which question you're trying to answer, as a
single clade (tree node) is always monophyletic by definition, as it
has only one parent.
If you have a group of leaf names and want to determine whether that
group is monophyletic, the common_ancestor method should find the clade
you're after, and finding any leaves not belonging to th group should
be a matter of a simple set difference. Or perhaps the is_monophyletic
method already does all you need?
Best regards, Jan
> Phylo seems to give spurious results (or at least results that I don't
> understand) having to do, maybe, with the way it traverses the tree.
> Sometimes it seems to work fine, but other times it returns taxa that,
> looking at the tree, don't seem to be the nearest neighbors.
>
> I was wondering if anyone has worked with this module and might have some
> advice...or if there is a better way to approach this problem.
>
> Thanks,
>
> Jessica
> _______________________________________________
> Biopython mailing list - Biopython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
--
+- Jan T. Kim -------------------------------------------------------+
| email: jttkim at gmail.com |
| WWW: http://www.jtkim.dreamhosters.com/ |
*-----=< hierarchical systems are for files, not for humans >=-----*
More information about the Biopython
mailing list