Last updated: 2020-03-17

Checks: 7 0

Knit directory: m6AQTL_reproducibleDocument/

This reproducible R Markdown analysis was created with workflowr (version 1.6.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 job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

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:


Ignored files:
    Ignored:    .Rproj.user/

Unstaged changes:
    Modified:   analysis/Joint_analysis_of_QTLs.Rmd
    Modified:   analysis/index.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.


These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view them.

File Version Author Date Message
Rmd fca07d8 kevinlkx 2020-03-17 wflow_publish(“analysis/cor_effectsizes_jointLCLs.Rmd”)

  • Compute correlations of QTL effect sizes between m6A and other molecular traits and make scatterplots
  • Ascertain lead m6A-QTLs, use Yang’s genotype file
  • Source: m6AQTL_workflowr/analysis/joint_analysis_effectsizes_scatterplots_cor.Rmd
library(ggplot2)
suppressMessages(library(ggpmisc))

m6A_version <- "jointPeak_threshold5_MeRIP_HISAT2Map"
m6A_phenotype_name <- "m6APeak_logOR_GC.IP.adjusted_qqnorm"
type_apaQTL <- "dist" # choose the closest SNP-transcript pairs for APA-QTLs

cat("m6A version:", m6A_version, "\n")
cat("m6A phenotype:", m6A_phenotype_name, "\n")

Ascertain lead m6A-QTLs (qvalue < 0.1)

without PCs

dir_m6AQTL_results <- paste0("/project2/xinhe/m6A/m6A_seq/m6A_QTL/results/hg19/m6A_QTLs/", m6A_version)

dir_combined_data <- paste0(dir_m6AQTL_results, "/jointLCLs_analysis/", m6A_phenotype_name, "/m6AQTLs_leadSNPs_noPCs_APA", type_apaQTL, "_qvalue_0.1/")
m6AQTLs_info <- readRDS(paste0(dir_combined_data, "/m6AQTLs_info_leadSNPs.rds"))
effectSize <- readRDS(paste0(dir_combined_data, "/beta_jointLCLs_m6AQTLs_leadSNPs.rds"))
effectSize <- cbind(m6AQTLs_info[,c("gene_snp_pair","genename_snp_pair")], effectSize)
colnames(effectSize) <- c("gene_snp_pair","genename_snp_pair","m6A","4su30m","4su60m","Expression","Expression.Geuvadis","Ribosome","Translation Efficiency","Protein","Decay","APA")

effectSize <- effectSize[,!colnames(effectSize) %in%c("4su30m","4su60m","Expression.Geuvadis")]

effectSize_melt <- reshape2::melt(effectSize[,-c(1:2)], id.vars = "m6A")

ggplot(effectSize_melt,aes(x = m6A, y = value))+geom_point( size = 1)+ylab("QTL effect sizes")+xlab("m6A effect size")+stat_smooth(aes(x = m6A, y = value),method = 'lm')+ facet_wrap(facets = "variable", nrow = 2 ) +
  geom_hline(yintercept = 0, lty= 2,colour="#990000")+
  theme_bw() + 
  theme(panel.grid = element_blank(),axis.line = element_line(colour = "black",size = I(0.5)),axis.title = element_text(family = "arial", face = "bold", size = 15),axis.text = element_text(family = "arial", face = "bold", size = 14,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.33, label.y.npc = 0.9, formula = y~x, parse = TRUE, size = 4.6,coef.digits = 2) +
  xlim(-5,5) + ylim(-5,5) + ## remove outliers, abs(effect size) > 5
  coord_cartesian(xlim = c(-2.2,2.2), ylim = c(-2.2,2.2)) ## zoom in range: c(-2.2,2.2)

with PCs

dir_combined_data <- paste0(dir_m6AQTL_results, "/jointLCLs_analysis/", m6A_phenotype_name, "/m6AQTLs_leadSNPs_PCs_APA", type_apaQTL, "_qvalue_0.1/")
m6AQTLs_info <- readRDS(paste0(dir_combined_data, "/m6AQTLs_info_leadSNPs.rds"))
effectSize <- readRDS(paste0(dir_combined_data, "/beta_jointLCLs_m6AQTLs_leadSNPs.rds"))
effectSize <- cbind(m6AQTLs_info[,c("gene_snp_pair","genename_snp_pair")], effectSize)
colnames(effectSize) <- c("gene_snp_pair","genename_snp_pair","m6A","4su30m","4su60m","Expression","Expression.Geuvadis","Ribosome","Translation Efficiency","Protein","Decay","APA")

effectSize <- effectSize[,!colnames(effectSize) %in%c("4su30m","4su60m","Expression.Geuvadis")]

effectSize_melt <- reshape2::melt(effectSize[,-c(1:2)], id.vars = "m6A")

ggplot(effectSize_melt,aes(x = m6A, y = value))+geom_point( size = 1)+
  ylab("QTL effect sizes")+xlab("m6A effect size")+
  stat_smooth(aes(x = m6A, y = value),method = 'lm')+ facet_wrap(facets = "variable", nrow = 2 ) +
  geom_hline(yintercept = 0, lty= 2,colour="#990000")+
  theme_bw() + 
  theme(panel.grid = element_blank(),axis.line = element_line(colour = "black",size = I(0.5)),axis.title = element_text(family = "arial", face = "bold", size = 15),axis.text = element_text(family = "arial", face = "bold", size = 14,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.33, label.y.npc = 0.9, formula = y~x, parse = TRUE, size = 4.6,coef.digits = 2)+
  xlim(-5,5) + ylim(-5,5) + ## remove outliers, abs(effect size) > 5
  coord_cartesian(xlim = c(-2.2,2.2), ylim = c(-2.2,2.2)) ## zoom in range: c(-2.2,2.2)

Ascertain lead m6A-QTLs (qvalue < 0.2)

without PCs

dir_combined_data <- paste0(dir_m6AQTL_results, "/jointLCLs_analysis/", m6A_phenotype_name, "/m6AQTLs_leadSNPs_noPCs_APA", type_apaQTL, "_qvalue_0.2/")
m6AQTLs_info <- readRDS(paste0(dir_combined_data, "/m6AQTLs_info_leadSNPs.rds"))
effectSize <- readRDS(paste0(dir_combined_data, "/beta_jointLCLs_m6AQTLs_leadSNPs.rds"))
effectSize <- cbind(m6AQTLs_info[,c("gene_snp_pair","genename_snp_pair")], effectSize)
colnames(effectSize) <- c("gene_snp_pair","genename_snp_pair","m6A","4su30m","4su60m","Expression","Expression.Geuvadis","Ribosome","Translation Efficiency","Protein","Decay","APA")

effectSize <- effectSize[,!colnames(effectSize) %in%c("4su30m","4su60m","Expression.Geuvadis")]

effectSize_melt <- reshape2::melt(effectSize[,-c(1:2)], id.vars = "m6A")

ggplot(effectSize_melt,aes(x = m6A, y = value))+geom_point( size = 1)+ylab("QTL effect sizes")+xlab("m6A effect size")+stat_smooth(aes(x = m6A, y = value),method = 'lm')+ facet_wrap(facets = "variable", nrow = 2 ) +
  geom_hline(yintercept = 0, lty= 2,colour="#990000")+
  theme_bw() + 
  theme(panel.grid = element_blank(),axis.line = element_line(colour = "black",size = I(0.5)),axis.title = element_text(family = "arial", face = "bold", size = 15),axis.text = element_text(family = "arial", face = "bold", size = 14,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.33, label.y.npc = 0.9, formula = y~x, parse = TRUE, size = 4.6,coef.digits = 2) +
  xlim(-5,5) + ylim(-5,5) + ## remove outliers, abs(effect size) > 5
  coord_cartesian(xlim = c(-2.2,2.2), ylim = c(-2.2,2.2)) ## zoom in range: c(-2.2,2.2)

with PCs

dir_combined_data <- paste0(dir_m6AQTL_results, "/jointLCLs_analysis/", m6A_phenotype_name, "/m6AQTLs_leadSNPs_PCs_APA", type_apaQTL, "_qvalue_0.2/")
m6AQTLs_info <- readRDS(paste0(dir_combined_data, "/m6AQTLs_info_leadSNPs.rds"))
effectSize <- readRDS(paste0(dir_combined_data, "/beta_jointLCLs_m6AQTLs_leadSNPs.rds"))
effectSize <- cbind(m6AQTLs_info[,c("gene_snp_pair","genename_snp_pair")], effectSize)
colnames(effectSize) <- c("gene_snp_pair","genename_snp_pair","m6A","4su30m","4su60m","Expression","Expression.Geuvadis","Ribosome","Translation Efficiency","Protein","Decay","APA")

effectSize <- effectSize[,!colnames(effectSize) %in%c("4su30m","4su60m","Expression.Geuvadis")]

effectSize_melt <- reshape2::melt(effectSize[,-c(1:2)], id.vars = "m6A")

ggplot(effectSize_melt,aes(x = m6A, y = value))+geom_point( size = 1)+
  ylab("QTL effect sizes")+xlab("m6A effect size")+
  stat_smooth(aes(x = m6A, y = value),method = 'lm')+ facet_wrap(facets = "variable", nrow = 2 ) +
  geom_hline(yintercept = 0, lty= 2,colour="#990000")+
  theme_bw() + 
  theme(panel.grid = element_blank(),axis.line = element_line(colour = "black",size = I(0.5)),axis.title = element_text(family = "arial", face = "bold", size = 15),axis.text = element_text(family = "arial", face = "bold", size = 14,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.33, label.y.npc = 0.9, formula = y~x, parse = TRUE, size = 4.6,coef.digits = 2) +
  xlim(-5,5) + ylim(-5,5) + ## remove outliers, abs(effect size) > 5
  coord_cartesian(xlim = c(-2.2,2.2), ylim = c(-2.2,2.2)) ## zoom in range: c(-2.2,2.2)

sessionInfo()