論文
A highly conserved core bacterial microbiota with nitrogen-fixation capacity inhabits the xylem sap in maize plants
https://www.nature.com/articles/s41467-022-31113-w
本地pdf s41467-022-31113-w.pdf
數(shù)據(jù)代碼鏈接
https://github.com/PlantNutrition/Liyu
今天的推文我們重復(fù)一下論文中的Figure2f
這個(gè)圖怎們看,然后表達(dá)的是什么含義莲祸,我暫時(shí)還想不明白蹂安,論文中給的圖注是
Ternary plots of OTUs in xylem sap across three fertilisation treatments. Size of each point represents relative abundance of OTU. Position is determined by the contribution of three fertilisation treatments to the total relative abundance, proximity to that vertex indicates enrichment of that OTU in that fertilisation treatment. Colours of circles correspond to different genera. Grey circles indicate OTUs with no significant differences in abundance.
作圖數(shù)據(jù)部分截圖
ggtern 這個(gè)R包是我第一次使用,首先需要安裝锐帜,運(yùn)行代碼install.packages("ggtern")
讀取數(shù)據(jù)集
plot_data <- read.table("data/20220612/Tern_data.txt",
header=T,
row.names= 1,
sep="\t",
comment.char = "")
作圖代碼
library(ggtern)
p <- ggtern(data=plot_data, aes(x=CK, y=NPK, z=NPKM)) +
geom_mask() +
geom_point(aes(size=size, color=Genus),alpha=0.8) +
scale_size(range = c(0, 10)) +
scale_color_manual(values = c('#E31A1C','#228B22','#1F78B4', '#FDB462', '#8B658B', '#4876FF', '#00BFFF', '#EE82EE','#8B8682','#CDC9C9'), limits = c('Klebsiella','Pseudomonas','Enterobacteriaceae_unclassified','Rosenbergiella','Oxalobacteraceae_unclassified','Sphingobacterium','Lactococcus','Erwinia','Others','NotSig')) +
guides(size="none") +theme_bw() +
theme(axis.text=element_blank(), axis.ticks=element_blank())
p
論文中的代碼出圖
調(diào)整圖例的位置田盈,可以用ggplot2中調(diào)整圖例的方法
p+
theme(legend.position = "bottom")+
guides(color=guide_legend(nrow = 3,
override.aes = list(size = 5),
title.position = "top"))
試了一下和其他ggplot2的圖進(jìn)行組合,patchwork沒(méi)有成功缴阎,找找有沒(méi)有其他辦法可以實(shí)現(xiàn)組合圖
示例數(shù)據(jù)和代碼可以在公眾號(hào)后臺(tái)留言20220612獲取
歡迎大家關(guān)注我的公眾號(hào)
小明的數(shù)據(jù)分析筆記本
小明的數(shù)據(jù)分析筆記本 公眾號(hào) 主要分享:1允瞧、R語(yǔ)言和python做數(shù)據(jù)分析和數(shù)據(jù)可視化的簡(jiǎn)單小例子;2蛮拔、園藝植物相關(guān)轉(zhuǎn)錄組學(xué)述暂、基因組學(xué)、群體遺傳學(xué)文獻(xiàn)閱讀筆記建炫;3畦韭、生物信息學(xué)入門學(xué)習(xí)資料及自己的學(xué)習(xí)筆記!