veg / phylotree.js

Interactive viewer of phylogenetic trees
http://phylotree.hyphy.org
MIT License
169 stars 71 forks source link

Error on PhyloXML trees with single-branch clades #458

Open miguel76 opened 3 months ago

miguel76 commented 3 months ago

If a PhyloXML contains at some level a clade with only a single branch below, an error is thrown at the following line: https://github.com/veg/phylotree.js/blob/60aa174ea59bc95dca842c518517974d8e9d6565/src/formats/phyloxml.js#L49

The problem is that the code expects the property clade to always be an array, while it is an object in the single branching case (due to how XML is converted to JSON).