Question: EGSEA error during report generation: "only 0's may be mixed with negative subscripts"
0
gravatar for pgugger
4 weeks ago by
pgugger20
pgugger20 wrote:

Hi, I am getting the error below ("only 0's may be mixed with negative subscripts") on certain data sets during the report generation stage when running EGSEA. I believe it has to do with plotting certain KEGG pathways in pathview, as others have reported here: https://github.com/lgeistlinger/EnrichmentBrowser/issues/10. Do you have any suggestions to work around this problem? Or, if I am correct, do you have any plans to update your R package to handle this problem?

Thanks for your help.

Paul

> gsa = egsea(voom.results = v, contrasts = contr.matrix, gs.annots = gs.annots, baseGSEAs = egsea.base(), symbolsMap = v$genes, sort.by = "med.rank", num.threads = 4, report = TRUE)
EGSEA analysis has started
##------ Fri Jun 21 14:52:26 2019 ------##
Log fold changes are estimated using limma package ... 
limma DE analysis is carried out ... 
EGSEA is running on the provided data and c2 collection

EGSEA is running on the provided data and c3 collection

EGSEA is running on the provided data and c5 collection

EGSEA is running on the provided data and c7 collection

EGSEA is running on the provided data and kegg collection

##------ Fri Jun 21 15:06:04 2019 ------##
EGSEA analysis took 818.169 seconds.
EGSEA analysis has completed
EGSEA HTML report is being generated ...
##------ Fri Jun 21 15:06:04 2019 ------##
Report pages and figures are being generated for the c2 collection ...
Error in img[pidx[i, 3]:pidx[i, 4], sel.px, 1:3] : 
  only 0's may be mixed with negative subscripts

From my session info, you can see that I am working on a new computer with the newest installation of R and EGSEA:

> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
 [1] grid      parallel  stats4    stats     graphics  grDevices utils     datasets 
 [9] methods   base     

other attached packages:
 [1] Rgraphviz_2.28.0            edgeR_3.26.4                limma_3.40.2               
 [4] EGSEAdata_1.12.0            EGSEA_1.12.0                pathview_1.24.0            
 [7] org.Hs.eg.db_3.8.2          topGO_2.36.0                SparseM_1.77               
[10] GO.db_3.8.2                 graph_1.62.0                gage_2.34.0                
[13] RColorBrewer_1.1-2          pheatmap_1.0.12             ggplot2_3.2.0              
[16] org.Mm.eg.db_3.8.2          AnnotationDbi_1.46.0        DESeq2_1.24.0              
[19] SummarizedExperiment_1.14.0 DelayedArray_0.10.0         BiocParallel_1.18.0        
[22] matrixStats_0.54.0          Biobase_2.44.0              GenomicRanges_1.36.0       
[25] GenomeInfoDb_1.20.0         IRanges_2.18.1              S4Vectors_0.22.0           
[28] BiocGenerics_0.30.0        

loaded via a namespace (and not attached):
  [1] backports_1.1.4          Hmisc_4.2-0              lazyeval_0.2.2          
  [4] GSEABase_1.46.0          splines_3.6.0            inline_0.3.15           
  [7] digest_0.6.19            foreach_1.4.4            htmltools_0.3.6         
 [10] gdata_2.18.0             magrittr_1.5             checkmate_1.9.3         
 [13] memoise_1.1.0            cluster_2.0.9            Biostrings_2.52.0       
 [16] org.Rn.eg.db_3.8.2       annotate_1.62.0          KEGGdzPathwaysGEO_1.22.0
 [19] prettyunits_1.0.2        colorspace_1.4-1         blob_1.1.1              
 [22] xfun_0.7                 dplyr_0.8.1              callr_3.2.0             
 [25] crayon_1.3.4             RCurl_1.95-4.12          jsonlite_1.6            
 [28] genefilter_1.66.0        survival_2.44-1.1        iterators_1.0.10        
 [31] glue_1.3.1               registry_0.5-1           gtable_0.3.0            
 [34] zlibbioc_1.30.0          XVector_0.24.0           R2HTML_2.3.2            
 [37] hgu133a.db_3.2.3         pkgbuild_1.0.3           KEGG.db_3.2.3           
 [40] rstan_2.18.2             scales_1.0.0             DBI_1.0.0               
 [43] rngtools_1.3.1.1         bibtex_0.4.2             Rcpp_1.0.1              
 [46] metap_1.1                viridisLite_0.3.0        xtable_1.8-4            
 [49] htmlTable_1.13.1         foreign_0.8-71           bit_1.1-14              
 [52] Formula_1.2-3            StanHeaders_2.18.1-10    GSVA_1.32.0             
 [55] DT_0.7                   htmlwidgets_1.3          httr_1.4.0              
 [58] hgu133plus2.db_3.2.3     gplots_3.0.1.1           acepack_1.4.1           
 [61] loo_2.1.0                pkgconfig_2.0.2          XML_3.98-1.20           
 [64] nnet_7.3-12              locfit_1.5-9.1           tidyselect_0.2.5        
 [67] labeling_0.3             rlang_0.3.4              later_0.8.0             
 [70] munsell_0.5.0            tools_3.6.0              cli_1.1.0               
 [73] RSQLite_2.1.1            globaltest_5.38.0        HTMLUtils_0.1.7         
 [76] stringr_1.4.0            processx_3.3.1           knitr_1.23              
 [79] bit64_0.9-7              caTools_1.17.1.2         purrr_0.3.2             
 [82] KEGGREST_1.24.0          nlme_3.1-140             doRNG_1.7.1             
 [85] mime_0.7                 KEGGgraph_1.44.0         compiler_3.6.0          
 [88] shinythemes_1.1.2        rstudioapi_0.10          curl_3.3                
 [91] plotly_4.9.0             png_0.1-7                tibble_2.1.3            
 [94] geneplotter_1.62.0       stringi_1.4.3            ps_1.3.0                
 [97] Glimma_1.12.0            lattice_0.20-38          Matrix_1.2-17           
