論文
Microbiomes in the Challenger Deep slope and bottom-axis sediments
https://www.nature.com/articles/s41467-022-29144-4#code-availability
對應代碼鏈接
https://github.com/ucassee/Challenger-Deep-Microbes
論文里提供了大部分圖的數據和代碼,很好的學習材料,感興趣的同學可以找來參考,今天的推文重復一下論文中的Figure3b
示例數據集部分截圖
image.png
讀取數據
dat01<-read.delim("data/20220602/NC_Figure3b.txt",
header=TRUE,
check.names = FALSE,
sep="\t",
stringsAsFactors = TRUE)
head(dat01)
table(dat01$Group)
dat01$gene<-factor(dat01$gene,
levels = dat01$gene)
作圖代碼
library(ggplot2)
library(scales)
ggplot(data=dat01,aes(x=gene,y=mean_value,color=Group))+
geom_pointrange(aes(ymin=min_value,ymax=max_value),
show.legend = FALSE)+
scale_y_continuous(trans = log10_trans()
,breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
scale_color_manual(values=c("#BB3D00","#6F00D2","#D9006C",
"#005AB5","#00DB00","#3D7878","#D9B300"))+
theme_bw() +
theme(panel.background=element_rect(fill="white",colour="black",size=0.25),
axis.line=element_line(colour="black",size=0.25),
axis.title=element_text(size=13,face="plain",color="black"),
axis.text = element_text(size=10,face="plain",color="black"),
axis.text.x = element_text(angle = 60, hjust = 1, vjust =1),
#legend.position="none"
)+
labs(x=NULL,y="TMP of genes")
image.png
示例數據和代碼可以在公眾號后臺留言20220610獲取
歡迎大家關注我的公眾號
小明的數據分析筆記本
小明的數據分析筆記本 公眾號 主要分享:1、R語言和python做數據分析和數據可視化的簡單小例子;2、園藝植物相關轉錄組學、基因組學、群體遺傳學文獻閱讀筆記;3、生物信息學入門學習資料及自己的學習筆記!