論文
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
今天的推文重復(fù)一下論文中的Extended Data Fig. 10
部分示例數(shù)據(jù)截圖
這個(gè)是已經(jīng)做好了主成分分析眼耀,現(xiàn)在只是可視化展示結(jié)果
讀取數(shù)據(jù)
pc2<-read.delim(file = "data/20220627/ExtendedDataFig10.txt",
header = TRUE,
sep="\t")
head(pc2)
作圖代碼
library(ggplot2)
library(GGally)
pc.pr <- ggpairs(pc2[,3:7],
aes(color = pc2$V1),
upper = list(continuous = "points"),
diag = list(continuous = "blank")) +
scale_color_manual(values=c("#238b45","#2171b5")) +
theme(panel.background = element_blank(),
legend.position = "bottom",
axis.text = element_text(size = 6),
axis.title = element_text(size = 7)) +
scale_x_continuous(breaks = c(-0.01,0,0.01),
labels = c(-0.01,0,0.01)) +
scale_y_continuous(breaks = c(-0.01,0,0.01),
labels = c(-0.01,0,0.01))
pc.pr
拼圖代碼
pc.pr+
scale_color_manual(values = c("#f47720","#459943")) -> p2
library(patchwork)
pdf(file="Rplot05.pdf",
width = 9.4,
height = 4)
wrap_elements(ggmatrix_gtable(pc.pr))+
wrap_elements(ggmatrix_gtable(p2))
dev.off()
新知識(shí)點(diǎn):ggpairs()
函數(shù)作圖后的拼圖代碼wrap_elements(ggmatrix_gtable(pc.pr))+ wrap_elements(ggmatrix_gtable(p2))
參考鏈接
https://github.com/thomasp85/patchwork/issues/100
示例數(shù)據(jù)和代碼可以自己到論文中獲取扑庞,或者給本篇推文點(diǎn)贊疫铜,點(diǎn)擊在看历帚,然后留言獲取
歡迎大家關(guān)注我的公眾號(hào)
小明的數(shù)據(jù)分析筆記本
小明的數(shù)據(jù)分析筆記本 公眾號(hào) 主要分享:1搪花、R語言和python做數(shù)據(jù)分析和數(shù)據(jù)可視化的簡單小例子盯桦;2拆内、園藝植物相關(guān)轉(zhuǎn)錄組學(xué)、基因組學(xué)归苍、群體遺傳學(xué)文獻(xiàn)閱讀筆記用狱;3、生物信息學(xué)入門學(xué)習(xí)資料及自己的學(xué)習(xí)筆記拼弃!