-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path8_Filtering meta-analysis results.R
82 lines (75 loc) · 3.79 KB
/
8_Filtering meta-analysis 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
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
#Used equation from supplementary note of this paper - https://www.nature.com/articles/ng.3538#MOESM39 to estimate effects from Z scores
library(data.table)
library(dplyr)
#Liver cancer
meta1<-fread("data/Obesity_related_cancer_GWAS/Liver_cancer/Meta_analysis_Liver_cancer_GWAS1.csv")
meta2<-fread("data/Obesity_related_cancer_GWAS/Liver_cancer/Meta_analysis_Liver_cancer_GWAS_GC1.csv")
meta1<-select(meta1,-c("Effect","StdErr"))
meta2<-select(meta2,MarkerName,Effect,StdErr)
meta<-merge(meta1,meta2,by="MarkerName")
meta<-meta[meta$HetPVal>0.05,]
meta$beta<-meta$Effect
meta$se<-meta$StdErr
meta$Allele1<-toupper(meta$Allele1)
meta$Allele2<-toupper(meta$Allele2)
fwrite(meta,"data/Obesity_related_cancer_GWAS/Liver_cancer/Meta_analysis_Liver_cancer_GWAS_formatted.csv")
#Gallbladder
meta1<-fread("data/Obesity_related_cancer_GWAS/Gallbladder_cancer/Meta_analysis_Gallbladder_cancer_GWAS1.csv")
meta2<-fread("data/Obesity_related_cancer_GWAS/Gallbladder_cancer/Meta_analysis_Gallbladder_cancer_GWAS_GC1.csv")
meta1<-select(meta1,-c("Effect","StdErr"))
meta2<-select(meta2,MarkerName,Effect,StdErr)
meta<-merge(meta1,meta2,by="MarkerName")
meta<-meta[meta$HetPVal>0.05,]
meta$beta<-meta$Effect
meta$se<-meta$StdErr
meta$Allele1<-toupper(meta$Allele1)
meta$Allele2<-toupper(meta$Allele2)
fwrite(meta,"data/Obesity_related_cancer_GWAS/Gallbladder_cancer/Meta_analysis_Gallbladder_cancer_GWAS_formatted.csv")
#Kidney
meta1<-fread("data/Obesity_related_cancer_GWAS/Kidney_cancer/Meta_analysis_Kidney_cancer_GWAS1.csv")
meta2<-fread("data/Obesity_related_cancer_GWAS/Kidney_cancer/Meta_analysis_Kidney_cancer_GWAS_GC1.csv")
meta1<-select(meta1,-c("Effect","StdErr"))
meta2<-select(meta2,MarkerName,Effect,StdErr)
meta<-merge(meta1,meta2,by="MarkerName")
meta<-meta[meta$HetPVal>0.05,]
meta$beta<-meta$Effect
meta$se<-meta$StdErr
meta$Allele1<-toupper(meta$Allele1)
meta$Allele2<-toupper(meta$Allele2)
fwrite(meta,"data/Obesity_related_cancer_GWAS/Kidney_cancer/Meta_analysis_Kidney_cancer_GWAS_formatted.csv")
#Thyroid
meta1<-fread("data/Obesity_related_cancer_GWAS/Thyroid_cancer/Meta_analysis_Thyroid_cancer_GWAS1.csv")
meta2<-fread("data/Obesity_related_cancer_GWAS/Thyroid_cancer/Meta_analysis_Thyroid_cancer_GWAS_GC1.csv")
meta1<-select(meta1,-c("Effect","StdErr"))
meta2<-select(meta2,MarkerName,Effect,StdErr)
meta<-merge(meta1,meta2,by="MarkerName")
meta<-meta[meta$HetPVal>0.05,]
meta$beta<-meta$Effect
meta$se<-meta$StdErr
meta$Allele1<-toupper(meta$Allele1)
meta$Allele2<-toupper(meta$Allele2)
fwrite(meta,"data/Obesity_related_cancer_GWAS/Thyroid_cancer/Meta_analysis_Thyroid_cancer_GWAS_formatted.csv")
#Multiple_myeloma
meta1<-fread("data/Obesity_related_cancer_GWAS/Multiple_myeloma/Meta_analysis_Multiple_myeloma_cancer_GWAS1.csv")
meta2<-fread("data/Obesity_related_cancer_GWAS/Multiple_myeloma/Meta_analysis_Multiple_myeloma_cancer_GWAS_GC1.csv")
meta1<-select(meta1,-c("Effect","StdErr"))
meta2<-select(meta2,MarkerName,Effect,StdErr)
meta<-merge(meta1,meta2,by="MarkerName")
meta<-meta[meta$HetPVal>0.05,]
meta$beta<-meta$Effect
meta$se<-meta$StdErr
meta$Allele1<-toupper(meta$Allele1)
meta$Allele2<-toupper(meta$Allele2)
fwrite(meta,"data/Obesity_related_cancer_GWAS/Multiple_myeloma/Meta_analysis_Multiple_myeloma_cancer_GWAS_formatted.csv")
#Pancreas
meta1<-fread("data/Obesity_related_cancer_GWAS/Pancreas_cancer/Meta_analysis_Pancreas_cancer_GWAS1.csv")
meta2<-fread("data/Obesity_related_cancer_GWAS/Pancreas_cancer/Meta_analysis_Pancreas_cancer_GWAS_GC1.csv")
meta1<-select(meta1,-c("Effect","StdErr"))
meta2<-select(meta2,MarkerName,Effect,StdErr)
meta<-merge(meta1,meta2,by="MarkerName")
meta<-meta[meta$HetPVal>0.05,]
meta$beta<-meta$Effect
meta$se<-meta$StdErr
meta$Allele1<-toupper(meta$Allele1)
meta$Allele2<-toupper(meta$Allele2)
fwrite(meta,"data/Obesity_related_cancer_GWAS/Pancreas_cancer/Meta_analysis_Pancreas_cancer_GWAS_formatted.csv")