{"action":"created","issue":{"url":"https://api.github.com/repos/ContentMine/phylotree/issues/21","labels_url":"https://api.github.com/repos/ContentMine/phylotree/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/ContentMine/phylotree/issues/21/comments","events_url":"https://api.github.com/repos/ContentMine/phylotree/issues/21/events","html_url":"https://github.com/ContentMine/phylotree/issues/21","id":100322380,"number":21,"title":"Singleton nodes in Newick","user":{"login":"petermr","id":733515,"avatar_url":"https://avatars.githubusercontent.com/u/733515?v=3","gravatar_id":"","url":"https://api.github.com/users/petermr","html_url":"https://github.com/petermr","followers_url":"https://api.github.com/users/petermr/followers","following_url":"https://api.github.com/users/petermr/following{/other_user}","gists_url":"https://api.github.com/users/petermr/gists{/gist_id}","starred_url":"https://api.github.com/users/petermr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermr/subscriptions","organizations_url":"https://api.github.com/users/petermr/orgs","repos_url":"https://api.github.com/users/petermr/repos","events_url":"https://api.github.com/users/petermr/events{/privacy}","received_events_url":"https://api.github.com/users/petermr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"rossmounce","id":824120,"avatar_url":"https://avatars.githubusercontent.com/u/824120?v=3","gravatar_id":"","url":"https://api.github.com/users/rossmounce","html_url":"https://github.com/rossmounce","followers_url":"https://api.github.com/users/rossmounce/followers","following_url":"https://api.github.com/users/rossmounce/following{/other_user}","gists_url":"https://api.github.com/users/rossmounce/gists{/gist_id}","starred_url":"https://api.github.com/users/rossmounce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossmounce/subscriptions","organizations_url":"https://api.github.com/users/rossmounce/orgs","repos_url":"https://api.github.com/users/rossmounce/repos","events_url":"https://api.github.com/users/rossmounce/events{/privacy}","received_events_url":"https://api.github.com/users/rossmounce/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-08-11T14:16:36Z","updated_at":"2015-08-11T16:16:32Z","closed_at":null,"body":"Ross Mounce:\r\nI have discovered that some programs don't like \"singleton nodes\" p4 may also be having this problem\r\nso trees like this:\r\n```\r\n((X76436:483.0,((X60646:436.0,(ABOZ1185:296.0,(D16268:208.0,(AJ542512:21.0,AJ542509:31.0)NT1.13:245.0)NT1.6:13.0)NT1.5:56.0)NT1.4:103.0,(AJ551329:342.0,(AJ422145:163.0,(EU046268:80.0,AY373018:217.0)NT1.9:88.0)NT1.8:60.0)NT1.7:185.0)NT1.3:64.0)NT1.2:244.0);\r\n```\r\nmust be converted to:\r\n```\r\n(X76436:483,((X60646:436,(ABOZ1185:296,(D16268:208,(AJ542512:21,AJ542509:31)NT1.13:245)NT1.6:13)NT1.5:56)NT1.4:103,(AJ551329:342,(AJ422145:163,(EU046268:80,AY373018:217)NT1.9:88)NT1.8:60)NT1.7:185)NT1.3:64)NT1.2;\r\n```\r\n(aside from removing the decimal .0 the significant difference is removing the outermost parentheses)\r\nfor trees like the above R ape package for phylogenetics will give this error message:\r\n```\r\nMyTree <- read.tree(\"tree3.tre\") #fail\r\nError in read.tree(\"tree3.tre\") : \r\n  The tree has apparently singleton node(s): cannot read tree file.\r\n  Reading Newick file aborted at tree no. 1\r\n```\r\nthere is an R script linked from here that I've tried and appears to succeed in removing these singleton nodes: https://stat.ethz.ch/pipermail/r-sig-phylo/2013-June/002783.html\r\n\r\nPMR:\r\nIf you describe the problem precisely I can edit `ami-phylo` to avoid this problem. Can the singleton node be anywhere? If so I can alter:\r\n```\r\nA-\r\n  B\r\n  C-\r\n    D\r\n```\r\nto \r\n```\r\nA- \r\n  B\r\n  D\r\n```\r\nas C has only one child.\r\nIs that what is required? Universally elide all single-node children with their child.\r\n"},"comment":{"url":"https://api.github.com/repos/ContentMine/phylotree/issues/comments/129952327","html_url":"https://github.com/ContentMine/phylotree/issues/21#issuecomment-129952327","issue_url":"https://api.github.com/repos/ContentMine/phylotree/issues/21","id":129952327,"user":{"login":"petermr","id":733515,"avatar_url":"https://avatars.githubusercontent.com/u/733515?v=3","gravatar_id":"","url":"https://api.github.com/users/petermr","html_url":"https://github.com/petermr","followers_url":"https://api.github.com/users/petermr/followers","following_url":"https://api.github.com/users/petermr/following{/other_user}","gists_url":"https://api.github.com/users/petermr/gists{/gist_id}","starred_url":"https://api.github.com/users/petermr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermr/subscriptions","organizations_url":"https://api.github.com/users/petermr/orgs","repos_url":"https://api.github.com/users/petermr/repos","events_url":"https://api.github.com/users/petermr/events{/privacy}","received_events_url":"https://api.github.com/users/petermr/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T16:16:32Z","updated_at":"2015-08-11T16:16:32Z","body":"Ross Mounce:\r\nNewick 'singleton' problem not a problem now, I think. Seems to just be caused by too many parentheses at the outermost (root) level: https://github.com/ContentMine/phylotree/issues/21#issuecomment-129945961\r\nGitHub\r\nSingleton nodes in Newick · Issue #21 · ContentMine/phylotree · GitHub\r\nRoss Mounce: I have discovered that some programs don't like \"singleton nodes\" p4 may also be having this problem so trees like this: ((X76436:483.0,((X60646:436.0,(ABOZ1185:296.0,(D16268:208.0,(A...\r\n5:00\r\nI can easily systematically correct this after it is detected \r\n\r\nPMR: Much better for me to edit the code. we should avoid emitting this even though it may be correct Newick. (note the tree has garbled tip label for ABOZ1185), presumably Z->2.\r\n\r\n"}}