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.


m6A is coupled with transcriptional process

sumStat<- read.table("~/m6AQTL/other_phenotypes/summary_betas_ste_100kb.txt",sep = " ", header = T)

Tx4SU_30min <- Tx4SU_60min <- sumStat[,c("chr","pos","geneID")]
Tx4SU_30min$beta <- as.numeric(unlist( lapply( strsplit(as.character(sumStat$X4su_30),":"),function(x) x[2] ) ))
Tx4SU_30min$std.err <- as.numeric( unlist( lapply( strsplit(as.character(sumStat$X4su_30),":"),function(x) x[3] ) ) )
Tx4SU_30min$pvalue <- as.numeric( unlist( lapply( strsplit(as.character(sumStat$X4su_30),":"),function(x) x[1] ) ) )

Tx4SU_60min$beta <- as.numeric(unlist( lapply( strsplit(as.character(sumStat$X4su_60),":"),function(x) x[2] ) ) )
Tx4SU_60min$std.err <- as.numeric( unlist( lapply( strsplit(as.character(sumStat$X4su_60),":"),function(x) x[3] ) ) )
Tx4SU_60min$pvalue <- as.numeric( unlist( lapply( strsplit(as.character(sumStat$X4su_60),":"),function(x) x[1] ) ) )

Tx4SU_30min$pQTL_beta <- Tx4SU_60min$pQTL_beta <- as.numeric(unlist( lapply( strsplit(as.character(sumStat$prot),":"),function(x) x[2] ) ))
Tx4SU_30min$eQTL_beta <- as.numeric(unlist( lapply( strsplit(as.character(sumStat$RNAseq),":"),function(x) x[2] ) ))


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


GTF <- rtracklayer::import("~/Database/genome/GRCh37/GRCh37.gencode.v27.gtf",format = "gtf")
GTFmap <- data.frame("ENSEMBL" = GTF$gene_id,"Symbol" = GTF$gene_name)
GTFmap <- GTFmap[!duplicated(GTFmap$ENSEMBL),]
GTFmap$ENSEMBL <- unlist(lapply(strsplit(as.character(GTFmap$ENSEMBL), "[.]"),function(x) x[1]))

Tx4SU_30min$geneSymbol <- GTFmap$Symbol[match(Tx4SU_30min$geneID,GTFmap$ENSEMBL)]
Tx4SU_60min$geneSymbol <- GTFmap$Symbol[match(Tx4SU_60min$geneID,GTFmap$ENSEMBL)]

Tx4SU_30min$qvalue <- qvalue::qvalue(Tx4SU_30min$pvalue)$qvalue
Tx4SU_60min$qvalue <- qvalue::qvalue(Tx4SU_60min$pvalue)$qvalue

m6AQTL$peakGene <-  unlist(lapply(strsplit(as.character(m6AQTL$PEAK), split = "_"),function(x) x[2]))
m6AQTL$SnpGenePair <- paste(m6AQTL$SNP, m6AQTL$peakGene, sep = ".")
m6AQTL <- m6AQTL[order(m6AQTL$pvalue),]

eQTL <- readRDS("~/m6AQTL/other_phenotypes/eQTL/eQTL_summaryStats.RDS")
sig.Tx4SU_30min <- Tx4SU_30min[Tx4SU_30min$pvalue<1e-4,]
sig.Tx4SU_60min <- Tx4SU_30min[Tx4SU_60min$pvalue<1e-4,]

sig.Tx4SU_30min <- sig.Tx4SU_30min[order(sig.Tx4SU_30min$pvalue),]
sig.Tx4SU_60min <- sig.Tx4SU_60min[order(sig.Tx4SU_60min$pvalue),]

sig.Tx4SU_30min_lead <- sig.Tx4SU_30min[!duplicated(sig.Tx4SU_30min$geneID),]
sig.Tx4SU_60min_lead <- sig.Tx4SU_60min[!duplicated(sig.Tx4SU_60min$geneID),]

