Last updated: 2020-03-17

Checks: 6 0

Knit directory: m6AQTL_reproducibleDocument/

This reproducible R Markdown analysis was created with workflowr (version 1.3.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20200317) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Untracked files:
    Untracked:  analysis/Re-analysis_of_Wang_2015_cell.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
m6AQTL <- readRDS("~/m6AQTL/m6A_QTL_results/linear_model/m6AQTL.m6APeak_logOR_GC.IP.adjusted_qqnorm.15PCs.fastQTL.nominals.rds")


eQTL <- readRDS("~/m6AQTL/GWAS_summary/eQTL_summary_stats.RDS")
sQTL <- readRDS("~/m6AQTL/GWAS_summary/sQTL_summary_stats.RDS")

sQTL$snps <- gsub("[.]",":",sQTL$snps)
eQTL$snps <- gsub("[.]",":",eQTL$snps)
eQTL$snps <- gsub("chr","",eQTL$snps)
sQTL$snps <- gsub("chr","",sQTL$snps)

To plot the QQ plot, we select SNPs with P<1e-4

m6AQTL_lead <- m6AQTL[m6AQTL$pvalue<1e-4,]

eQTL_lead <- eQTL[eQTL$pvalue < 1e-4,]

sQTL_lead <- sQTL[ sQTL$pvalue < 1e-4,]

m6AQTL_lead$snps <- gsub("chr","",m6AQTL_lead$SNP)

Immune Dieases

Rheumatoid arthritis

RA_gwas <-readRDS("~/m6AQTL/GWAS_summary/GWAS_summary_stats.RDS/RA_meta_stats.RDS")
RA_gwas$m6AQTL <- RA_gwas$eQTL <- RA_gwas$sQTL <- RA_gwas$CtlQTL <-  0
RA_gwas[which(paste(RA_gwas$CHR,RA_gwas$POS,sep = ":") %in% m6AQTL_lead$snps),"m6AQTL" ] <- 1
RA_gwas[which(paste(RA_gwas$CHR,RA_gwas$POS,sep = ":") %in% eQTL_lead$snps), "eQTL"] <- 1
RA_gwas[which(paste(RA_gwas$CHR,RA_gwas$POS,sep = ":") %in% sQTL_lead$snps), "sQTL"] <- 1

barplot(1:8,col = cbbPalette)

cbbPalette <- c( "#E69F00","#D55E00",  "#56B4E9", "#000000", "#F0E442", "#0072B2", "#CC79A7","#009E73")


RA_gwas <- RA_gwas[RA_gwas$P > 1e-30,]
RA_p_values <- list('m6AQTL'=dplyr::filter(RA_gwas,m6AQTL==1)$P,
                    'eQTL'=dplyr::filter(RA_gwas,eQTL==1)$P,
                    'sQTL'=dplyr::filter(RA_gwas,sQTL==1)$P,
                    'Genome wide'=RA_gwas$P)
m6Amonster::qqplot.pvalue(RA_p_values,legendSize = 2)+theme(axis.title = element_text(size = 16,face = "bold"),axis.text =  element_text(size = 14,face = "bold"), legend.title = element_blank(),legend.text =  element_text(size = 14,face = "bold"),axis.line = element_line(size = 1) )+scale_color_manual(values = cbbPalette)

Cronary Artery Disease

cad_gwas <- readRDS("~/m6AQTL/GWAS_summary/GWAS_summary_stats.RDS/CAD_stats.RDS")

cad_gwas$m6AQTL <- cad_gwas$eQTL <- cad_gwas$sQTL <- cad_gwas$CtlQTL <- 0
cad_gwas$m6AQTL[which(paste(cad_gwas$CHR ,cad_gwas$POS,sep = ":") %in% m6AQTL_lead$snps )] <- 1
cad_gwas$eQTL[which(paste(cad_gwas$CHR ,cad_gwas$POS,sep = ":") %in% eQTL_lead$snps )] <- 1
cad_gwas$sQTL[which(paste(cad_gwas$CHR ,cad_gwas$POS,sep = ":") %in% sQTL_lead$snps )] <- 1

