Closed nickhir closed 3 years ago
Hi, I have not come across this issue before. Would you be able to provide a reproducible example, i.e. either a small subset of your data or some dummy data for GWAS.df
, eQTL.df
, Genes.df
, LD.df
, and lead_snp
that result in the same issue?
Alright, I have uploaded the data frames that you requested. You can find them here: https://we.tl/t-qaj0qZZxGm
This is the code I use to generate the plot afterwards:
library(eQTpLot)
load("Genes.df.rds")
load("LD.df.rds")
load("eQTL.df.rds")
load("GWAS.df.rds")
lead_snp <- "rs112378630"
options(bitmapType="cairo-png") # necessary, otherwise error unable to open connection to X11 display
eQTpLot(GWAS.df = subset_gwas_summary, eQTL.df = eQTL.df, Genes.df = gene_df,
gene = "ENSG00000100350", gbuild = "hg19", trait = "X",
tissue = "all", CollapseMethod = "min",
sigpvalue_GWAS = 1e-5, range=200, R2min = 0.6,
LD.df = LD.df, LDmin=7, saveplot =T, getplot = F,
leadSNP = lead_snp)
Perfect, thank you @nickhir I was able to reproduce the error and am working on finding the issue.
Hi @nickhir
There was a bug in how the script was performing the LD filtering. I have tried your example and it was able to produce the correct output.
The repo should be now updated with the fix and you can get the latest version by reinstalling the package by using devtools::install_github('RitchieLab/eQTpLot')
I will close the issue, but please feel free to reopen if you still have another problem.
Thank you very much for taking care of this issue! The plot now gets generated.
However, I am still a little confused by the output and not quite sure if it gets displayed as intended.
If I modify the LD.df
artificially to only plot a handful of SNPs the LD heatmap does not look as expected.
This is the code I used:
library(eQTpLot)
load("Genes.df.rds")
load("LD.df.rds")
load("eQTL.df.rds")
load("GWAS.df.rds")
lead_snp <- "rs112378630"
# select a subset for demonstration purpose
LD_subset <- LD.df %>%
filter(R2 > 0.9) %>%
filter(BP_A > 36783555) %>%
filter(BP_A < 36800000)
options(bitmapType="cairo-png") # necessary, otherwise error unable to open connection to X11 display
eQTpLot(GWAS.df = subset_gwas_summary, eQTL.df = eQTL.df, Genes.df = gene_df,
gene = "ENSG00000100350", gbuild = "hg19", trait = "X",
tissue = "all", CollapseMethod = "min",
sigpvalue_GWAS = 1e-5, range=200, R2min = 0.0,
LD.df = LD_subset, LDmin=0, saveplot =F, getplot = T,
leadSNP = lead_snp)
The resulting imagae looks something like this
If I understand the display correctly, the SNPs do not align with their actual positions.
@nickhir I think the latest update https://github.com/RitchieLab/eQTpLot/commit/b46ff6772d2ecd6258ef98b6b81fab019c536049 should resolve this issue. I will wait to close until you can confirm it's working now.
Unfortunately it still seems like the alignment is not right. It is closer to the real position but still off by a bit. Also, the heatmap doesn't get displayed anymore, similar to the initial problem:
As you can see, the lines do not line up with the lead SNP.
The output of LD_subset
is:
CHR_A BP_A SNP_A CHR_B BP_B SNP_B R2
1 22 36783638 rs112378630 22 36786966 rs6000269 1.000000
2 22 36788357 rs7290251 22 36790715 rs62228884 0.975001
3 22 36788357 rs7290251 22 36791833 rs7364216 0.975001
4 22 36789003 rs62228881 22 36790234 rs59177520 1.000000
This is the code I used to generate the plot:
devtools::install_github('RitchieLab/eQTpLot')
library(eQTpLot)
load("Genes.df.rds")
load("LD.df.rds")
load("eQTL.df.rds")
load("GWAS.df.rds")
lead_snp <- "rs112378630"
# select a subset for demonstration purpose
LD_subset <- LD.df %>%
filter(R2 > 0.9) %>%
filter(BP_A > 36783555) %>%
filter(BP_A < 36790000)
options(bitmapType="cairo-png") # necessary, otherwise error unable to open connection to X11 display
eQTpLot(GWAS.df = subset_gwas_summary, eQTL.df = eQTL.df, Genes.df = gene_df,
gene = "ENSG00000100350", gbuild = "hg19", trait = "X",
tissue = "all", CollapseMethod = "min",
sigpvalue_GWAS = 1e-5, range=200, R2min = 0.0,
LD.df = LD_subset, LDmin=0, saveplot =F, getplot = T,
leadSNP = lead_snp)
This is the package description.
packageDescription('eQTpLot')
License: GPL-3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
Imports: dplyr, patchwork, gridExtra, Gviz, ggnewscale, GenomicRanges, biomaRt, ggpubr, ggplotify, LDheatmap, viridisLite
Depends: ggplot2 (>= 3.3.0), R (>= 3.5.0)
RemoteType: github
RemoteHost: api.github.com
RemoteRepo: eQTpLot
RemoteUsername: RitchieLab
RemoteRef: master
RemoteSha: b46ff6772d2ecd6258ef98b6b81fab019c536049
GithubRepo: eQTpLot
GithubUsername: RitchieLab
GithubRef: master
GithubSHA1: b46ff6772d2ecd6258ef98b6b81fab019c536049
NeedsCompilation: no
Packaged: 2021-08-18 07:31:38 UTC;
Author: Theodore Drivas [aut], Anastasia Lucas [cre]
Maintainer: Anastasia Lucas <anastasia.lucas.bioinfo@gmail.com>
Built: R 4.0.0; ; 2021-08-18 07:31:40 UTC; unix
@nickhir I have pushed an update https://github.com/RitchieLab/eQTpLot/commit/dd8bc290511602908b4b75f923d802fe6ddc1517 that should hopefully improve the alignment.
Unfortunately I was not able to replicate your issue of the heatmap not appearing. This is the resulting figure I get from your code and data (note I did not include the bitmap options on my system), across a few versions of R.
Thank you for your continuous support. It is very appreciated!
I am trying to generate a LD heatmap for my plots. When I try out the example, I get the following warning
Warning message: Ignoring unknown parameters: max.overlaps
, but the heatmap and all other plots get displayed as normal.When I try out my data, I get the same warning message and all plots get displayed normally, the only thing missing is the LD heatmap (the color bar is present). The info says, that it is
Generating LDHeatMap with 187 variants
Ultimatly the resulting plot looks like this:
Any Idea what might cause this issue?
This is my
sessionInfo()