Skip to content

maps() throwing java.lang.NoSuchMethodError #19

Description

@ff98li

I was trying to map gene identifiers from Entrez gene ID to HGNC symbols using the following code:

## prep
if (!requireNamespace("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
    BiocManager::install()
}
if (!requireNamespace("BridgeDbR", quietly = TRUE))
    BiocManager::install("BridgeDbR", ask = FALSE)

normalised_counts <- readRDS(file = "./normalised_counts.rds")
## BridgeDbR mapping ============================================
entrezID          <- rownames(normalised_counts)
dbname            <- BridgeDbR::getBridgeNames(code = "Hs")
## file path to Bridge database
dbLocation        <- file.path(".", "data", dbname)
## download only if it hasn't been downloaded
if (!file.exists(dbLocation)) {
    dbLocation <- BridgeDbR::getDatabase(organism = "Homo sapiens",
                                         location = file.path(".", "data"))
}
mapper <- BridgeDbR::loadDatabase(dbLocation)
input  <- data.frame(
    source    = rep(BridgeDbR::getSystemCode("Entrez Gene"), length(entrezID)),
    identifer = entrezID
)
entrez2Hgnc_bridge <- BridgeDbR::maps(
    mapper      = mapper,
    identifiers = input,
    target      = BridgeDbR::getSystemCode("HGNC")
)

The maps function threw java.lang.NoSuchMethodError. Traceback info:

Error in map(mapper, source = source, identifier = identifier, target = target) : java.lang.NoSuchMethodError: <init>
4. stop(structure(list(message = "java.lang.NoSuchMethodError: <init>", call = map(mapper, source = source, identifier = identifier, target = target), jobj = new("jobjRef", jobj = <pointer: 0x000002383ce07518>, jclass = "java/lang/NoSuchMethodError")), class = c("NoSuchMethodError", ...
3. .jnew("org/bridgedb/Xref", identifier, datasource)
2. map(mapper, source = source, identifier = identifier, target = target)
1. BridgeDbR::maps(mapper = mapper, identifiers = input, target = "H")

I tested this on two separate machines, one running R version 4.0.4 with Bioconductor 3.12 and the other running R 4.1.0 with Bioconductor 3.13. maps() threw the same error on both machines. Oddly, this code snippet worked back in February with no issues. I'm not sure if this error has to do with the Java version. As for the sessioninfo() and the Java versions of the two machines I tested on:

## machine 1
> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936  LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

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

other attached packages:
[1] BridgeDbR_2.2.1     rJava_1.0-4         kableExtra_1.3.4    GEOquery_2.60.0     Biobase_2.52.0     
[6] BiocGenerics_0.38.0 edgeR_3.34.0        limma_3.48.0       

loaded via a namespace (and not attached):
 [1] bitops_1.0-7           lubridate_1.7.10       bit64_4.0.5            filelock_1.0.2        
 [5] webshot_0.5.2          progress_1.2.2         httr_1.4.2             rprojroot_2.0.2       
 [9] GenomeInfoDb_1.28.1    tools_4.1.0            utf8_1.2.1             R6_2.5.0              
[13] DBI_1.1.1              colorspace_2.0-2       withr_2.4.2            tidyselect_1.1.1      
[17] prettyunits_1.1.1      downlit_0.2.1          bit_4.0.4              curl_4.3.2            
[21] compiler_4.1.0         cli_3.0.0              rvest_1.0.0            xml2_1.3.2            
[25] scales_1.1.1           readr_1.4.0            rappdirs_0.3.3         systemfonts_1.0.2     
[29] stringr_1.4.0          digest_0.6.27          rmarkdown_2.9          svglite_2.0.0         
[33] XVector_0.32.0         pkgconfig_2.0.3        htmltools_0.5.1.1      highr_0.9             
[37] dbplyr_2.1.1           fastmap_1.1.0          rlang_0.4.11           rstudioapi_0.13       
[41] RSQLite_2.2.7          generics_0.1.0         jsonlite_1.7.2         dplyr_1.0.7           
[45] distill_1.2.4          RCurl_1.98-1.3         magrittr_2.0.1         GenomeInfoDbData_1.2.6
[49] Rcpp_1.0.6             munsell_0.5.0          S4Vectors_0.30.0       fansi_0.5.0           
[53] lifecycle_1.0.0        stringi_1.6.2          GEOmetadb_1.54.0       yaml_2.2.1            
[57] zlibbioc_1.38.0        BiocFileCache_2.0.0    grid_4.1.0             blob_1.2.1            
[61] crayon_1.4.1           lattice_0.20-44        Biostrings_2.60.1      annotate_1.70.0       
[65] hms_1.1.0              KEGGREST_1.32.0        locfit_1.5-9.4         knitr_1.33            
[69] pillar_1.6.1           biomaRt_2.48.2         stats4_4.1.0           XML_3.99-0.6          
[73] glue_1.4.2             evaluate_0.14          BiocManager_1.30.16    png_0.1-7             
[77] vctrs_0.3.8            purrr_0.3.4            tidyr_1.1.3            assertthat_0.2.1      
[81] cachem_1.0.5           xfun_0.23              xtable_1.8-4           viridisLite_0.4.0     
[85] tibble_3.1.2           AnnotationDbi_1.54.1   memoise_2.0.0          IRanges_2.26.0        
[89] ellipsis_0.3.2  

Java version:

java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
## machine 2
> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.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=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

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

other attached packages:
 [1] Matrix_1.3-2     kableExtra_1.3.4 forcats_0.5.1   
 [4] stringr_1.4.0    dplyr_1.0.7      purrr_0.3.4     
 [7] readr_1.4.0      tidyr_1.1.3      tibble_3.1.2    
[10] ggplot2_3.3.5    tidyverse_1.3.1  MASS_7.3-53.1   

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.1    xfun_0.24           rJava_1.0-4        
 [4] lattice_0.20-41     haven_2.4.1         colorspace_2.0-2   
 [7] vctrs_0.3.8         generics_0.1.0      htmltools_0.5.1.1  
[10] viridisLite_0.4.0   utf8_1.2.1          rlang_0.4.11       
[13] pillar_1.6.1        glue_1.4.2          withr_2.4.2        
[16] DBI_1.1.1           BridgeDbR_2.0.2     dbplyr_2.1.1       
[19] modelr_0.1.8        readxl_1.3.1        lifecycle_1.0.0    
[22] munsell_0.5.0       gtable_0.3.0        cellranger_1.1.0   
[25] rvest_1.0.0         htmlwidgets_1.5.3   evaluate_0.14      
[28] knitr_1.33          curl_4.3.2          fansi_0.5.0        
[31] broom_0.7.8         Rcpp_1.0.7          BiocManager_1.30.16
[34] scales_1.1.1        backports_1.2.1     webshot_0.5.2      
[37] jsonlite_1.7.2      fs_1.5.0            hms_1.1.0          
[40] digest_0.6.27       stringi_1.6.2       grid_4.0.4         
[43] cli_3.0.0           tools_4.0.4         magrittr_2.0.1     
[46] crayon_1.4.1        pkgconfig_2.0.3     ellipsis_0.3.2     
[49] xml2_1.3.2          reprex_2.0.0        lubridate_1.7.10   
[52] assertthat_0.2.1    rmarkdown_2.9       httr_1.4.2         
[55] rstudioapi_0.13     R6_2.5.0            compiler_4.0.4     

Java version:

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

In addition to the above, I then tried map() for mapping an individual identifier. It didn't throw this error, but also returned nothing:

> BridgeDbR::map(mapper = mapper, source = "L", identifier = "885041", target = "H")
[1] source     identifier
<0 rows> (or 0-length row.names)

I can't find out the cause of this myself. Any help will be very much appreciated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions