-
Notifications
You must be signed in to change notification settings - Fork 1
/
4.plot_results.R
53 lines (34 loc) · 1.54 KB
/
4.plot_results.R
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
library(topr)
library(dplyr)
## Requirements
# Please make sure -log10P values have been converted to raw P values before running this script
# See shell script `convert_-log10P.sh`
# Set working directory
setwd('/exports/igmm/eddie/GenScotDepression/users/poppy/aGWAS/cohorts/alspac/output')
# Read the list of ancestries (in ALSPAC we only have EUR)
ancestry_list <- c("EUR")
## Plot Manhattan
for (ancestry in ancestry_list) {
sumstats <- read.table(paste0("alspac_P_adoldep_", ancestry, ".regenie"), header = TRUE)
# NOTE: Cols may need renaming if not generated by regenie (require: CHROM, POS, P)
# Set working directory for plots
setwd('/exports/igmm/eddie/GenScotDepression/users/poppy/aGWAS/plots')
tiff(paste0("alspac_manhattan_plot_", ancestry, ".tiff"), width = 10, height = 6, units = "in", res = 300)
manhattan(df = filtered,
legend_labels = "",
sign_thresh = 5e-08,
sign_thresh_color = "black",
sign_thresh_label_size = 0,
ymax = 20, ymin = 3, scale = 0.8,
title = paste("ALSPAC (", ancestry, ")"))
dev.off()
}
## Plot QQ
for (ancestry in ancestry_list) {
sumstats <- read.table(paste0("alspac_P_adoldep_", ancestry, ".regenie"), header = TRUE)
setwd('/exports/igmm/eddie/GenScotDepression/users/poppy/aGWAS/plots')
tiff(paste0("alspac_qq_plot_", ancestry, ".tiff"), width=6, height=6, units="in", res=300)
qqtopr(sumstats, title=paste("ALSPAC (", ancestry, ")"))
dev.off()
}
###############################################################################