sig.Tx4SU_30min_lead$m6A <- m6AQTL$beta[match(paste0(sig.Tx4SU_30min_lead$chr,":",sig.Tx4SU_30min_lead$pos,".",sig.Tx4SU_30min_lead$geneSymbol),m6AQTL$SnpGenePair)]
sig.Tx4SU_60min_lead$m6A <- m6AQTL$beta[match(paste0(sig.Tx4SU_60min_lead$chr,":",sig.Tx4SU_60min_lead$pos,".",sig.Tx4SU_60min_lead$geneSymbol),m6AQTL$SnpGenePair)]

save(sig.Tx4SU_30min_lead,sig.Tx4SU_60min_lead, file = "~/m6AQTL/m6AQTL_analysis/data/TxQTL_m6AQTL_linearModel_effectSize_correlation.RData")

Ascertain on transcription rate P<1e-4

library(ggplot2)
library(ggpmisc)

load(file = "~/m6AQTL/m6AQTL_analysis/data/TxQTL_m6AQTL_linearModel_effectSize_correlation.RData")

ggplot(sig.Tx4SU_30min_lead,aes(x = beta, y = m6A)) +geom_point()+ggtitle("")+ylab("m6A-QTL effect size") + xlab("Tx-QTL (30min 4SU labeling) effect size") +stat_smooth(method = 'lm')+ geom_hline(aes(yintercept = 0), colour="#990000", linetype="dashed") +theme_classic() + theme(axis.line = element_line(colour = "black",size = I(0.75)),axis.title = element_text(family = "arial", face = "bold",size = 15),axis.text = element_text(family = "arial", face = "bold", size = 12), plot.title = element_text(family = "arial", face = "bold", size = 14, hjust = 0.5), legend.position = "none" )+stat_poly_eq(aes(label = paste(..rr.label..)), label.x.npc = "left", label.y.npc = 0.95, formula = y~x, parse = TRUE, size = 5)
ggplot(sig.Tx4SU_60min_lead,aes(x = beta, y = m6A)) +geom_point()+ggtitle("")+ylab("m6A-QTL effect size") + xlab("Transcription-QTL (60min 4SU labeling) effect size") +stat_smooth(method = 'lm')+ geom_hline(aes(yintercept = 0), colour="#990000", linetype="dashed") +theme_classic() + theme(axis.line = element_line(colour = "black",size = I(0.75)),axis.title = element_text(family = "arial", face = "bold",size = 15),axis.text = element_text(family = "arial", face = "bold", size = 12), plot.title = element_text(family = "arial", face = "bold", size = 14, hjust = 0.5), legend.position = "none" )+stat_poly_eq(aes(label = paste(..rr.label..)), label.x.npc = "left", label.y.npc = 0.95, formula = y~x, parse = TRUE, size = 5)

Positive controls TxQTL P<1e-4

load("~/m6AQTL/m6AQTL_analysis/data/TxQTL_epQTL_linearModel_effectSize_correlation.RData")

Tx4SU_30min_p4 <- Tx4SU_30min_p4[!duplicated(Tx4SU_30min_p4$geneID)& Tx4SU_30min_p4$pQTL_beta<10,]
Tx4SU_60min_p4 <- Tx4SU_60min_p4[!duplicated(Tx4SU_60min_p4$geneID) ,]

ggplot(Tx4SU_30min_p4,aes(x = beta, y = eQTL_beta))+geom_point( size = 3)+ylab("eQTL effect sizes")+xlab("Txn-QTL effect size (4SU 30 min)")+stat_smooth( method = 'lm')+theme_bw() +
  geom_hline(yintercept = 0, lty= 2, colour="#990000")+
  theme(panel.grid = element_blank(),axis.line = element_line(colour = "black",size = I(1.6)),axis.ticks = element_line(colour = "black",size = I(1.6)), panel.border =element_rect(colour = "black",size = I(1)) ,axis.title = element_text(family = "arial", face = "bold", size = 15),axis.text = element_text(family = "arial", face = "bold", size = 30,colour = "black"), plot.title = element_text(family = "arial", face = "bold", size = 14, hjust = 0.5), legend.position = "none", strip.text = element_text(face = "bold", size = 14), panel.grid.minor = element_blank() )+stat_poly_eq(aes(label = paste(..rr.label..)), label.x.npc = 0.14, label.y.npc = 0.92, formula = y~x, parse = TRUE, size = 14,coef.digits = 2)

