motifBreakR icon indicating copy to clipboard operation
motifBreakR copied to clipboard

plotMB error :

Open bioarpit1 opened this issue 1 year ago • 1 comments

Hi Simon-Coetzee,

Thanks for the MotifbreakR package. This works smoothly but I am getting plotMB function error. here is my test RDS file command I used

plotMB(rs9746695,"rs9746695",effect = "strong")

error message Error in if (doRev) { : the condition has length > 1 Error in exists(cacheKey, where = .rs.WorkingDataEnv, inherits = FALSE) : invalid first argument result file converted to gr -> df -> csv rs9746695.csv

bioarpit1 avatar Nov 03 '23 22:11 bioarpit1

Hi, bioarpit1

I have encountered the same error as you did. Have you been able to find a solution to this error yet? Do you have any ideas what is causing the error since it's being thrown with test data in my case? Any help would be greatly appreciated. Thank you!

Best, Gemma

Gemma-Zhang-326 avatar Feb 20 '24 15:02 Gemma-Zhang-326

Hi all,

I am experiencing essentially the same error when trying to run plotMB:

Error in if (doRev) { : the condition has length > 1 Calls: plotMB Execution halted

Has anyone managed to figure it out? I will update if I do. Thanks!

Best, Stephanie

lewkiewicz avatar May 24 '24 20:05 lewkiewicz

Your variant has more than one alternate allele. You can specify which one you want to see in plotMB() with argument altAllele="C" etc

dennishazelett avatar May 24 '24 20:05 dennishazelett

Thanks for your reply! I'll try that.

Best, Stephanie

lewkiewicz avatar May 24 '24 21:05 lewkiewicz

Unfortunately, it still returns the same error even if the "altAllele" option is added:

plotMB(results = motifbreakr.results, rsid = "rs1870138", effect = "strong", altAllele = "G")

lewkiewicz avatar May 24 '24 22:05 lewkiewicz

I'm unable to replicate this error. Can you please paste the code that produced it and your sessionInfo()?

dennishazelett avatar May 24 '24 23:05 dennishazelett

Thanks so much for any assistance you can provide! The code and sessionInfo are below. Everything seems to work until the plotting step.

code:

library(motifbreakR) library(SNPlocs.Hsapiens.dbSNP155.GRCh37) library(BSgenome.Hsapiens.UCSC.hg19) library(MotifDb) pca.snps.file <- system.file("extdata", "tspan14.snps", package = "motifbreakR") tspan14.snps <- as.character(read.table(pca.snps.file)[,1]) variants <- snps.from.rsid(rsid = tspan14.snps, dbSNP = SNPlocs.Hsapiens.dbSNP155.GRCh37, search.genome = BSgenome.Hsapiens.UCSC.hg19) motifbreakr.results <- motifbreakR(snpList = variants, pwmList = MotifDb, threshold = 0.9) plotMB(results = motifbreakr.results, rsid = "rs1870138", effect = "strong", altAllele = "G")

sessionInfo():

R version 4.3.1 (2023-06-16) Platform: x86_64-conda-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS/LAPACK: /home/lewks/miniconda3/lib/libopenblasp-r0.3.21.so; LAPACK version 3.9.0

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

time zone: America/New_York tzcode source: system (glibc)

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

loaded via a namespace (and not attached): [1] compiler_4.3.1

lewkiewicz avatar May 28 '24 18:05 lewkiewicz

I am able to reproduce the error; the problem is there are too many results. I get 94 effect == "strong" motifbreakRs, which can't be rendered by plotMB(). Try more stringent parameters. I also like to filter the motif library. e.g.:

library(motifbreakR)
library(SNPlocs.Hsapiens.dbSNP155.GRCh37)
library(BSgenome.Hsapiens.UCSC.hg19)
data(motifbreakR_motif)

rs1870138 <- snps.from.rsid(
  rsid          = "rs1870138",
  dbSNP         = SNPlocs.Hsapiens.dbSNP155.GRCh37,
  search.genome = BSgenome.Hsapiens.UCSC.hg19
)

human <- subset(motifbreakR_motif, organism == "Hsapiens")

rs1870138.results <- motifbreakR(
  snpList = rs1870138, pwmList = human, threshold = 1e-05, filterp = TRUE)

plotMB(results = rs1870138.results, rsid = "rs1870138", effect = "strong", altAllele = "G")

If you want to see more results, set threshold to 5e-05 --gets you a reasonable 7 rows. Anything threshold = 5e-04 or smaller with filterp = TRUE is probably valid (but gives too many results for a graphic).

dennishazelett avatar May 29 '24 00:05 dennishazelett

One more thing, if there is a specific motif that you are interested in, or any other criteria, there is nothing stopping you from filtering your result set to the rows you'd like to see displayed by plotMB():

rs1870138.nfe2l1.results <- subset(rs1870138.results, geneSymbol == "NFE2L1::MAFG")
plotMB(results = rs1870138.nfe2l1.results, rsid = "rs1870138", effect = "strong", altAllele = "G")

dennishazelett avatar May 29 '24 01:05 dennishazelett

Thank you so much for your help! I got plotMB to work with your recommendations.

lewkiewicz avatar May 29 '24 18:05 lewkiewicz