husonlab / dendroscope3

Dendroscope program for analyzing and visualizing rooted phylogenetic trees and networks
GNU General Public License v3.0
41 stars 5 forks source link

Support for node attributes (specifically color) in nexml files? #11

Open terrycojones opened 5 years ago

terrycojones commented 5 years ago

Does dendroscope support node attributes in nexml files? I've written some code to color nodes (based on regular expressions on taxa) using the Python dendropy package, but when I try to load such a file using Dendroscope I get an error popup saying Command failed: 1 and the tree doesn't open.

The XML for a colored node being generated by dendropy looks like this

<node id="d137" otu="d18">
                <meta xsi:type="nex:LiteralMeta" property="dendropy:color" content="#ff0000" id="d138" />
</node>

I can also tell dendropy to write out NEXUS format, in which case the color info is in the newick, using e.g., [&color=#ff0000] following the branch lengths. But that information seems to be ignored by Dendroscope.

So I'm wondering if there's a way to do this. I know I could write out a set of Dendroscope specific coloring commands and pipe that into a command-line run of Dendroscope, but I'm trying to stick to something standard that will also work with other tools (e.g., embedding color info into nexml).

Thanks!

terrycojones commented 5 years ago

BTW, I just tried editing the XML change the property names from dendropy:color to color, but get the same (error dialog) result. I've also tried changing #ff0000 to red, without success.