cad_gwas <- dplyr::filter(cad_gwas,P>1e-30 )
cad_p_values <- list('m6AQTL'=dplyr::filter(cad_gwas,m6AQTL==1)$P,
                    'eQTL'=dplyr::filter(cad_gwas,eQTL==1)$P,
                    'sQTL'=dplyr::filter(cad_gwas,sQTL==1)$P,
                    'Genome wide'=cad_gwas$P)
m6Amonster::qqplot.pvalue(cad_p_values,legendSize = 2)+theme(axis.title = element_text(size = 16,face = "bold"),axis.text =  element_text(size = 14,face = "bold"), legend.title = element_blank(),legend.text =  element_text(size = 14,face = "bold"),axis.line = element_line(size = 1) )+scale_color_manual(values = cbbPalette)

PlatletCount

PlatletCount_gwas <- readRDS("~/m6AQTL/GWAS_summary/GWAS_collection.RDS/plt_GWAS_processed.RDS")

PlatletCount_gwas$m6AQTL <- PlatletCount_gwas$eQTL <- PlatletCount_gwas$sQTL <- PlatletCount_gwas$CtlQTL <- 0
PlatletCount_gwas$m6AQTL[which(paste(PlatletCount_gwas$CHR ,PlatletCount_gwas$POS,sep = ":") %in% paste0("chr",m6AQTL_lead$snps) )] <- 1
PlatletCount_gwas$eQTL[which(paste(PlatletCount_gwas$CHR ,PlatletCount_gwas$POS,sep = ":") %in% paste0("chr",eQTL_lead$snps) )] <- 1
PlatletCount_gwas$sQTL[which(paste(PlatletCount_gwas$CHR ,PlatletCount_gwas$POS,sep = ":") %in% paste0("chr",sQTL_lead$snps) )] <- 1

PlatletCount_gwas$P <- as.numeric( PlatletCount_gwas$P )
PlatletCount_gwas <- dplyr::filter(PlatletCount_gwas,P>1e-30 )
PlatletCount_p_values <- list('m6AQTL'=dplyr::filter(PlatletCount_gwas,m6AQTL==1)$P,
                    'eQTL'=dplyr::filter(PlatletCount_gwas,eQTL==1)$P,
                    'sQTL'=dplyr::filter(PlatletCount_gwas,sQTL==1)$P,
                    'Genome wide'=PlatletCount_gwas$P)
m6Amonster::qqplot.pvalue(PlatletCount_p_values,legendSize = 2)+theme(axis.title = element_text(size = 16,face = "bold"),axis.text =  element_text(size = 14,face = "bold"), legend.title = element_blank(),legend.text =  element_text(size = 14,face = "bold"),axis.line = element_line(size = 1) )+scale_color_manual(values = cbbPalette)

Lymphocyte

Lymphocyte_gwas <- readRDS("~/m6AQTL/GWAS_summary/GWAS_collection.RDS/lymph_GWAS_processed.RDS")

Lymphocyte_gwas$m6AQTL <- Lymphocyte_gwas$eQTL <- Lymphocyte_gwas$sQTL <- Lymphocyte_gwas$CtlQTL <- 0
Lymphocyte_gwas$m6AQTL[which(paste(Lymphocyte_gwas$CHR ,Lymphocyte_gwas$POS,sep = ":") %in% paste0("chr",m6AQTL_lead$snps) )] <- 1
Lymphocyte_gwas$eQTL[which(paste(Lymphocyte_gwas$CHR ,Lymphocyte_gwas$POS,sep = ":") %in% paste0("chr",eQTL_lead$snps) )] <- 1
Lymphocyte_gwas$sQTL[which(paste(Lymphocyte_gwas$CHR ,Lymphocyte_gwas$POS,sep = ":") %in% paste0("chr",sQTL_lead$snps) )] <- 1


