YuLab-SMU / ggtree

:christmas_tree:Visualization and annotation of phylogenetic trees
https://yulab-smu.top/treedata-book/
830 stars 172 forks source link

How to add group information to nodes? #557

Open xieduo7 opened 1 year ago

xieduo7 commented 1 year ago

I produced a tree and added nodes to it:

library(ggtree)
library(treeio)

tree <- rtree(13,tip.label = c("A","B","C","D","E","F","G","H","I","J","K","L","M"))
set.seed(1234)
library(ape)
emp_tree <- makeNodeLabel(tree, method = "number", prefix = "Node")
groupInfo<-list(group1=c("A","B","C","D","E","Node1"),
                group2=c("F","G","H","I","J","K","L","M"))
tree01 <-groupOTU(emp_tree,groupInfo)
as_tibble(tree01)

But I cannot add the group information to nodes (see the 'Node1'): image

How can I change the group information of nodes?