AdmiralenOla / Scoary

Pan-genome wide association studies
GNU General Public License v3.0
147 stars 35 forks source link

Don't crash when newick file has node labels #72

Open AdmiralenOla opened 5 years ago

AdmiralenOla commented 5 years ago

Should be fairly simple to allow internal node labels in the newick file. Although this does not impact results, there is no reason for the program to crash.

smb20200615 commented 2 years ago

has this issue been resolved? is there a way to fix it?

AdmiralenOla commented 2 years ago

Unfortunately the issue has not been resolved.

The easiest workaround I can think of is opening your tree in Figtree and then just export your tree without labels.

Another workaround is using the ape package in R:

library(ape)
mytree <- read.tree("MyTree.nwk")
mytree$node.label <- NULL
write.tree(mytree, file="MyTreeNoLabel.nwk")

You should also be able to do it with something like sed. (The following should at least work if your labels are strictly letters, numbers and underscore, but if they have other characters it will likely mess up).

sed -r 's/\)([.0-9A-Za-z_]+):/\):/g' MyTree.nwk > MyTreeNoLabel.nwk