Lymphocyte_gwas$P <- as.numeric( Lymphocyte_gwas$P )
Lymphocyte_gwas <- dplyr::filter(Lymphocyte_gwas,P>1e-30 )
Lymphocyte_p_values <- list('m6AQTL'=dplyr::filter(Lymphocyte_gwas,m6AQTL==1)$P,
                    'eQTL'=dplyr::filter(Lymphocyte_gwas,eQTL==1)$P,
                    'sQTL'=dplyr::filter(Lymphocyte_gwas,sQTL==1)$P,
                    'Genome wide'=Lymphocyte_gwas$P)
m6Amonster::qqplot.pvalue(Lymphocyte_p_values,legendSize = 2)+theme(axis.title = element_text(size = 16,face = "bold"),axis.text =  element_text(size = 14,face = "bold"), legend.title = element_blank(),legend.text =  element_text(size = 14,face = "bold"),axis.line = element_line(size = 1) )+scale_color_manual(values = cbbPalette)

LeukocyteCount

LeukocyteCount_gwas <- readRDS("~/m6AQTL/GWAS_summary/GWAS_collection.RDS/wbc_GWAS_processed.RDS")

LeukocyteCount_gwas$m6AQTL <- LeukocyteCount_gwas$eQTL <- LeukocyteCount_gwas$sQTL <- LeukocyteCount_gwas$CtlQTL <- 0
LeukocyteCount_gwas$m6AQTL[which(paste(LeukocyteCount_gwas$CHR ,LeukocyteCount_gwas$POS,sep = ":") %in% paste0("chr",m6AQTL_lead$snps) )] <- 1
LeukocyteCount_gwas$eQTL[which(paste(LeukocyteCount_gwas$CHR ,LeukocyteCount_gwas$POS,sep = ":") %in% paste0("chr",eQTL_lead$snps) )] <- 1
LeukocyteCount_gwas$sQTL[which(paste(LeukocyteCount_gwas$CHR ,LeukocyteCount_gwas$POS,sep = ":") %in% paste0("chr",sQTL_lead$snps) )] <- 1

LeukocyteCount_gwas$P <- as.numeric( LeukocyteCount_gwas$P )
LeukocyteCount_gwas <- dplyr::filter(LeukocyteCount_gwas,P>1e-30 )
LeukocyteCount_p_values <- list('m6AQTL'=dplyr::filter(LeukocyteCount_gwas,m6AQTL==1)$P,
                    'eQTL'=dplyr::filter(LeukocyteCount_gwas,eQTL==1)$P,
                    'sQTL'=dplyr::filter(LeukocyteCount_gwas,sQTL==1)$P,
                    'Genome wide'=LeukocyteCount_gwas$P)
m6Amonster::qqplot.pvalue(LeukocyteCount_p_values,legendSize = 2)+theme(axis.title = element_text(size = 16,face = "bold"),axis.text =  element_text(size = 14,face = "bold"), legend.title = element_blank(),legend.text =  element_text(size = 14,face = "bold"),axis.line = element_line(size = 1) )+scale_color_manual(values = cbbPalette)

UlcerateiveColitis

UlcerateiveColitis_gwas <- readRDS("~/m6AQTL/GWAS_summary/GWAS_collection.RDS/ulcerative_colitis_GWAS_processed.RDS")

UlcerateiveColitis_gwas$m6AQTL <- UlcerateiveColitis_gwas$eQTL <- UlcerateiveColitis_gwas$sQTL <- UlcerateiveColitis_gwas$CtlQTL <- 0
UlcerateiveColitis_gwas$m6AQTL[which(paste(UlcerateiveColitis_gwas$CHR ,UlcerateiveColitis_gwas$POS,sep = ":") %in% paste0("chr",m6AQTL_lead$snps) )] <- 1
UlcerateiveColitis_gwas$eQTL[which(paste(UlcerateiveColitis_gwas$CHR ,UlcerateiveColitis_gwas$POS,sep = ":") %in% paste0("chr",eQTL_lead$snps) )] <- 1
UlcerateiveColitis_gwas$sQTL[which(paste(UlcerateiveColitis_gwas$CHR ,UlcerateiveColitis_gwas$POS,sep = ":") %in% paste0("chr",sQTL_lead$snps) )] <- 1

