Closed neptuneyt closed 2 years ago
Thanks for your reply in time.
As you mentioned, I have used rename_taxa function, but it does not support multiPhylo, and returns an error as below, I guess it used as.phylo
function, but it does not support it multiPhylo obj. So do you have any good way to replace tip lables for multiPhylo object. Thanks a lot.
> tree <- read.tree('tree.txt', keep.multi = T)
> write.tree(tree)
[1] "(a:80,b:10,c:70);" "(a:80,c:70);"
> d <- data.frame(old = c('a','b','c'), new = c('A','B','C'))
> rename_taxa(tree, d, old, new)
Error in UseMethod("as.phylo") :
"as.phylo"没有适用于"multiPhylo"目标对象的方法
you can use lapply
to iterate each phylo object. The multiPhylo is just a list of phylo.
Dear Dr Yu, Thanks for your such amazing work. My issue is that, Suppose I have a newick file A, and a list of old and new names mapping table B, how do I replace these names at once and keep remains still? I have try rename_taxa(tree, mapping_data, label, newlab) of treeio, but it could not support multiphylo.
The result should be like:
Thanks a lot!