├── data
├── Instruments.xlsx
└── outcome.id.txt
├── scripts
└── MR-pQTL-script.R
└── README.md
/data/Instruments.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MRCIEU/epigraphdb-pqtl/HEAD/data/Instruments.xlsx
--------------------------------------------------------------------------------
/scripts/MR-pQTL-script.R:
--------------------------------------------------------------------------------
1 | #########################################
2 | #MR pQTL analysis script -- Jie Zheng #
3 | #########################################
4 |
5 | ###install the Two sample MR package (just need do this once)
6 | ##source("https://bioconductor.org/biocLite.R")
7 | #install.packages("devtools")
8 |
9 | ##to update the R package (once there is a )
10 | #library(devtools)
11 | #install_github("MRCIEU/TwoSampleMR")
12 |
13 | #example of use the older version of the package
14 | #devtools::install_github("MRCIEU/TwoSampleMR@0.3.2")
15 |
16 | ##call necessary libraries
17 | library(TwoSampleMR)
18 | #library(MRInstruments)
19 | library("readxl") #plesae install the package
20 | rm(list=ls(all=TRUE))
21 |
22 | ##setup your working folder
23 | setwd("/your/working/folder/")
24 |
25 | ##read in the exposure data from a file
26 | Ins<-data <- read_excel("./data/Instruments.xlsx",1)
27 |
28 | Ins<-format_data(Ins, type = "exposure", header = TRUE,
29 | phenotype_col = "Phenotype", snp_col = "SNP", beta_col = "beta",
30 | se_col = "se", eaf_col = "eaf", effect_allele_col = "effect_allele",
31 | other_allele_col = "other_allele", pval_col = "pval")
32 |
33 |
34 | ##read in the outcome data
35 | ao<-available_outcomes(access_token=NULL)
36 |
37 | ids<-as.character(unlist(read.table("./data/outcome.id.txt",header=F)))
38 |
39 | outcome_dat<- extract_outcome_data(
40 | snps = Ins$SNP,
41 | outcomes = ids)
42 |
43 | ##harmonise the exposure and outcome data
44 | dat <- NULL
45 | dat <- harmonise_data(
46 | exposure_dat = Ins,
47 | outcome_dat = outcome_dat
48 | )
49 |
50 | ##run the MR and sensitivity analyses
51 | mr_results <- NULL
52 | mr_hetero <- NULL
53 | mr_pleio <- NULL
54 | mr_single <- NULL
55 | try(mr_results <- mr(dat, method_list=c("mr_wald_ratio", "mr_ivw"))) # main MR analysis
56 | mr_hetero <- mr_heterogeneity(dat) # heterogeneity test across instruments
57 | mr_pleio <- mr_pleiotropy_test(dat) # MR-Egger intercept test
58 | try(mr_single <- mr_singlesnp(dat)) #single SNP MR using Wald ratio
59 |
60 | ##save the MR results
61 | exposure <- "pQTL-combined"
62 | result_file0 <- paste0("./your/results/folder/",exposure,".harmonise.txt")
63 | result_file <- paste0("./your/results/folder/",exposure,".mr.txt")
64 | result_file2 <- paste0("./your/results/folder/",exposure,".mr_hetero.txt")
65 | result_file3 <- paste0("./your/results/folder/",exposure,".mr_pleio.txt")
66 | result_file4 <- paste0("./your/results/folder/",exposure,".mr_single.txt")
67 | if (exists("dat")==TRUE){ write.table(dat,file=result_file0,sep="\t",col.names=T,row.names=F,quote=F)}
68 | if (exists("mr_results")==TRUE){ write.table(mr_results,file=result_file,sep="\t",col.names=T,row.names=F,quote=F)}
69 | if (exists("mr_hetero")==TRUE){ write.table(mr_hetero,file=result_file2,sep="\t",col.names=T,row.names=F,quote=F)}
70 | if (exists("mr_pleio")==TRUE){write.table(mr_pleio,file=result_file3,sep="\t",col.names=T,row.names=F,quote=F)}
71 | if (exists("mr_single")==TRUE){write.table(mr_single,file=result_file4,sep="\t",col.names=T,row.names=F,quote=F)}
72 |
73 |
74 |
--------------------------------------------------------------------------------
/data/outcome.id.txt:
--------------------------------------------------------------------------------
1 | 7
2 | 12
3 | 16
4 | 22
5 | 23
6 | 29
7 | 89
8 | 113
9 | 114
10 | 115
11 | 116
12 | 117
13 | 270
14 | 271
15 | 272
16 | 273
17 | 274
18 | 275
19 | 279
20 | 282
21 | 285
22 | 287
23 | 294
24 | 297
25 | 299
26 | 300
27 | 301
28 | 302
29 | 756
30 | 758
31 | 769
32 | 770
33 | 771
34 | 773
35 | 775
36 | 784
37 | 798
38 | 801
39 | 803
40 | 815
41 | 816
42 | 822
43 | 833
44 | 837
45 | 961
46 | 965
47 | 966
48 | 967
49 | 970
50 | 975
51 | 977
52 | 980
53 | 982
54 | 996
55 | 999
56 | 1000
57 | 1004
58 | 1005
59 | 1006
60 | 1007
61 | 1008
62 | 1009
63 | 1013
64 | 1025
65 | 1029
66 | 1041
67 | 1042
68 | 1043
69 | 1044
70 | 1045
71 | 1046
72 | 1047
73 | 1048
74 | 1049
75 | 1050
76 | 1051
77 | 1052
78 | 1055
79 | 1058
80 | 1081
81 | 1084
82 | 1086
83 | 1095
84 | 1097
85 | 1098
86 | 1102
87 | 1105
88 | 1106
89 | 1107
90 | 1108
91 | 1109
92 | 1110
93 | 1111
94 | 1112
95 | 1120
96 | 1126
97 | 1127
98 | 1128
99 | 1183
100 | 1185
101 | 1186
102 | 1188
103 | 1189
104 | UKB-a:248
105 | UKB-a:249
106 | UKB-a:25
107 | UKB-a:333
108 | UKB-a:334
109 | UKB-a:335
110 | UKB-a:336
111 | UKB-a:337
112 | UKB-a:359
113 | UKB-a:360
114 | UKB-a:363
115 | UKB-a:367
116 | UKB-a:500
117 | UKB-a:521
118 | UKB-a:556
119 | UKB-a:569
120 | UKB-a:572
121 | UKB-a:577
122 | UKB-a:578
123 | UKB-a:580
124 | UKB-a:9
125 | UKB-b:10093
126 | UKB-b:10098
127 | UKB-b:10181
128 | UKB-b:10224
129 | UKB-b:10555
130 | UKB-b:10668
131 | UKB-b:10753
132 | UKB-b:10846
133 | UKB-b:10859
134 | UKB-b:10903
135 | UKB-b:10912
136 | UKB-b:11144
137 | UKB-b:11161
138 | UKB-b:11210
139 | UKB-b:11261
140 | UKB-b:11282
141 | UKB-b:11411
142 | UKB-b:11450
143 | UKB-b:11501
144 | UKB-b:11582
145 | UKB-b:11601
146 | UKB-b:11664
147 | UKB-b:11751
148 | UKB-b:11771
149 | UKB-b:11849
150 | UKB-b:11857
151 | UKB-b:12040
152 | UKB-b:1216
153 | UKB-b:1228
154 | UKB-b:12517
155 | UKB-b:12547
156 | UKB-b:12604
157 | UKB-b:12722
158 | UKB-b:12849
159 | UKB-b:12930
160 | UKB-b:12944
161 | UKB-b:13251
162 | UKB-b:13464
163 | UKB-b:13535
164 | UKB-b:13545
165 | UKB-b:13704
166 | UKB-b:13731
167 | UKB-b:13745
168 | UKB-b:1392
169 | UKB-b:14027
170 | UKB-b:14177
171 | UKB-b:14180
172 | UKB-b:14356
173 | UKB-b:14416
174 | UKB-b:14436
175 | UKB-b:14486
176 | UKB-b:14490
177 | UKB-b:14500
178 | UKB-b:14814
179 | UKB-b:14956
180 | UKB-b:14999
181 | UKB-b:15003
182 | UKB-b:15025
183 | UKB-b:15099
184 | UKB-b:15136
185 | UKB-b:15198
186 | UKB-b:15251
187 | UKB-b:15521
188 | UKB-b:15622
189 | UKB-b:15660
190 | UKB-b:15685
191 | UKB-b:15790
192 | UKB-b:15904
193 | UKB-b:15946
194 | UKB-b:16048
195 | UKB-b:16074
196 | UKB-b:16207
197 | UKB-b:16208
198 | UKB-b:16326
199 | UKB-b:16357
200 | UKB-b:16423
201 | UKB-b:16426
202 | UKB-b:1668
203 | UKB-b:16778
204 | UKB-b:16781
205 | UKB-b:16858
206 | UKB-b:16868
207 | UKB-b:17049
208 | UKB-b:17149
209 | UKB-b:17174
210 | UKB-b:17239
211 | UKB-b:17241
212 | UKB-b:17324
213 | UKB-b:17400
214 | UKB-b:17417
215 | UKB-b:17507
216 | UKB-b:17677
217 | UKB-b:17743
218 | UKB-b:17787
219 | UKB-b:17992
220 | UKB-b:18113
221 | UKB-b:18194
222 | UKB-b:18275
223 | UKB-b:18279
224 | UKB-b:18349
225 | UKB-b:18368
226 | UKB-b:18433
227 | UKB-b:1853
228 | UKB-b:18587
229 | UKB-b:18951
230 | UKB-b:18994
231 | UKB-b:19063
232 | UKB-b:19094
233 | UKB-b:19110
234 | UKB-b:19354
235 | UKB-b:1936
236 | UKB-b:19391
237 | UKB-b:19651
238 | UKB-b:1968
239 | UKB-b:19719
240 | UKB-b:19732
241 | UKB-b:19749
242 | UKB-b:20045
243 | UKB-b:20078
244 | UKB-b:20189
245 | UKB-b:20213
246 | UKB-b:20226
247 | UKB-b:20233
248 | UKB-b:20289
249 | UKB-b:20401
250 | UKB-b:20426
251 | UKB-b:20464
252 | UKB-b:20544
253 | UKB-b:2149
254 | UKB-b:222
255 | UKB-b:2319
256 | UKB-b:2561
257 | UKB-b:266
258 | UKB-b:2964
259 | UKB-b:3027
260 | UKB-b:3033
261 | UKB-b:3229
262 | UKB-b:3251
263 | UKB-b:3596
264 | UKB-b:3602
265 | UKB-b:3770
266 | UKB-b:379
267 | UKB-b:3965
268 | UKB-b:443
269 | UKB-b:4637
270 | UKB-b:4674
271 | UKB-b:4921
272 | UKB-b:50
273 | UKB-b:5018
274 | UKB-b:5188
275 | UKB-b:531
276 | UKB-b:5510
277 | UKB-b:5590
278 | UKB-b:5712
279 | UKB-b:5815
280 | UKB-b:5839
281 | UKB-b:5936
282 | UKB-b:6073
283 | UKB-b:6191
284 | UKB-b:6413
285 | UKB-b:6458
286 | UKB-b:6514
287 | UKB-b:6519
288 | UKB-b:652
289 | UKB-b:6998
290 | UKB-b:7444
291 | UKB-b:7449
292 | UKB-b:7469
293 | UKB-b:7534
294 | UKB-b:7872
295 | UKB-b:800
296 | UKB-b:8085
297 | UKB-b:8184
298 | UKB-b:8194
299 | UKB-b:8201
300 | UKB-b:8229
301 | UKB-b:8297
302 | UKB-b:8476
303 | UKB-b:8618
304 | UKB-b:8707
305 | UKB-b:8720
306 | UKB-b:8749
307 | UKB-b:8777
308 | UKB-b:8837
309 | UKB-b:8942
310 | UKB-b:8961
311 | UKB-b:9050
312 | UKB-b:918
313 | UKB-b:9306
314 | UKB-b:9536
315 | UKB-b:9591
316 | UKB-b:9856
317 | UKB-b:9873
318 | UKB-b:9981
319 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EpiGraphDB pQTL MR project repository
2 | This is the GitHub repository to provide all information, news and updates of the EpiGraphDB pQTL MR project, which is a phenome-wide Mendelian randomization study of the plasma proteome.
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
15 | [`epigraphdb-pqtl`](https://github.com/MRCIEU/epigraphdb-pqtl/) is a GitHub repo to provide the following information:
16 | 1. news and updates of the EpiGraphDB pQTL project, and issue reporting functionality for users.
17 | 2. easy to use R scripts to run MR and colocalization analysis for the pQTL MR project.
18 |
19 | The MR and colocalization analyses results from the EpiGraphDB pQTL project have been pre-calculated and stored in the [EpiGraphDB Proteome PheWAS browser](https://epigraphdb.org/pqtl/).
20 |
21 | ## Installation of related R packages
22 |
23 | The scripts in this repository require the following dependencies to be installed:
24 |
25 | [`devtools`](https://devtools.r-lib.org/)
26 | is required to install from github:
27 |
28 | ```r
29 | ###install the Two sample MR package (just need do this once)
30 | source("https://bioconductor.org/biocLite.R")
31 | install.packages("devtools")
32 |
33 | ##to install/update the R package (once there is a )
34 | library(devtools)
35 | install_github("MRCIEU/TwoSampleMR")
36 |
37 | #example of use the older version of the package
38 | devtools::install_github("MRCIEU/TwoSampleMR@0.3.2")
39 | ```
40 |
41 | ## Run pQTL MR analysis
42 |
43 | `epigraphdb-pqtl` provides a simple and intuitive way to run pQTL MR analysis using the "TwoSampleMR" R package
44 |
45 | For more information on how to run the MR analysis, please check out R script `MR-pQTL-script.R`
46 |
47 | ## EpiGraphDB pQTL PheWAS browser
48 |
49 | The [EpiGraphDB Proteome PheWAS browser](https://epigraphdb.org/pqtl/) currently contains the Mendelian randomization and sensitivity analyses results for 989 proteins and 225 traits, i.e. diseases and risk factors. To start using this browser, simply type a protein or trait name into the "search" field, for example, [ADAM19](https://epigraphdb.org/pqtl/ADAM19) or [Lung cancer](https://epigraphdb.org/pqtl/Lung%20cancer). The full list of proteins can be found by following the link on top of the "search" field.
50 |
51 | ## Citation
52 |
53 | Please cite the pQTL MR analysis as
54 |
55 | > Phenome-wide Mendelian randomization mapping the influence of the plasma proteome on complex diseases
56 |
57 | > Jie Zheng, Valeriia Haberland, Denis Baird, Venexia Walker, Philip C. Haycock, Mark R. Hurle, Alex Gutteridge, Pau Erola, Yi Liu, Shan Luo, Jamie Robinson, Tom G. Richardson, James R. Staley, Benjamin Elsworth, Stephen Burgess, Benjamin B. Sun, John Danesh, Heiko Runz, Joseph C. Maranville, Hannah M. Martin, James Yarmolinsky, Charles Laurin, Michael V. Holmes, Jimmy Z. Liu, Karol Estrada, Rita Santos, Linda McCarthy, Dawn Waterworth, Matthew R. Nelson, George Davey Smith, Adam S. Butterworth, Gibran Hemani, Robert A. Scott and Tom R. Gaunt Phenome-wide Mendelian randomization mapping the influence of the plasma proteome on complex diseases. Nature Genetics. 52, pages1122–1131 (2020)
58 |
59 | ```
60 | @article {pQTL MR paper,
61 | author = {Jie Zheng, Valeriia Haberland, Denis Baird, Venexia M Walker, Philip M Haycock, Alex X Gutteridge, Tom M Richardson, James Staley, Benjamin Elsworth, Stephen Burgess, Benjamin B Sun, John Danesh, Heiko Runz, Joseph C Maranville, Hannah Martin, James Yarmolinsky, Charles Laurin, Michael V Holmes, Jimmy Liu, Karol Estrada, Linda C McCarthy, Mark Hurle, Dawn M Waterworth, Matthew R Nelson, Adam S Butterworth, George Davey Smith, Gibran V Hemani, Robert A Scott, Tom R Gaunt},
62 | title = {Phenome-wide Mendelian randomization mapping the influence of the plasma proteome on complex diseases},
63 | url = {https://www.nature.com/articles/s41588-020-0682-6}
64 | }
65 | ```
66 |
67 | ## Contact
68 |
69 | Please get in touch with us for issues, comments, suggestions, etc. via the following methods:
70 |
71 | - [The issue tracker on the `epigrapdb-pqtl` repo](https://github.com/MRCIEU/epigraphdb-pqtl/issues)
72 | - [The support email](mailto:feedback@epigraphdb.org)
73 | - [The EpiGraphDB twitter](https://twitter.com/epigraphdb)
74 |
--------------------------------------------------------------------------------