RitchieLab / eQTpLot

Visualization of Colocalization Between eQTL and GWAS Data
75 stars 19 forks source link

deprecated feature in the tidyr package #19

Closed RupanwitaM closed 7 months ago

RupanwitaM commented 9 months ago

I installed eQTpLot in R version 4.3.0, ran my R code , the error that is being shown is as follows- Warning messages: 1: The x argument of as_tibble.matrix() must have unique column names if .name_repair is omitted as of tibble 2.0.0. ? Using compatibility .name_repair. ? The deprecated feature was likely used in the tidyr package. Please report the issue at https://github.com/tidyverse/tidyr/issues. 2: The <scale> argument of guides() cannot be FALSE. Use "none" instead as of ggplot2 3.3.4. ? The deprecated feature was likely used in the eQTpLot package. Please report the issue to the authors.

we tried installing the latest version of R/4.3.2 , but the eQTpLot failed to install, as the other package dependencies are unavailable for this version of R. Also as mentioned in the GitHub eQTpLot the package was built for R/4.0.0, we tried setting up R/4.0.0, but the dev tools failed to install in this environment due to other package dependency failures. Could you help with this issue?

TGDrivas commented 9 months ago

Hello, does eQTpLot work with the provided example data? Can you share the data that you are trying to use with eQTpLot so I can try to reproduce the error?

RupanwitaM commented 9 months ago

Hello, I have tried to run the example data on Git Hub in 3 ways.

1.For the following code is being used - library(eQTpLot)

load("GWAS.df.example.RData") load("eQTL.df.example.RData") load("Genes.df.example.RData") load("LD.df.example.RData")

head(GWAS.df.example)

head(eQTL.df.example)

head(Genes.df.example)

head(LD.df.example)

Rename columns to match the required names

colnames(GWAS.df.example) <- c("CHR", "BP", "SNP", "P","BETA", "PHE") colnames(eQTL.df.example) <- c("SNP.Id","Gene.Symbol", "P.Value", "NES", "Tissue") colnames(Genes.df.example) <- c( "CHR", "Start", "Stop","Gene", "Build") colnames(LD.df.example) <- c( "CHR_A","BP_A", "SNP_A","CHR_B", "BP_B", "SNP_B","R2")

for (i in 1:nrow(Genes.df.example)) { gene_info <- Genes.df.example[i, ]

Extract gene information for the current iteration

Gene <- gene_info$Gene CHR <- gene_info$CHR Start <- gene_info$Start Stop <- gene_info$Stop

Check if there is data for the gene in the specified trait

if (any(GWAS.df.example$SNP %in% Gene)) {

Additional arguments to be added to the eQTpLot function

result <- eQTpLot(
  eQTL.df = eQTL.df.example,
  GWAS.df = GWAS.df.example[GWAS.df.example$SNP %in% Gene, ],
  Genes.df = Genes.df.example,
  LD.df = LD.df.example,
  gbuild = "hg19",
  gene = Gene,
  sigpvalue_eQTL = 0.05,
  sigpvalue_GWAS = 5e-8,
  tissue = "all",
  trait = "Creatinine",
  genometrackheight = 2,
  getplot = TRUE,
  congruence = FALSE,
  NESeQTLRange = c(NA,NA),
  range = 200,
  res = 300,
  saveplot = TRUE,
  wi = "wi",
  xlimd = NA,
  ylima = NA,
  ylimd = NA,
  LDcolor = "color",
  LDmin = 10,
  #leadSNP = "lead_SNP_name",  # Replace 'lead_SNP_name' with the

actual lead SNP name R2min = 0.2, CollapsMethod = "min", Gene.List = FALSE,

Change to TRUE if you want to output Pearson correlation between

eQTL and GWAS p-values for a list of genes Tissue.List = FALSE )

# Process or save the results for each gene if needed

} else { cat(paste("No GWAS data available for gene", Gene, "and trait Creatinine\n")) } }

For the above code, there is this following output- [image: image.png]

2.For the following code is being used -

library(eQTpLot)

load("GWAS.df.example.RData") load("eQTL.df.example.RData") load("Genes.df.example.RData") load("LD.df.example.RData")

Rename columns to match the required names

colnames(GWAS.df.example) <- c("CHR", "BP", "SNP", "P", "BETA", "PHE") colnames(eQTL.df.example) <- c("SNP.Id", "Gene.Symbol", "P.Value", "NES", "Tissue") colnames(Genes.df.example) <- c("CHR", "Start", "Stop", "Gene", "Build") colnames(LD.df.example) <- c("CHR_A", "BP_A", "SNP_A", "CHR_B", "BP_B", "SNP_B", "R2")

