-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1. RACER_COLOC.Rmd
566 lines (422 loc) · 19.9 KB
/
1. RACER_COLOC.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
---
title: "Regional association plotting of ischemic stroke vs vertigo."
author: "[Sander W. van der Laan, PhD](https://swvanderlaan.github.io) | @swvanderlaan | [email protected]"
date: "`r Sys.Date()`"
output:
html_notebook:
cache: yes
code_folding: hide
collapse: yes
df_print: paged
fig.align: center
fig_caption: yes
fig_height: 6
fig_retina: 2
fig_width: 7
highlight: tango
theme: lumen
toc: yes
toc_float:
collapsed: no
smooth_scroll: yes
mainfont: Arial
subtitle: "A 'druggable-MI-targets' project"
editor_options:
chunk_output_type: inline
---
```{r global_options, include = FALSE}
# further define some knitr-options.
knitr::opts_chunk$set(fig.width = 12, fig.height = 8, fig.path = 'Figures/',
wwarning = TRUE, # show warnings during codebook generation
message = TRUE, # show messages during codebook generation
error = TRUE, # do not interrupt codebook generation in case of errors,
# usually better for debugging
echo = TRUE, # show R code
eval = TRUE)
ggplot2::theme_set(ggplot2::theme_minimal())
pander::panderOptions("table.split.table", Inf)
```
# Setup
We will clean the environment, setup the locations, define colors, and create a datestamp.
## Clean the environment
```{r echo = FALSE}
rm(list = ls())
```
## Set locations and working directories.
```{r LocalSystem, echo = FALSE}
### Operating System Version
### MacBook Pro
# ROOT_loc = "/Users/swvanderlaan"
### MacBook Air
ROOT_loc = "/Users/slaan3"
### Generic Locations
GENOMIC_loc = paste0(ROOT_loc, "/OneDrive - UMC Utrecht/Genomics")
STORAGE_loc = paste0(ROOT_loc, "/PLINK")
AEDB_loc = paste0(GENOMIC_loc, "/Athero-Express/AE-AAA_GS_DBs")
LAB_loc = paste0(GENOMIC_loc, "/LabBusiness")
PLINK_loc = paste0(STORAGE_loc,"")
AEGSQC_loc = paste0(PLINK_loc, "/_AE_ORIGINALS/AEGS_COMBINED_QC2018")
MICHIMP_loc=paste0(PLINK_loc,"/_AE_ORIGINALS/AEGS_COMBINED_EAGLE2_1000Gp3v5HRCr11")
GWAS_loc = paste0(PLINK_loc,"/_GWAS_Datasets")
PROJECT_loc = paste0(ROOT_loc, "/git/CirculatoryHealth/racer_coloc_tutorial")
RESULTS = paste0(ROOT_loc, "/git/CirculatoryHealth/racer_coloc_tutorial")
TARGET_loc = paste0(PROJECT_loc, "/targets")
### SOME VARIABLES WE NEED DOWN THE LINE
cat("\nDefining phenotypes and datasets.\n")
PROJECTNAME="RACER"
cat("\nCreate a new analysis directory, including subdirectories.\n")
# Analysis
ifelse(!dir.exists(file.path(RESULTS)),
dir.create(file.path(RESULTS)),
FALSE)
ANALYSIS_loc = paste0(RESULTS)
# Plots
ifelse(!dir.exists(file.path(ANALYSIS_loc, "/PLOTS")),
dir.create(file.path(ANALYSIS_loc, "/PLOTS")),
FALSE)
PLOT_loc = paste0(ANALYSIS_loc,"/PLOTS")
# QC plots
ifelse(!dir.exists(file.path(PLOT_loc, "/QC")),
dir.create(file.path(PLOT_loc, "/QC")),
FALSE)
QC_loc = paste0(PLOT_loc,"/QC")
# Output files
ifelse(!dir.exists(file.path(ANALYSIS_loc, "/OUTPUT")),
dir.create(file.path(ANALYSIS_loc, "/OUTPUT")),
FALSE)
OUT_loc = paste0(ANALYSIS_loc, "/OUTPUT")
cat("\nSetting working directory and listing its contents.\n")
setwd(paste0(RESULTS))
getwd()
list.files()
```
## Package-installation function.
```{r}
source(paste0(PROJECT_loc, "/scripts/functions.R"))
```
## Load those packages
```{r loading_packages, message=FALSE, warning=FALSE}
install.packages.auto("readr")
install.packages.auto("optparse")
install.packages.auto("tools")
install.packages.auto("dplyr")
install.packages.auto("tidyr")
install.packages.auto("naniar")
install.packages.auto("pander")
install.packages.auto("R.utils")
# To get 'data.table' with 'fwrite' to be able to directly write gzipped-files
# Ref: https://stackoverflow.com/questions/42788401/is-possible-to-use-fwrite-from-data-table-with-gzfile
# install.packages("data.table", repos = "https://Rdatatable.gitlab.io/data.table")
library(data.table)
install.packages.auto("tidyverse")
install.packages.auto("knitr")
install.packages.auto("DT")
install.packages.auto("eeptools")
install.packages.auto("haven")
install.packages.auto("tableone")
install.packages.auto("BlandAltmanLeh")
# Install the devtools package from Hadley Wickham
install.packages.auto('devtools')
library(devtools)
# for plotting
install.packages.auto("pheatmap")
install.packages.auto("forestplot")
install.packages.auto("ggplot2")
install.packages.auto("ggpubr")
install.packages.auto("ggrepel")
install.packages.auto("UpSetR")
devtools::install_github("thomasp85/patchwork")
# For regional association plots
install_github("oliviasabik/RACER")
# install coloc
if(!require("remotes"))
install.packages("remotes") # if necessary
library(remotes)
install_github("chr1swallace/coloc@main",build_vignettes=TRUE)
# Install ggrepel package if needed
library(ggrepel)
# install ggsci
install.packages.auto("ggsci")
# plotly
# install.packages.auto("plotly")
```
## Utrecht Science Park Colour Scheme
We will create a datestamp and define the Utrecht Science Park Colour Scheme
```{r Setting: Colors}
Today = format(as.Date(as.POSIXlt(Sys.time())), "%Y%m%d")
Today.Report = format(as.Date(as.POSIXlt(Sys.time())), "%A, %B %d, %Y")
### UtrechtScienceParkColoursScheme
###
### WebsitetoconvertHEXtoRGB:http://hex.colorrrs.com.
### Forsomefunctionsyoushoulddividethesenumbersby255.
###
### No. Color HEX (RGB) CHR MAF/INFO
###---------------------------------------------------------------------------------------
### 1 yellow #FBB820 (251,184,32) => 1 or 1.0>INFO
### 2 gold #F59D10 (245,157,16) => 2
### 3 salmon #E55738 (229,87,56) => 3 or 0.05<MAF<0.2 or 0.4<INFO<0.6
### 4 darkpink #DB003F ((219,0,63) => 4
### 5 lightpink #E35493 (227,84,147) => 5 or 0.8<INFO<1.0
### 6 pink #D5267B (213,38,123) => 6
### 7 hardpink #CC0071 (204,0,113) => 7
### 8 lightpurple #A8448A (168,68,138) => 8
### 9 purple #9A3480 (154,52,128) => 9
### 10 lavendel #8D5B9A (141,91,154) => 10
### 11 bluepurple #705296 (112,82,150) => 11
### 12 purpleblue #686AA9 (104,106,169) => 12
### 13 lightpurpleblue #6173AD (97,115,173/101,120,180) => 13
### 14 seablue #4C81BF (76,129,191) => 14
### 15 skyblue #2F8BC9 (47,139,201) => 15
### 16 azurblue #1290D9 (18,144,217) => 16 or 0.01<MAF<0.05 or 0.2<INFO<0.4
### 17 lightazurblue #1396D8 (19,150,216) => 17
### 18 greenblue #15A6C1 (21,166,193) => 18
### 19 seaweedgreen #5EB17F (94,177,127) => 19
### 20 yellowgreen #86B833 (134,184,51) => 20
### 21 lightmossgreen #C5D220 (197,210,32) => 21
### 22 mossgreen #9FC228 (159,194,40) => 22 or MAF>0.20 or 0.6<INFO<0.8
### 23 lightgreen #78B113 (120,177,19) => 23/X
### 24 green #49A01D (73,160,29) => 24/Y
### 25 grey #595A5C (89,90,92) => 25/XY or MAF<0.01 or 0.0<INFO<0.2
### 26 lightgrey #A2A3A4 (162,163,164) => 26/MT
###
### ADDITIONAL COLORS
### 27 midgrey #D7D8D7
### 28 verylightgrey #ECECEC"
### 29 white #FFFFFF
### 30 black #000000
###----------------------------------------------------------------------------------------------
uithof_color = c("#FBB820","#F59D10","#E55738","#DB003F","#E35493","#D5267B",
"#CC0071","#A8448A","#9A3480","#8D5B9A","#705296","#686AA9",
"#6173AD","#4C81BF","#2F8BC9","#1290D9","#1396D8","#15A6C1",
"#5EB17F","#86B833","#C5D220","#9FC228","#78B113","#49A01D",
"#595A5C","#A2A3A4", "#D7D8D7", "#ECECEC", "#FFFFFF", "#000000")
uithof_color_legend = c("#FBB820", "#F59D10", "#E55738", "#DB003F", "#E35493",
"#D5267B", "#CC0071", "#A8448A", "#9A3480", "#8D5B9A",
"#705296", "#686AA9", "#6173AD", "#4C81BF", "#2F8BC9",
"#1290D9", "#1396D8", "#15A6C1", "#5EB17F", "#86B833",
"#C5D220", "#9FC228", "#78B113", "#49A01D", "#595A5C",
"#A2A3A4", "#D7D8D7", "#ECECEC", "#FFFFFF", "#000000")
### ----------------------------------------------------------------------------
```
## Setting the NPG colors
```{r}
library("scales")
pal_npg("nrc")(10)
show_col(pal_npg("nrc")(10))
# show_col(pal_npg("nrc", alpha = 0.6)(10))
```
# Introduction
Vertigo, dizziness, is a symptom that can be caused by a variety of diseases and conditions[add REF1](). These include:
- benign paroxysmal positional vertigo (BPPV), where certain head movements trigger vertigo
- migraine, i.e. severe headaches with temporary vision loss and auras
- labyrinthitis (Lab), an inner ear infection
- vestibular neuronitis (VN), inflammation of the vestibular nerve, which runs into the inner ear and sends messages to the brain that help to control balance
- ischemic stroke
Vertigo symptoms and migraine are both associated with increased risk of ischemic stroke[add REF2]().
An outstanding question remains: whether this is merely an observation confounded by overlapping risk factors, or whether there is a causal link.
Here we set out to investigate the overlap between clinical atherosclerosis (including ischemic stroke subphenotypes, carotid IMT, TIA, and retinal infarction), BPPV, labyrinthitis, vestibular neuronitis, and migraine.
## Methods
### Summary statistics
We will include genome-wide association study (GWAS) summary statistics from the following sources.
Phenotype | Description | Link | Publication
--------------------------- | --------------------------- | --------------------------- | ---------------------------
Vertigo | includes BPPV, labyrinthitis, and vestibular neuronitis | [deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
BPPV | Benign paroxysmal positional vertigo[deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
Lab | Labyrinthitis[deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
VN | Vestibular neuronitis [deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
Migraine | migraine [deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
Carotid IMT (cIMT) | [deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
Ischemic stroke (IS) | [deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
Large artery stroke (LAS) | [deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
Small vessel disease (SVD) | [deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
Cardioembolic stroke (CES) | [deCODE](https://www.decode.com/summarydata/) | [Skuladottir, A.T. ea (2021)](https://www.nature.com/articles/s42003-021-02673-2)
### Identification of top loci
Some of these GWAS identified and published top (lead) loci, for others these are not identified and we need the clump these.
- list top loci from publication
- clump for the remaining GWAS
### Regional association plotting
### Colocalization
### PolarMorphism
# Results
## GWAS SumStats
We need to load and harmonize the data against 1000G phase 3.
```{r}
# when we need to load the data
# gwas_sumstats <- readRDS(file = paste0(OUT_loc, "/gwas_sumstats_complete.rds"))
gwas_t2d <- fread(paste0(GWAS_loc,"/_cojo/rsid/T2D.cojo.gz"),
showProgress = TRUE)
gwas_cad <- fread(paste0(GWAS_loc,"/_cojo/rsid/CAD.cojo.gz"),
showProgress = TRUE)
gwas_as <- fread(paste0(GWAS_loc,"/_cojo/rsid/AS.cojo.gz"),
showProgress = TRUE)
gwas_cimt <- fread(paste0(GWAS_loc,"/_cojo/rsid/CIMT.cojo.gz"),
showProgress = TRUE)
```
```{r}
saveRDS(gwas_t2d, file = paste0(OUT_loc, "/gwas_sumstats_t2d.rds"))
saveRDS(gwas_cad, file = paste0(OUT_loc, "/gwas_sumstats_cad.rds"))
saveRDS(gwas_as, file = paste0(OUT_loc, "/gwas_sumstats_as.rds"))
saveRDS(gwas_cimt, file = paste0(OUT_loc, "/gwas_sumstats_cimt.rds"))
rm(gwas_t2d, gwas_cad, gwas_as, gwas_cimt)
```
```{r}
gwas_cad_racert <- subset(gwas_cad,
select = c("SNP", "p"))
gwas_as_racert <- subset(gwas_as,
select = c("SNP", "p"))
gwas_cimt_racert <- subset(gwas_cimt,
select = c("SNP", "p"))
rm(gwas_t2d, gwas_cad, gwas_as, gwas_cimt)
```
```{r}
# ref_1kGp3 <- fread(paste0(PLINK_loc, "/references/1kGp3.nonbia.sumstats.newids.chrbp.txt.gz"),
# showProgress = TRUE)
# saveRDS(ref_1kGp3, file = paste0(OUT_loc, "/1kGp3.nonbia.sumstats.newids.chrbp.rds"))
ref_1kGp3 <- readRDS(file = paste0(OUT_loc, "/1kGp3.nonbia.sumstats.newids.chrbp.rds"))
```
```{r}
gwas_t2d <- readRDS(paste0(OUT_loc, "/gwas_sumstats_t2d.rds"))
gwas_t2d_racert <- subset(gwas_t2d,
select = c("SNP", "p"))
rm(gwas_t2d)
gwas_t2d_racer <- merge(gwas_t2d_racert, ref_1kGp3, by.x = "SNP", by.y = "ID",
all.x = TRUE, sort = FALSE)
rm(gwas_t2d_racert)
saveRDS(gwas_t2d_racer, file = paste0(OUT_loc, "/gwas_t2d_racer.rds"))
# gwas_t2d_racer <- readRDS(paste0(OUT_loc, "/gwas_t2d_racer.rds"))
```
```{r}
rm(ref_1kGp3)
```
## Identification of top loci
### Clumping
### Summary of top loci
## Regional association plotting
We will create regional association plots for all the top loci for future reference.
```{r}
library(RACER)
# Make directory for plots
ifelse(!dir.exists(file.path(PROJECT_loc, "/RACER")),
dir.create(file.path(PROJECT_loc, "/RACER")),
FALSE)
RACER_loc = paste0(PROJECT_loc,"/RACER")
ifelse(!dir.exists(file.path(RACER_loc, "/AS")),
dir.create(file.path(RACER_loc, "/AS")),
FALSE)
AS_RACER_loc = paste0(RACER_loc,"/AS")
for(GENE in targets_t2d_vs_as){
cat(paste0("Getting data for ", GENE,".\n"))
target=GENE
tempCHR <- subset(T2Dmagma, SYMBOL == target)$CHR
tempSTART <- subset(T2Dmagma, SYMBOL == target)$START
tempEND <- subset(T2Dmagma, SYMBOL == target)$STOP
tempENSEMBLnr <- subset(T2Dmagma, SYMBOL == target)$GENE
cat("\nSubset required data.\n")
temp <- subset(gwas_t2d_racer, CHROM == tempCHR & (POS >= tempSTART & POS <= tempEND))
temp_as <- subset(gwas_as_racer, CHROM == tempCHR & (POS >= tempSTART & POS <= tempEND))
temp$CHROM <- as.numeric(temp$CHROM)
temp$POS <- as.numeric(temp$POS)
temp$p <- as.numeric(temp$p)
cat("\nFormatting association data.\n")
temp_f = RACER::formatRACER(assoc_data = temp, chr_col = 3, pos_col = 4, p_col = 2)
temp_as_f = RACER::formatRACER(assoc_data = temp_as, chr_col = 3, pos_col = 4, p_col = 2)
cat("\nGetting LD data.\n")
temp_f_ld = RACER::ldRACER(assoc_data = temp_f, rs_col = 1, pops = "EUR", auto_snp = TRUE)
lead_variant <- subset(temp_f_ld, LABEL == "LEAD")$RS_ID
temp_as_f_ld = RACER::ldRACER(assoc_data = temp_as_f, rs_col = 1, pops = "EUR", lead_snp = lead_variant)
cat(paste0("\nPlotting region surrounding ", GENE," on ",tempCHR,":",tempSTART,"-",tempEND,".\n"))
p1 <- mirrorPlotRACER(assoc_data1 = temp_f_ld,
assoc_data2 = temp_as_f_ld, chr = tempCHR,
plotby = "coord", start_plot = tempSTART, end_plot = tempEND,
# name1 = paste0("Type 2 Diabetes (", lead_variant,")"),
name1 = "Type 2 Diabetes",
name2 = "All stroke",
label_lead = TRUE)
print(p1 )
cat(paste0("Saving image for ", GENE,".\n"))
ggsave(filename = paste0(AS_RACER_loc, "/", tempENSEMBLnr, ".", Today, ".",GENE,".regional_assoc.t2d_vs_as.png"), plot = last_plot())
ggsave(filename = paste0(AS_RACER_loc, "/", tempENSEMBLnr, ".", Today, ".",GENE,".regional_assoc.t2d_vs_as.pdf"), plot = last_plot())
ggsave(filename = paste0(AS_RACER_loc, "/", tempENSEMBLnr, ".", Today, ".",GENE,".regional_assoc.t2d_vs_as.eps"), plot = last_plot())
# rm(temp, p1,
# temp_f, temp_f_ld,
# tempCHR, tempSTART, tempEND,
# tempENSEMBLnr,
# temp_as, temp_as_f, temp_as_f_ld,
# GENE)
}
```
## Colocalization
```{r}
library(RACER)
# Make directory for plots
ifelse(!dir.exists(file.path(PROJECT_loc, "/RACER")),
dir.create(file.path(PROJECT_loc, "/RACER")),
FALSE)
RACER_loc = paste0(PROJECT_loc,"/RACER")
ifelse(!dir.exists(file.path(RACER_loc, "/AS")),
dir.create(file.path(RACER_loc, "/AS")),
FALSE)
AS_RACER_loc = paste0(RACER_loc,"/AS")
for(GENE in targets_t2d_vs_as){
cat(paste0("Getting data for ", GENE,".\n"))
target=GENE
tempCHR <- subset(T2Dmagma, SYMBOL == target)$CHR
tempSTART <- subset(T2Dmagma, SYMBOL == target)$START
tempEND <- subset(T2Dmagma, SYMBOL == target)$STOP
tempENSEMBLnr <- subset(T2Dmagma, SYMBOL == target)$GENE
cat("\nSubset required data.\n")
temp <- subset(gwas_t2d_racer, CHROM == tempCHR & (POS >= tempSTART & POS <= tempEND))
temp_as <- subset(gwas_as_racer, CHROM == tempCHR & (POS >= tempSTART & POS <= tempEND))
temp$CHROM <- as.numeric(temp$CHROM)
temp$POS <- as.numeric(temp$POS)
temp$p <- as.numeric(temp$p)
cat("\nFormatting association data.\n")
temp_f = RACER::formatRACER(assoc_data = temp, chr_col = 3, pos_col = 4, p_col = 2)
temp_as_f = RACER::formatRACER(assoc_data = temp_as, chr_col = 3, pos_col = 4, p_col = 2)
cat("\nGetting LD data.\n")
temp_f_ld = RACER::ldRACER(assoc_data = temp_f, rs_col = 1, pops = "EUR", auto_snp = TRUE)
lead_variant <- subset(temp_f_ld, LABEL == "LEAD")$RS_ID
temp_as_f_ld = RACER::ldRACER(assoc_data = temp_as_f, rs_col = 1, pops = "EUR", lead_snp = lead_variant)
cat(paste0("\nPlotting region surrounding ", GENE," on ",tempCHR,":",tempSTART,"-",tempEND,".\n"))
p1 <- mirrorPlotRACER(assoc_data1 = temp_f_ld,
assoc_data2 = temp_as_f_ld, chr = tempCHR,
plotby = "coord", start_plot = tempSTART, end_plot = tempEND,
# name1 = paste0("Type 2 Diabetes (", lead_variant,")"),
name1 = "Type 2 Diabetes",
name2 = "All stroke",
label_lead = TRUE)
print(p1 )
cat(paste0("Saving image for ", GENE,".\n"))
ggsave(filename = paste0(AS_RACER_loc, "/", tempENSEMBLnr, ".", Today, ".",GENE,".regional_assoc.t2d_vs_as.png"), plot = last_plot())
ggsave(filename = paste0(AS_RACER_loc, "/", tempENSEMBLnr, ".", Today, ".",GENE,".regional_assoc.t2d_vs_as.pdf"), plot = last_plot())
ggsave(filename = paste0(AS_RACER_loc, "/", tempENSEMBLnr, ".", Today, ".",GENE,".regional_assoc.t2d_vs_as.eps"), plot = last_plot())
# rm(temp, p1,
# temp_f, temp_f_ld,
# tempCHR, tempSTART, tempEND,
# tempENSEMBLnr,
# temp_as, temp_as_f, temp_as_f_ld,
# GENE)
}
```
## PolarMorphism
# Discussion and Conclusions
# Session information
------
Version: v1.0.0
Last update: 2022-03-08
Written by: Sander W. van der Laan (s.w.vanderlaan-2[at]umcutrecht.nl).
Description: Script to create plot regional association plots, coloc and Polarmorphism.
Minimum requirements: R version 3.4.3 (2017-06-30) -- 'Single Candle', Mac OS X El Capitan
Changes log
* v1.0.0 Initial version.
------
```{r eval = TRUE}
sessionInfo()
```
# Saving environment
```{r Saving}
save.image(paste0(PROJECT_loc, "/",Today,".",PROJECTNAME,".RACER_COLOC.RData"))
```
------
<sup>© 1979-2022 Sander W. van der Laan | s.w.vanderlaan[at]gmail.com | [swvanderlaan.github.io](https://swvanderlaan.github.io).</sup>
------