You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if I'm using AddTips() incorrectly or there is an issue with the function. Reprex below:
# create a random tree
set.seed(0)
tree<-ape::rtree(10)
# define node labels and plottree$node.label<- paste0("Node_", 1:tree$Nnode)
plot(tree, show.node.label=TRUE)
# add a tiptree2<-TreeTools::AddTip(tree, where="t8", label="new", edgeLength=0)
# plot, notice that: 1. internal node labels change, 2. "Node_1" is now recycled!
plot(tree2, show.node.label=TRUE)
# Also node.label does not changetree2$node.label#> [1] "Node_1" "Node_2" "Node_3" "Node_4" "Node_5" "Node_6" "Node_7" "Node_8"#> [9] "Node_9"
To add more context, I was completely unaware of the issue. I built a tree, added the new tips, exported the resulting tree, and then a downstream process produced funky results. It turned out that tree building produced a tree with internal node labels. AddTips() added the tips but did not touch node labels and then ape::write.tree() exported a tree with redundant internal node labels.
Hi,
I'm not sure if I'm using
AddTips()
incorrectly or there is an issue with the function. Reprex below:Created on 2024-03-22 with reprex v2.1.0
This is a problem because tools that make use of the
node.label
element will produce all sorts of issues downstream.Not sure this is a proper fix but adding something like this may work:
The names of the internal nodes will still change but the redundancy will be eliminated.
The text was updated successfully, but these errors were encountered: