论文
Plasma proteome analyses in individuals of European and African ancestry identify cis-pQTLs and models for proteome-wide association studies
https://www.nature.com/articles/s41588-022-01051-w
本地pdf s41588-022-01051-w.pdf
代码链接
https://zenodo.org/record/6332981#.YroV0nZBzic
https://github.com/Jingning-Zhang/PlasmaProtein/tree/v1.2
本日的推文重复一下论文中的Extended Data Fig. 2
读取数据
library(readxl)eqtls <- read_excel("data/20220627/ExtendedFig2.xlsx", sheet = "dat")eqtls.2 <- read_excel("data/20220627/ExtendedFig2.xlsx", sheet = "leg")第一个小图a
library(latex2exp)library(ggplot2)im1 <- ggplot(eqtls, aes(x = 1:49,y=V2, size=sample)) + geom_point(alpha=1,color = eqtls$cls)+ theme(plot.title = element_text(hjust = 0.5,size = 7), axis.title.x = element_text(size = 6), axis.title.y = element_text(size = 6), panel.background = element_blank(), axis.text.x = element_blank(), axis.line = element_line(color = "black",size = 0.5), legend.text = element_text(size = 6), legend.title = element_text(size = 6), axis.text = element_text(size = 6)) + labs(title = "Overlap with eQTLs (GTEx V8)", x="Tissues",y="roportion")+ scale_x_continuous(breaks = NULL)+ coord_cartesian(ylim = c(0,0.5)) + scale_fill_manual(values = as.character(eqtls$cls))im1这里新打仗到一个R包latex2exp,用来添加比力复杂的文本公式之类的很方便,须要好勤学习一下
第二个小图b
im2 <- ggplot(eqtls, aes(x = 1:49,y=V3, size=sample)) + geom_point(alpha=1,color = eqtls$cls)+ theme(plot.title = element_text(hjust = 0.5,size = 7), axis.title.x = element_text(size = 6), axis.title.y = element_text(size = 6), panel.background = element_blank(), axis.text.x = element_blank(), axis.line = element_line(color = "black",size = 0.5), legend.text = element_text(size = 6), legend.title = element_text(size = 6), axis.text = element_text(size = 6)) + labs(title = "Colocalization with eQTLs (GTEx V8)", x="Tissues",y="roportion")+ scale_x_continuous(breaks = NULL)+ coord_cartesian(ylim = c(0,0.25)) + scale_fill_manual(values = as.character(eqtls$cls))im2
贡献的图例
im3 <- ggplot(eqtls.2, aes(x = 1:49,y = V3)) + geom_point(aes(color = tissues)) + scale_color_manual(name = "GTEx V8 tissues", values = myColors) + theme( legend.key = element_blank(), legend.key.size = unit(2, "mm"), panel.border = element_blank(), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.background = element_blank(), title = element_text(size = 7), text = element_text(size = 6) ) + guides(color=guide_legend(ncol = 1))im3library(ggpubr)pm3 <- as_ggplot(get_legend(im3))pm3这里新打仗到一个知识点是 ggplot2作图的图例可以单独提取出来然后和其他图去拼图
最后是拼图
p <- ggarrange(ggarrange(im1, im2, nrow = 2, labels = c("a", "b"), heights = c(0.5,0.5)), pm3, ncol = 2, labels = c(NA, NA), widths = c(0.7,0.3))p示例数据和代码可以本身到论文中获取,大概给本篇推文点赞,点击在看,然后留言获取
接待各人关注我的公众号
小明的数据分析条记本
小明的数据分析条记本 公众号 重要分享:1、R语言和python做数据分析和数据可视化的简朴小例子;2、园艺植物相干转录组学、基因组学、群体遗传学文献阅读条记;3、生物信息学入门学习资料及本身的学习条记!
|