UlcerateiveColitis_gwas$P <- as.numeric( UlcerateiveColitis_gwas$P )
UlcerateiveColitis_gwas <- dplyr::filter(UlcerateiveColitis_gwas,P>1e-30 )
UlcerateiveColitis_p_values <- list('m6AQTL'=dplyr::filter(UlcerateiveColitis_gwas,m6AQTL==1)$P,
                    'eQTL'=dplyr::filter(UlcerateiveColitis_gwas,eQTL==1)$P,
                    'sQTL'=dplyr::filter(UlcerateiveColitis_gwas,sQTL==1)$P,
                    'Genome wide'=UlcerateiveColitis_gwas$P)
m6Amonster::qqplot.pvalue(UlcerateiveColitis_p_values,legendSize = 2)+theme(axis.title = element_text(size = 16,face = "bold"),axis.text =  element_text(size = 14,face = "bold"), legend.title = element_blank(),legend.text =  element_text(size = 14,face = "bold"),axis.line = element_line(size = 1) )+scale_color_manual(values = cbbPalette)

Eosinophil

Eosinophil_gwas <- readRDS("~/m6AQTL/GWAS_summary/GWAS_collection.RDS/Eosinophil_count_GWAS_processed.RDS")

Eosinophil_gwas$m6AQTL <- Eosinophil_gwas$eQTL <- Eosinophil_gwas$sQTL <- Eosinophil_gwas$CtlQTL <- 0
Eosinophil_gwas$m6AQTL[which(paste(Eosinophil_gwas$CHR ,Eosinophil_gwas$POS,sep = ":") %in% paste0("chr",m6AQTL_lead$snps) )] <- 1
Eosinophil_gwas$eQTL[which(paste(Eosinophil_gwas$CHR ,Eosinophil_gwas$POS,sep = ":") %in% paste0("chr",eQTL_lead$snps) )] <- 1
Eosinophil_gwas$sQTL[which(paste(Eosinophil_gwas$CHR ,Eosinophil_gwas$POS,sep = ":") %in% paste0("chr",sQTL_lead$snps) )] <- 1

Eosinophil_gwas$P <- as.numeric( Eosinophil_gwas$P )
Eosinophil_gwas <- dplyr::filter(Eosinophil_gwas,P>1e-30 )
Eosinophil_p_values <- list('m6AQTL'=dplyr::filter(Eosinophil_gwas,m6AQTL==1)$P,
                    'eQTL'=dplyr::filter(Eosinophil_gwas,eQTL==1)$P,
                    'sQTL'=dplyr::filter(Eosinophil_gwas,sQTL==1)$P,
                    #'Control-SNPs'=dplyr::filter(Eosinophil_gwas,CtlQTL==1)$P,
                    'Genome wide'=Eosinophil_gwas$P)
m6Amonster::qqplot.pvalue(Eosinophil_p_values,legendSize = 2)+theme(axis.title = element_text(size = 16,face = "bold"),axis.text =  element_text(size = 14,face = "bold"), legend.title = element_blank(),legend.text =  element_text(size = 14,face = "bold"),axis.line = element_line(size = 1) )+scale_color_manual(values = cbbPalette)

sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.10

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dplyr_0.8.0.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1       knitr_1.22       magrittr_1.5     workflowr_1.3.0 
 [5] tidyselect_0.2.5 R6_2.4.0         rlang_0.4.0      stringr_1.4.0   
 [9] tools_3.5.3      xfun_0.6         git2r_0.25.2     htmltools_0.3.6 
[13] yaml_2.2.0       rprojroot_1.3-2  digest_0.6.18    assertthat_0.2.1
[17] tibble_2.1.1     crayon_1.3.4     purrr_0.3.2      fs_1.3.0        
[21] glue_1.3.1       evaluate_0.13    rmarkdown_1.12   stringi_1.4.3   
[25] compiler_3.5.3   pillar_1.3.1     backports_1.1.4  pkgconfig_2.0.2