The flying spider-monkey tree fern genome provides insights into fern evolution and arborescence
https://www.nature.com/articles/s41477-022-01146-6#Sec44
https://doi.org/10.6084/m9.figshare.19125641
看了论文,提供了论文中所有树图的原始树文件,虽然没有提供代码,应该能利用原始数据模仿出来
今天的推文重复一下论文中的Figure4b
image.png
library(ggtree)
library(treeio)
tree<-read.newick("data/20220512/phylogenetic trees/Fig4b_resequencing_tree.nwk",
node.label = "support")
ggtree(tree)
这样的树形也是可以的吗?不太懂
ggtree(tree,branch.length = "none")
image.png
ggtree(tree,branch.length = "none")+
geom_tiplab(size=1.5)
ggtree(tree,branch.length = "none")+
geom_tiplab(size=1.5)+
geom_nodepoint(aes(size=support,x=x-0.5))
ggtree(tree,
branch.length = "none",
layout = "circular")+
geom_tiplab(size=3)+
geom_nodepoint(aes(size=support,x=x-0.5),
color="#8f8fc3")
image.png
ggtree(tree,
branch.length = "none",
layout = "circular")+
geom_tiplab(size=3,align = TRUE,offset = 1)+
geom_nodepoint(aes(size=support,x=x-0.5),
color="#8f8fc3")
ggtree(tree,
branch.length = "none",
layout = "circular")+
geom_nodepoint(aes(size=support,x=x-0.5),
color="#8f8fc3")+
geom_strip(taxa1 = "YN-8",
taxa2 = "XZ-4",
offset = 1.5,
barsize = 12,
extend = 0.5,
color="#7c90c8")+
geom_tiplab(size=3,align = TRUE,offset = 1)
image.png
ggtree(tree,
branch.length = "none",
layout = "circular")+
geom_nodepoint(aes(size=support,x=x-0.5),
color="#8f8fc3")+
geom_strip(taxa1 = "YN-8",
taxa2 = "YN-3",
offset = 2,
barsize = 20,
extend = 0.5,
color="#7c90c8",
label = "YN",
offset.text = 3)+
geom_strip(taxa1 = "XZ-4",
taxa2 = "XZ-2",
offset = 2,
barsize = 20,
extend = 0.5,
color="#549e34",
label = "XZ",
offset.text = 3)+
geom_strip(taxa1 = "Nepal-12",
taxa2 = "Nepal-8",
offset = 2,
barsize = 20,
extend = 0.5,
color="#ebcc5f",
label = "Nepal",
offset.text = 3)+
geom_strip(taxa1 = "FJ-11",
taxa2 = "FJ-5",
offset = 2,
barsize = 20,
extend = 0.5,
color="#c3e5f5",
label = "FJ/TW",
offset.text = 3)+
geom_strip(taxa1 = "HN-12",
taxa2 = "HN-5",
offset = 2,
barsize = 20,
extend = 0.5,
color="#e95639",
label = "HN",
offset.text = 3)+
geom_strip(taxa1 = "GX-5",
taxa2 = "SC-6",
offset = 2,
barsize = 20,
extend = 0.5,
color="#e5914c",
label = "GX/SC/GZ",
offset.text = 3)+
geom_tiplab(size=3,align = TRUE,offset = 1)
image.png
最外圈的文字方向和字体颜色暂时不知道如何用代码来调节,出图后编辑,这里怎们把树旋转成和论文里一样暂时想不到办法了
ggtree(tree,
branch.length = "none",
layout = "circular")+
geom_nodepoint(aes(size=support,x=x-0.5),
color="#8f8fc3")+
geom_strip(taxa1 = "YN-8",
taxa2 = "YN-3",
offset = 2,
barsize = 20,
extend = 0.5,
color="#7c90c8",
label = "YN",
offset.text = 3)+
geom_strip(taxa1 = "XZ-4",
taxa2 = "XZ-2",
offset = 2,
barsize = 20,
extend = 0.5,
color="#549e34",
label = "XZ",
offset.text = 3)+
geom_strip(taxa1 = "Nepal-12",
taxa2 = "Nepal-8",
offset = 2,
barsize = 20,
extend = 0.5,
color="#ebcc5f",
label = "Nepal",
offset.text = 3)+
geom_strip(taxa1 = "FJ-11",
taxa2 = "FJ-5",
offset = 2,
barsize = 20,
extend = 0.5,
color="#c3e5f5",
label = "FJ/TW",
offset.text = 3)+
geom_strip(taxa1 = "HN-12",
taxa2 = "HN-5",
offset = 2,
barsize = 20,
extend = 0.5,
color="#e95639",
label = "HN",
offset.text = 3)+
geom_strip(taxa1 = "GX-5",
taxa2 = "SC-6",
offset = 2,
barsize = 20,
extend = 0.5,
color="#e5914c",
label = "GX/SC/GZ",
offset.text = 3)+
geom_tiplab(size=3,align = TRUE,offset = 1)+
theme(legend.position = c(0.05,0.15))
image.png