[Biopython] Phylo.draw_graphviz(tree) not showing node names

Eric Talevich eric.talevich at gmail.com
Fri Jan 23 16:33:15 UTC 2015


Hi Jan,

Could you show us some more information about your tree, like the first few
lines you see with "print tree"? Also try converting the tree to a NetworkX
graph, which is the intermediate form used by draw_graphviz, and inspecting
the nodes to see if names were lost or retained:

graph = Phylo.to_networkx(tree)
graph.nodes()

Also:

- What was the source file format (e.g. Newick, Nexus, PhyloXML, NeXML)
- Which versions of Biopython and NetworkX are you using?

It's possible the node names are assigned to a different attribute than the
node name, in which case you can use the "label_func" argument in
draw_graphviz to retrieve the name from the graph node.

Hope that helps,
Eric



On Thu, Jan 22, 2015 at 8:02 AM, Jan Zaucha <Jan.Zaucha at bristol.ac.uk>
wrote:

> Hi everyone,
>
> I'm trying to visualize the trees I generate, but for some reason the
> plots do not display the node names. When I print the tree each node has an
> associated name (string format). Phylo.draw(tree) also works fine and plots
> a tree with the node names.
>
> I simply use:
> Phylo.draw_graphviz(tree)
> pylab.show()
>
> There is no error, I can't work out how to force the node names to be
> printed.
>
> Any ideas?
>
> Thanks,
> Jan Zaucha
>
> --
> Jan Zaucha
> Bristol Centre for Complexity Sciences
> Computational Genomics Group
> University of Bristol
>
> _______________________________________________
> Biopython mailing list  -  Biopython at mailman.open-bio.org
> http://mailman.open-bio.org/mailman/listinfo/biopython
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20150123/080e849b/attachment.html>


More information about the Biopython mailing list