figtree icon indicating copy to clipboard operation
figtree copied to clipboard

Newick files with comma-delimited labels load incorrectly

Open arendsee opened this issue 3 years ago • 3 comments

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

arendsee avatar Apr 15 '21 22:04 arendsee

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;

rambaut avatar Apr 19 '21 07:04 rambaut

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.

arendsee avatar Apr 19 '21 14:04 arendsee

I agree - it should either complain or parse them.

rambaut avatar Aug 18 '22 16:08 rambaut