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.
> 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:  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages:  grid parallel stats4 stats graphics grDevices utils datasets  methods base other attached packages:  Rgraphviz_2.28.0 edgeR_3.26.4 limma_3.40.2  EGSEAdata_1.12.0 EGSEA_1.12.0 pathview_1.24.0  org.Hs.eg.db_3.8.2 topGO_2.36.0 SparseM_1.77  GO.db_3.8.2 graph_1.62.0 gage_2.34.0  RColorBrewer_1.1-2 pheatmap_1.0.12 ggplot2_3.2.0  org.Mm.eg.db_3.8.2 AnnotationDbi_1.46.0 DESeq2_1.24.0  SummarizedExperiment_1.14.0 DelayedArray_0.10.0 BiocParallel_1.18.0  matrixStats_0.54.0 Biobase_2.44.0 GenomicRanges_1.36.0  GenomeInfoDb_1.20.0 IRanges_2.18.1 S4Vectors_0.22.0  BiocGenerics_0.30.0 loaded via a namespace (and not attached):  backports_1.1.4 Hmisc_4.2-0 lazyeval_0.2.2  GSEABase_1.46.0 splines_3.6.0 inline_0.3.15  digest_0.6.19 foreach_1.4.4 htmltools_0.3.6  gdata_2.18.0 magrittr_1.5 checkmate_1.9.3  memoise_1.1.0 cluster_2.0.9 Biostrings_2.52.0  org.Rn.eg.db_3.8.2 annotate_1.62.0 KEGGdzPathwaysGEO_1.22.0  prettyunits_1.0.2 colorspace_1.4-1 blob_1.1.1  xfun_0.7 dplyr_0.8.1 callr_3.2.0  crayon_1.3.4 RCurl_1.95-4.12 jsonlite_1.6  genefilter_1.66.0 survival_2.44-1.1 iterators_1.0.10  glue_1.3.1 registry_0.5-1 gtable_0.3.0  zlibbioc_1.30.0 XVector_0.24.0 R2HTML_2.3.2  hgu133a.db_3.2.3 pkgbuild_1.0.3 KEGG.db_3.2.3  rstan_2.18.2 scales_1.0.0 DBI_1.0.0  rngtools_126.96.36.199 bibtex_0.4.2 Rcpp_1.0.1  metap_1.1 viridisLite_0.3.0 xtable_1.8-4  htmlTable_1.13.1 foreign_0.8-71 bit_1.1-14  Formula_1.2-3 StanHeaders_2.18.1-10 GSVA_1.32.0  DT_0.7 htmlwidgets_1.3 httr_1.4.0  hgu133plus2.db_3.2.3 gplots_188.8.131.52 acepack_1.4.1  loo_2.1.0 pkgconfig_2.0.2 XML_3.98-1.20  nnet_7.3-12 locfit_1.5-9.1 tidyselect_0.2.5  labeling_0.3 rlang_0.3.4 later_0.8.0  munsell_0.5.0 tools_3.6.0 cli_1.1.0  RSQLite_2.1.1 globaltest_5.38.0 HTMLUtils_0.1.7  stringr_1.4.0 processx_3.3.1 knitr_1.23  bit64_0.9-7 caTools_184.108.40.206 purrr_0.3.2  KEGGREST_1.24.0 nlme_3.1-140 doRNG_1.7.1  mime_0.7 KEGGgraph_1.44.0 compiler_3.6.0  shinythemes_1.1.2 rstudioapi_0.10 curl_3.3  plotly_4.9.0 png_0.1-7 tibble_2.1.3  geneplotter_1.62.0 stringi_1.4.3 ps_1.3.0  Glimma_1.12.0 lattice_0.20-38 Matrix_1.2-17  pillar_1.4.1 GSA_1.03.1 Rdpack_0.11-0  PADOG_1.26.0 data.table_1.12.2 bitops_1.0-6  gbRd_0.4-11 httpuv_1.5.1 R6_2.4.0  latticeExtra_0.6-28 hwriter_1.3.2 promises_1.0.1  KernSmooth_2.23-15 gridExtra_2.3 codetools_0.2-16  gtools_3.8.1 assertthat_0.2.1 pkgmaker_0.27  safe_3.24.0 withr_2.1.2 GenomeInfoDbData_1.2.1  rpart_4.1-15 tidyr_0.8.3 shiny_1.3.2  base64enc_0.1-3
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.
Hi Monther, Thank you for your helpful response. I reran my command with
verbose = TRUEand 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:
I am having the same problem running EGSEA.1.8.0 / pathview.1.20.0 on R.3.5.1 with human KEGG pathways. The culprit appears to be hsa05206 in my case. Thanks for looking into it!
Info: Writing image file hsa05206.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)