ggtree是Y叔来发的用于分析进化关系很强大的R包,用ggtree可以轻轻松松绘制一棵优雅的进化树,高配版进化树请参考:
https://www.jianshu.com/p/f572aa0e6fde
rm(list = ls())
pacman::p_load(ggplot2,ggstar,ggtree,treeio); options(warn = -1)
tree <- read.newick("tree.tre")
group_file <- read.table("group.txt",header = T,sep="\t",row.names = 1)
groupInfo <- split(row.names(group_file), group_file$Group)
groupOTU(tree, groupInfo) %>%
ggtree(branch.length = "none",layout = "circular",
linetype=1,size=1,ladderize = F)+
geom_tiplab(hjust = -.5,size=3,fontface="plain")+
geom_tippoint(aes(color = group),size=3)+
xlim(0,10)+labs(color= "location")
tree.jpg
网友评论