ggplot(Tx4SU_60min_p4,aes(x = beta, y = eQTL_beta))+geom_point( size = 3)+ylab("eQTL effect sizes")+xlab("Txn-QTL effect size (4SU 60 min)")+stat_smooth( method = 'lm')+theme_bw() +
  geom_hline(yintercept = 0, lty= 2, colour="#990000")+
  theme(panel.grid = element_blank(),axis.line = element_line(colour = "black",size = I(1.6)),axis.ticks = element_line(colour = "black",size = I(1.6)), panel.border =element_rect(colour = "black",size = I(1)) ,axis.title = element_text(family = "arial", face = "bold", size = 15),axis.text = element_text(family = "arial", face = "bold", size = 30,colour = "black"), plot.title = element_text(family = "arial", face = "bold", size = 14, hjust = 0.5), legend.position = "none", strip.text = element_text(face = "bold", size = 14), panel.grid.minor = element_blank() )+stat_poly_eq(aes(label = paste(..rr.label..)), label.x.npc = 0.14, label.y.npc = 0.92, formula = y~x, parse = TRUE, size = 14,coef.digits = 2)



ggplot(Tx4SU_30min_p4,aes(x = beta, y = pQTL_beta))+geom_point( size = 3)+ylab("Protein-QTL effect sizes")+xlab("Txn-QTL effect size (4SU 30 min)")+stat_smooth( method = 'lm')+theme_bw() +
  geom_hline(yintercept = 0, lty= 2, colour="#990000")+
  theme(panel.grid = element_blank(),axis.line = element_line(colour = "black",size = I(1.6)),axis.ticks = element_line(colour = "black",size = I(1.6)), panel.border =element_rect(colour = "black",size = I(1)) ,axis.title = element_text(family = "arial", face = "bold", size = 15),axis.text = element_text(family = "arial", face = "bold", size = 30,colour = "black"), plot.title = element_text(family = "arial", face = "bold", size = 14, hjust = 0.5), legend.position = "none", strip.text = element_text(face = "bold", size = 14), panel.grid.minor = element_blank() )+stat_poly_eq(aes(label = paste(..rr.label..)), label.x.npc = 0.14, label.y.npc = 0.92, formula = y~x, parse = TRUE, size = 14,coef.digits = 2)

ggplot(Tx4SU_60min_p4,aes(x = beta, y = pQTL_beta))+geom_point( size = 3)+ylab("Protein-QTL effect sizes")+xlab("Txn-QTL effect size (4SU 60 min)")+stat_smooth( method = 'lm')+theme_bw() +
  geom_hline(yintercept = 0, lty= 2, colour="#990000")+
  theme(panel.grid = element_blank(),axis.line = element_line(colour = "black",size = I(1.6)),axis.ticks = element_line(colour = "black",size = I(1.6)), panel.border =element_rect(colour = "black",size = I(1)) ,axis.title = element_text(family = "arial", face = "bold", size = 15),axis.text = element_text(family = "arial", face = "bold", size = 30,colour = "black"), plot.title = element_text(family = "arial", face = "bold", size = 14, hjust = 0.5), legend.position = "none", strip.text = element_text(face = "bold", size = 14), panel.grid.minor = element_blank() )+stat_poly_eq(aes(label = paste(..rr.label..)), label.x.npc = 0.14, label.y.npc = 0.92, formula = y~x, parse = TRUE, size = 14,coef.digits = 2)

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     

loaded via a namespace (and not attached):
 [1] workflowr_1.3.0 Rcpp_1.0.1      digest_0.6.18   rprojroot_1.3-2
 [5] backports_1.1.4 git2r_0.25.2    magrittr_1.5    evaluate_0.13  
 [9] stringi_1.4.3   fs_1.3.0        rmarkdown_1.12  tools_3.5.3    
[13] stringr_1.4.0   glue_1.3.1      xfun_0.6        yaml_2.2.0     
[17] compiler_3.5.3  htmltools_0.3.6 knitr_1.22