跟着Nature Communication学作图:R语言ggplot2话点线图展示基因表达量的范围
2023-02-19 12:27:39 时间
论文
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")
相关文章
- Jgit的使用笔记
- 利用Github Action实现Tornadofx/JavaFx打包
- 叹息!GitHub Trending 即将成为历史!
- 微软软了?开源社区讨论炸锅,GitHub CEO 亲自来答
- GitHub Trending 列表频现重复项,前后端都没去重?
- Photoshop Elements 2021版本软件安装教程(mac+windows全版本都有)
- (ps全版本)Photoshop 2020的安装与破解教程(mac+windows全版本都有)
- (ps全版本)Photoshop cc2018的安装与破解教程(mac+windows全版本,包括2023
- 环境搭建:Oracle GoldenGate 大数据迁移到 Redshift/Flat file/Flume/Kafka测试流程
- 每个开发人员都要掌握的:最小 Linux 基础课
- 来撸羊毛了!Windows 环境下 Hexo 博客搭建,并部署到 GitHub Pages
- 超实用!手把手入门 MongoDB:这些坑点请一定远离
- 【GitHub日报】22-10-09 zustand、neovim、webtorrent、express 等4款App今日上新
- 【GitHub日报】22-10-10 brew、minio、vite、seaweedfs、dbeaver 等8款App今日上新
- 【GitHub日报】22-10-11 cobra、grafana、vue、ToolJet、redwood 等13款App今日上新
- Photoshop 2018 下载及安装教程(mac+windows全版本都有,包括最新的2023)
- Photoshop 2017 下载及安装教程(mac+windows全版本都有,包括最新的2023)
- Photoshop 2020 下载及安装教程(mac+windows全版本都有,包括最新的2023)
- Photoshop 2023 资源免费下载(mac+windows全版本都有,包括最新的2023)
- 最新版本Photoshop CC2018软件安装教程(mac+windows全版本都有,包括2023