[100] pillar_1.4.1             GSA_1.03.1               Rdpack_0.11-0           
[103] PADOG_1.26.0             data.table_1.12.2        bitops_1.0-6            
[106] gbRd_0.4-11              httpuv_1.5.1             R6_2.4.0                
[109] latticeExtra_0.6-28      hwriter_1.3.2            promises_1.0.1          
[112] KernSmooth_2.23-15       gridExtra_2.3            codetools_0.2-16        
[115] gtools_3.8.1             assertthat_0.2.1         pkgmaker_0.27           
[118] safe_3.24.0              withr_2.1.2              GenomeInfoDbData_1.2.1  
[121] rpart_4.1-15             tidyr_0.8.3              shiny_1.3.2             
[124] base64enc_0.1-3   
egsea • 124 views
ADD COMMENTlink modified 28 days ago • written 4 weeks ago by pgugger20

Hi Paul,

Can you please rerun your code with "verbose = TRUE" and paste the output here? I am trying to figure out the problematic pathways.

A workaround would be to remove the pathways that are causing the error from "gs.annots" before passing it into egsea() as follows:

sel = which(names(gs.annots[["kegg"]]$original) %in% problematic_pathways) gs.annots[["kegg"]]$original = gs.annots[["kegg"]]$original[-sel] gs.annots[["kegg"]]$idx = gs.annots[["kegg"]]$idx[-sel] gs.annots[["kegg"]]$anno = gs.annots[["kegg"]]$anno[-sel, ]

I will look into a fix in the code at some time later but hope this helps.

Cheers, Monther

ADD REPLYlink written 29 days ago by Monther Alhamdoosh40
1

Hi Monther, Thank you for your helpful response. I reran my command with verbose = TRUE and copied the result below. From past experience, I have had problems with mmu04723 ("Retrograde endocannabinoid signaling"), which seems to be the culprit in this case too. In another data set I am analyzing with EGSEA, I had a problem with mmu04215 ("Apoptosis - multiple species"). Others online have reported problems for these same two pathways, including their equivalents in humans, e.g., hsa04215.

Verbose output, truncated due to character limit:

> gsa = egsea(voom.results = v, contrasts = contr.matrix, gs.annots = gs.annots, baseGSEAs = egsea.base(), symbolsMap = v$genes, sort.by = "med.rank", num.threads = 4, report = TRUE, verbose = TRUE)
EGSEA analysis has started
##------ Mon Jun 24 08:33:09 2019 ------##
Log fold changes are estimated using limma package ... 
limma DE analysis is carried out ... 
Expected number of running processes: 16
[...]
EGSEA is running on the provided data and kegg collection
##------ Mon Jun 24 08:45:05 2019 ------##
EGSEA analysis took 716.284000000014 seconds.
EGSEA analysis has completed
EGSEA HTML report is being generated ...
##------ Mon Jun 24 08:45:05 2019 ------##
Expected number of running processes: 16
[...]
Report pages and figures are being generated for the kegg collection ...
[...]
Info: Downloading xml files for mmu05322, 1/1 pathways..
Info: Downloading png files for mmu05322, 1/1 pathways..
'select()' returned 1:1 mapping between keys and columns
Info: Working in directory /Users/[...]/egsea_report_1561380305/pv-top-gs-kegg/Contrast1
Info: Writing image file mmu05322.pathview.png
[...]
Info: Downloading xml files for mmu04723, 1/1 pathways..
Info: Downloading png files for mmu04723, 1/1 pathways..
'select()' returned 1:1 mapping between keys and columns
Info: Working in directory /Users/[...]/egsea_report_1561380305/pv-top-gs-kegg/Contrast3
Info: Writing image file mmu04723.pathview.png
Info: some node width is different from others, and hence adjusted!
Error in img[pidx[i, 3]:pidx[i, 4], sel.px, 1:3] : 
  only 0's may be mixed with negative subscripts
In addition: There were 50 or more warnings (use warnings() to see the first 50)
ADD REPLYlink written 28 days ago by pgugger20
Answer: EGSEA error during report generation: "only 0's may be mixed with negative subsc
1
gravatar for pgugger
28 days ago by
pgugger20
pgugger20 wrote:

In case others encounter the same problem, Monther's workaround strategy worked for me, but I made a few small updates and corrections:

problematic_pathways <- c("Retrograde endocannabinoid signaling", "Apoptosis - multiple species") #c("mmu04723", "mmu04215")
sel = which(names(gs.annots[["kegg"]]@original) %in% problematic_pathways) 
gs.annots[["kegg"]]@original = gs.annots[["kegg"]]@original[-sel] 
gs.annots[["kegg"]]@idx = gs.annots[["kegg"]]@idx[-sel] 
gs.annots[["kegg"]]@anno = gs.annots[["kegg"]]@anno[-sel, ]
ADD COMMENTlink written 28 days ago by pgugger20

Glad that this worked. Best.

ADD REPLYlink written 27 days ago by Monther Alhamdoosh40
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 353 users visited in the last hour