{"action":"opened","issue":{"url":"https://api.github.com/repos/GuangchuangYu/ggtree/issues/30","labels_url":"https://api.github.com/repos/GuangchuangYu/ggtree/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/GuangchuangYu/ggtree/issues/30/comments","events_url":"https://api.github.com/repos/GuangchuangYu/ggtree/issues/30/events","html_url":"https://github.com/GuangchuangYu/ggtree/issues/30","id":119503986,"number":30,"title":"error reading trees with short branch lengths","user":{"login":"sellisd","id":7484504,"avatar_url":"https://avatars.githubusercontent.com/u/7484504?v=3","gravatar_id":"","url":"https://api.github.com/users/sellisd","html_url":"https://github.com/sellisd","followers_url":"https://api.github.com/users/sellisd/followers","following_url":"https://api.github.com/users/sellisd/following{/other_user}","gists_url":"https://api.github.com/users/sellisd/gists{/gist_id}","starred_url":"https://api.github.com/users/sellisd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellisd/subscriptions","organizations_url":"https://api.github.com/users/sellisd/orgs","repos_url":"https://api.github.com/users/sellisd/repos","events_url":"https://api.github.com/users/sellisd/events{/privacy}","received_events_url":"https://api.github.com/users/sellisd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-30T14:34:17Z","updated_at":"2015-11-30T14:34:17Z","closed_at":null,"body":"Reading trees with `read.nhx` has some problems with short branch lengths when they are supplied in scientific notation, e.g.:\r\n```r\r\nlibrary(ggtree)\r\n# two identical trees but with the branch length of node A written in scientific notation in the first case\r\nshort <- \"((A:0.1e-3[&&NHX:Ev=S:S=1:ND=1],B:1[&&NHX:Ev=S:S=1:ND=2]):1[&&NHX:Ev=S:S=1:ND=3],C:1[&&NHX:Ev=S:S=1:ND=4]):1[&&NHX:Ev=S:S=1:ND=5];\"\r\nlong <- \"((A:0.001[&&NHX:Ev=S:S=1:ND=1],B:1[&&NHX:Ev=S:S=1:ND=2]):1[&&NHX:Ev=S:S=1:ND=3],C:1[&&NHX:Ev=S:S=1:ND=4]):1[&&NHX:Ev=S:S=1:ND=5];\"\r\nwrite(short, file = \"~/short.tre\")\r\nwrite(long, file = \"~/long.tre\")\r\n# both are parsed fine by read.tree\r\nplot(read.tree(\"~/short.tre\"))\r\nplot(read.tree(\"~/long.tre\"))\r\nread.nhx(\"~/long.tre\") # works\r\nread.nhx(\"~/short.tre\") # parsing never ends!\r\n```\r\n"}}