for (i in 1:nrow(Genes.df.example)) { gene_info <- Genes.df.example[i, ]

Extract gene information for the current iteration

Gene <- gene_info$Gene CHR <- gene_info$CHR Start <- gene_info$Start Stop <- gene_info$Stop

Subset GWAS.df.example based on the current gene

gwas_info <- GWAS.df.example[GWAS.df.example$SNP %in% Gene, ]

if (nrow(gwas_info) > 0) {

Extract PHE for the current iteration

PHE <- gwas_info$PHE

# Additional arguments to be added to the eQTpLot function
result <- eQTpLot(
  eQTL.df = eQTL.df.example,
  GWAS.df = gwas_info,  # Use the subsetted GWAS dataframe
  Genes.df = Genes.df.example,
  LD.df = LD.df.example,
  gbuild = "hg19",
  gene = Gene,
  sigpvalue_eQTL = 0.05,
  sigpvalue_GWAS = 5e-8,
  tissue = "all",
  trait = PHE,
  genometrackheight = 2,
  getplot = TRUE,
  congruence = FALSE,
  NESeQTLRange = c(NA, NA),
  range = 200,
  res = 300,
  saveplot = TRUE,
  wi = "wi",
  xlimd = NA,
  ylima = NA,
  ylimd = NA,
  LDcolor = "color",
  LDmin = 10,
  R2min = 0.2
  # ... (other parameters)
)

# Process or save the results for each gene if needed

} else {

Handle the case where there is no corresponding GWAS information for

the current gene print(paste("No GWAS information found for gene:", Gene)) } } [image: image.png]

  1. For the following code i received the following output- library(eQTpLot)

Load example data

load("GWAS.df.example.RData") load("eQTL.df.example.RData") load("Genes.df.example.RData") load("LD.df.example.RData")

Rename columns to match the required names

colnames(GWAS.df.example) <- c("CHR", "BP", "SNP", "P", "BETA", "PHE") colnames(eQTL.df.example) <- c("SNP.Id", "Gene.Symbol", "P.Value", "NES", "Tissue") colnames(Genes.df.example) <- c("CHR", "Start", "Stop", "Gene", "Build") colnames(LD.df.example) <- c("CHR_A", "BP_A", "SNP_A", "CHR_B", "BP_B", "SNP_B", "R2")

Iterate over genes

for (i in 1:nrow(Genes.df.example)) { gene_info <- Genes.df.example[i, ] gwas_info <- GWAS.df.example[i, ]

Extract gene information for the current iteration

Gene <- gene_info$Gene CHR <- gene_info$CHR Start <- gene_info$Start Stop <- gene_info$Stop PHE <- gwas_info$PHE

Additional arguments to be added to the eQTpLot function

result <- eQTpLot( eQTL.df = eQTL.df.example, GWAS.df = GWAS.df.example[GWAS.df.example$SNP %in% Gene, ], Genes.df = Genes.df.example, LD.df = LD.df.example, gbuild = "hg19", gene = Gene, sigpvalue_eQTL = 0.05, sigpvalue_GWAS = 5e-8, tissue = "all", trait = PHE, genometrackheight = 2, getplot = TRUE, congruence = FALSE, NESeQTLRange = c(NA, NA), range = 200, res = 300, saveplot = TRUE, wi = "wi", xlimd = NA, ylima = NA, ylimd = NA, LDcolor = "color", LDmin = 10, R2min = 0.2

Uncomment the following lines if needed

# CollapsMethod = "min",
# Gene.List = FALSE,
# Tissue.List = FALSE

)

Process or save the results for each gene if needed

} [image: image.png]

Lastly, i am trying to run eqtplot for my own datasets that are in csv format [image: image.png] i am receiving the following output- [image: image.png]

Please help me resolve this issue, Thanks and Regards. Rupanwita M.

On Fri, Jan 19, 2024 at 12:47 AM TGDrivas @.***> wrote:

Hello, does eQTpLot work with the provided example data? Can you share the data that you are trying to use with eQTpLot so I can try to reproduce the error?

— Reply to this email directly, view it on GitHub https://github.com/RitchieLab/eQTpLot/issues/19#issuecomment-1899066490, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARKGTDUFZKORS766KSEFHXTYPFYLJAVCNFSM6AAAAABB57IN22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJZGA3DMNBZGA . You are receiving this because you authored the thread.Message ID: @.***>

TGDrivas commented 9 months ago

Hi Rupanwita, I can't see any of the resultant .png files that the package output here, can you lease post those? Although it sounds like, using the supplied example data, that the package is behaving as expected, in which case it sounds like its an issue with the data you are supplying. I would recommend checking the formatting and naming of the data you are passing to the package.