-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_Generating ASAT VAT and GFAT instruments.R
148 lines (142 loc) · 4.91 KB
/
1_Generating ASAT VAT and GFAT instruments.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
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
library(TwoSampleMR)
library(data.table)
library(dplyr)
#ASAT
out_dat<-fread("data/Measures_of_adiposity_Agrawal_2022/0321_asat_bgen_stats")
out_dat<-data.frame(out_dat)
exposure_dat<-format_data(
out_dat,
type = "exposure",
header = TRUE,
snp_col = "SNP",
beta_col = "BETA",
se_col = "SE",
eaf_col = "A1FREQ",
effect_allele_col = "ALLELE1",
other_allele_col = "ALLELE0"
)
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/ASAT.allSNPs")
exposure_dat <- subset(exposure_dat, pval.exposure<5e-8)
exposure_dat <- clump_data(exposure_dat,
clump_kb = 10000,
clump_r2 = 0.001,
clump_p1 = 0.00000005,
clump_p2 = 0.00000005,
pop = "EUR")
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/ASAT.uvinput")
#GFAT
out_dat<-fread("data/Measures_of_adiposity_Agrawal_2022/0321_gfat_bgen_stats")
out_dat<-data.frame(out_dat)
exposure_dat<-format_data(
out_dat,
type = "exposure",
header = TRUE,
snp_col = "SNP",
beta_col = "BETA",
se_col = "SE",
eaf_col = "A1FREQ",
effect_allele_col = "ALLELE1",
other_allele_col = "ALLELE0"
)
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/GFAT.allSNPs")
exposure_dat <- subset(exposure_dat, pval.exposure<5e-8)
exposure_dat <- clump_data(exposure_dat,
clump_kb = 10000,
clump_r2 = 0.001,
clump_p1 = 0.00000005,
clump_p2 = 0.00000005,
pop = "EUR")
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/GFAT.uvinput")
#VAT
out_dat<-fread("data/Measures_of_adiposity_Agrawal_2022/0321_vat_bgen_stats")
out_dat<-data.frame(out_dat)
exposure_dat<-format_data(
out_dat,
type = "exposure",
header = TRUE,
snp_col = "SNP",
beta_col = "BETA",
se_col = "SE",
eaf_col = "A1FREQ",
effect_allele_col = "ALLELE1",
other_allele_col = "ALLELE0"
)
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/VAT.allSNPs")
exposure_dat <- subset(exposure_dat, pval.exposure<5e-8)
exposure_dat <- clump_data(exposure_dat,
clump_kb = 10000,
clump_r2 = 0.001,
clump_p1 = 0.00000005,
clump_p2 = 0.00000005,
pop = "EUR")
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/VAT.uvinput")
#Female-specific
#ASAT
out_dat<-fread("data/Measures_of_adiposity_Agrawal_2022/0321_asat_Female_bgen_stats")
out_dat<-data.frame(out_dat)
exposure_dat<-format_data(
out_dat,
type = "exposure",
header = TRUE,
snp_col = "SNP",
beta_col = "BETA",
se_col = "SE",
eaf_col = "A1FREQ",
effect_allele_col = "ALLELE1",
other_allele_col = "ALLELE0"
)
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/ASAT_Female.allSNPs")
exposure_dat <- subset(exposure_dat, pval.exposure<5e-8)
exposure_dat <- clump_data(exposure_dat,
clump_kb = 10000,
clump_r2 = 0.001,
clump_p1 = 0.00000005,
clump_p2 = 0.00000005,
pop = "EUR")
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/ASAT_Female.uvinput")
#GFAT
out_dat<-fread("data/Measures_of_adiposity_Agrawal_2022/0321_gfat_Female_bgen_stats")
out_dat<-data.frame(out_dat)
exposure_dat<-format_data(
out_dat,
type = "exposure",
header = TRUE,
snp_col = "SNP",
beta_col = "BETA",
se_col = "SE",
eaf_col = "A1FREQ",
effect_allele_col = "ALLELE1",
other_allele_col = "ALLELE0"
)
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/GFAT_Female.allSNPs")
exposure_dat <- subset(exposure_dat, pval.exposure<5e-8)
exposure_dat <- clump_data(exposure_dat,
clump_kb = 10000,
clump_r2 = 0.001,
clump_p1 = 0.00000005,
clump_p2 = 0.00000005,
pop = "EUR")
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/GFAT_Female.uvinput")
#VAT
out_dat<-fread("data/Measures_of_adiposity_Agrawal_2022/0321_vat_Female_bgen_stats")
out_dat<-data.frame(out_dat)
exposure_dat<-format_data(
out_dat,
type = "exposure",
header = TRUE,
snp_col = "SNP",
beta_col = "BETA",
se_col = "SE",
eaf_col = "A1FREQ",
effect_allele_col = "ALLELE1",
other_allele_col = "ALLELE0"
)
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/VAT_Female.allSNPs")
exposure_dat <- subset(exposure_dat, pval.exposure<5e-8)
exposure_dat <- clump_data(exposure_dat,
clump_kb = 10000,
clump_r2 = 0.001,
clump_p1 = 0.00000005,
clump_p2 = 0.00000005,
pop = "EUR")
fwrite(exposure_dat,"data/Measures_of_adiposity_Agrawal_2022/VAT_Female.uvinput")