rambaut / figtree

Automatically exported from code.google.com/p/figtree
396 stars 106 forks source link

Newick files with comma-delimited labels load incorrectly #170

Open arendsee opened 3 years ago

arendsee commented 3 years ago

For the tree

(('A','B')[&label=1,!color=#73ffff],'C');`

I would expect a 3-tip tree with the (A,B) subtree containing the label 1 and color #73ffff. But the comma in the label seems to be interpreted as an additional leaf.

See screen shot below:

Screen Shot 2021-04-15 at 5 12 54 PM

I'm using FigTree v1.4.2

rambaut commented 3 years ago

Comments (in [, ]) and 'metacomments' are only defined by the Nexus format. Surround the tree by:


#NEXUS
begin trees;
   tree TREE = (('A','B')[&label=1,!color=#73ffff],'C');
end;
arendsee commented 3 years ago

Then perhaps either an error should be raised or the comments should be entirely ignored. Single field comments, like [&label=1] do work in the Newick inputs. So there is partial support, but commas aren't handled.

rambaut commented 2 years ago

I agree - it should either complain or parse them.