打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
进化树改名

I don't know whether 'rename taxa' is a common task or not. It seems not a good idea to rename taxa in Newick tree text, since it may introduce problems when mapping the original sequence alignment to the tree.

If you just want to show different or additional information when plotting the tree, it is fine and easy to do it using ggtree:

require(treeio)
require(ggtree)
tr <- read.tree(text="">'((a,(b,c)),d);')
genus <->'Gorilla', 'Pan', 'Homo', 'Pongo')
species <->'gorilla', 'spp.', 'sapiens', 'pygmaeus')
geo <->'Africa', 'Africa', 'World', 'Asia')
d <- data.frame(label="">tr$tip.label, genus = genus,
               species = species, geo = geo)
ggtree(tr) %<+% d="" +="" xlim(na,="">5) +
   geom_tiplab(aes(label=paste0('italic(', genus, ')~bolditalic(', species, ')~', geo)), parse=T)

However, it is also possible to rename taxa of the tree object (either treedata or phylo) in treeio:

tr2 = rename_taxa(tr, d, label, genus)
write.tree(tr2)
d2 = dplyr::mutate(d, newlab = paste(genus, species, sep='|'))
tr3 = rename_taxa(tr, d2, label, newlab)
write.tree(tr3)

If the input tree object is a treedata instance, you can use write.beast to export the tree with associated data to a BEAST compatible NEXUS file.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
ggjoy facet with ggtree
楠楠每日长难句(day 73)
文章发表:两种方法在进化树上可视化数据
ggtree版本的plotTree
一文绘全各种不同的微生物组分类树_ggtree
Genome-wide analysis of cis-regulatory divergence between species in the Arabidopsis genus.
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服