icytree icon indicating copy to clipboard operation
icytree copied to clipboard

Error for hybrid nodes with null branch length

Open PierreBarrat opened this issue 3 years ago • 1 comments

When reading extended Newick, Icytree seems to fail when hybrid nodes have a 0 branch length. Below is a simple example, but this error seems to occur for all extended newick strings.

The following extended Newick string is displayed normally (see image) ((A/Pennsylvania/26/2017[&segments={0,1}]:0.5)ARGNode_jnx1q48i#H1[&segments={1}]:1.5,(A/Victoria/361/2011[&segments={0,1}]:2.,((ARGNode_jnx1q48i#H1[&segments={0}]:0.00000001,A/Victoria/686/2017[&segments={0,1}]:0.5)ARGNode_io6vA3je[&segments={0,1}]:0.5,A/PuertoRico/12/2017[&segments={0,1}]:1.)ARGNode_qeTNiqOc[&segments={0,1}]:1.0)ARGNode_loTXzrzb[&segments={1}]:0.0)ARGNode_6YMmGIKr[&segments={1}];

Capture du 2021-11-29 14-53-35

If the branch length above the second occurrence of node ARGNode_jnx1q48i#H1 is changed to exactly 0 instead of 0.00...001, icytree fails. Console log below:

Capture du 2021-11-29 14-44-29

PierreBarrat avatar Nov 29 '21 13:11 PierreBarrat

Hi Pierre, thanks for letting me know about this.

The problem here is due to an interaction between the default option of "collapse zero-length edges" and the processing of hybrid nodes. You can work around the problem by disabling "collapse zero-length edges" from the style menu, which causes the network to be displayed properly. Obviously the problem shouldn't occur at all though, and I'll look into this when I have a chance.

Thanks again for bringing this up!

tgvaughan avatar Nov 30 '21 08:11 tgvaughan