在使用ggtree可视化NJ树的时候,想要批量修改叶节点标签,将序列ID改为物种id,
(1)本想参照网页上的
tree<-read.newick("ggtree_practice_aligned.fasta.treefile",
node.label = "support")
df<-read.csv("pra.csv",header=T) tree1<-tree tree1@phylo$tip.label<- df[match(tree1@phylo$tip.label,df$x),]$y
但是发现输入tr@phylo$node.label报错为不是S4
tr <- read.newick("0527",node.label = "support")
tr@phylo$node.label
Error: trying to get slot "phylo" from an object (class "phylo") that is not an S4 object
(2)并发现读入newick文件时设置node.label = "support"
报错
> tr <- read.newick("0527",node.label = "support")
Error:
! Tibble columns must have compatible sizes.
• Size 106: Existing data.
• Size 0: Column `support`.
ℹ Only values of size one are recycled.
Run `rlang::last_trace()` to see where the error occurred.
1 回答
这家伙很懒,还没有设置简介