biomaRt has encountered an unexpected server error.
2
0
Entering edit mode
scijrb • 0
@scijrb-23252
Last seen 2.7 years ago

Hello there community!

I have been trying to use biomaRt recently and so far I got it working and it was fantastic. Today, I don't know the reasons, I get these kind of errors again and again.

Error: biomaRt has encountered an unexpected server error.
Consider trying one of the Ensembl mirrors (for more details look at ?useEnsembl). 

I have tried to connect to other mirrors, "www", "useast", "uswest"... but none of them work.

Using different functions within biomaRt I always get the same, and sometimes it just works but its very annoying. Here are some of the examples of what I mean:

> listMarts()
Error in bmRequest(request = request, verbose = verbose) : 
  Internal Server Error (HTTP 500).

> ensembl_mm = useDataset("mmusculus_gene_ensembl",mart=ensembl_mm)
Error in bmRequest(request = request, verbose = verbose) : 
  Internal Server Error (HTTP 500).

> datasets <- listDatasets(ensembl_mm)
Error in bmRequest(request = request, verbose = verbose) : 
  Internal Server Error (HTTP 500).

> ensembl_df <- getBM (attributes = c("ensembl_gene_id", "description", "chromosome_name", "mgi_description", "mgi_symbol", "mgi_id", "go_id", "definition_1006"), mart = ensembl_mm)
Error: biomaRt has encountered an unexpected server error.
Consider trying one of the Ensembl mirrors (for more details look at ?useEnsembl)

Also attaching sessioninfo():

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6
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] stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
[1] biomaRt_2.42.1
loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4           pillar_1.4.3         compiler_3.6.3       dbplyr_1.4.2         prettyunits_1.1.1   
 [6] tools_3.6.3          progress_1.2.2       digest_0.6.25        bit_1.1-15.2         RSQLite_2.2.0       
[11] memoise_1.1.0        BiocFileCache_1.10.2 tibble_3.0.0         lifecycle_0.2.0      pkgconfig_2.0.3     
[16] rlang_0.4.5          cli_2.0.2            DBI_1.1.0            rstudioapi_0.11      curl_4.3            
[21] parallel_3.6.3       stringr_1.4.0        httr_1.4.1           dplyr_0.8.5          rappdirs_0.3.1      
[26] S4Vectors_0.24.3     vctrs_0.2.4          askpass_1.1          IRanges_2.20.2       hms_0.5.3           
[31] tidyselect_1.0.0     stats4_3.6.3         bit64_0.9-7          glue_1.3.2           Biobase_2.46.0      
[36] R6_2.4.1             fansi_0.4.1          AnnotationDbi_1.48.0 XML_3.99-0.3         purrr_0.3.3         
[41] blob_1.2.1           magrittr_1.5         ellipsis_0.3.0       BiocGenerics_0.32.0  assertthat_0.2.1    
[46] stringi_1.4.6        openssl_1.4.1        crayon_1.3.4        
> 

Sincerely,

Javi.

biomaRt • 6.3k views
ADD COMMENT
1
Entering edit mode
Colin ▴ 10
@0d8f56c8
Last seen 6 months ago
United States

If the mirror fix doesn't work, I recommend the following function:

library(dplyr)
mouse_human_genes = read.csv("http://www.informatics.jax.org/downloads/reports/HOM_MouseHumanSequence.rpt",sep="\t")

convert_mouse_to_human <- function(gene_list){

  output = c()

  for(gene in gene_list){
    class_key = (mouse_human_genes %>% filter(Symbol == gene & Common.Organism.Name=="mouse, laboratory"))[['DB.Class.Key']]
    if(!identical(class_key, integer(0)) ){
      human_genes = (mouse_human_genes %>% filter(DB.Class.Key == class_key & Common.Organism.Name=="human"))[,"Symbol"]
      for(human_gene in human_genes){
        output = append(output,human_gene)
      }
    }
  }

  return (output)
}
ADD COMMENT
0
Entering edit mode

Thanks! This worked great when all the mirrors failed on me repeatedly :)

ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 hours ago
United States

Please either highlight your blocks of code and then click the 101010 button or put a triple backtick (the top left key on a QWERTY keyboard) before and after. Otherwise people have to fix your post to make it legible (like I just did).

It has been pointed out recently (many times) by Mike Smith that the main ensembl servers are being upgraded, and that using a mirror is the way to go. Which works for me:

> library(biomaRt)
> mart <- useEnsembl("ensembl","mmusculus_gene_ensembl", mirror = "useast")
> getBM(c("ensembl_gene_id", "description", "chromosome_name", "mgi_description", "mgi_symbol", "mgi_id", "go_id", "definition_1006"), "ensembl_gene_id","ENSMUSG00000041147", mart)
> dim(z)
[1] 62  8

You say you used different mirrors, but the code you post doesn't indicate that you did so. You should try that. And do note that pretty much any online data source is prone to connection issues, and sometimes you just have to wait a bit and try again.

ADD COMMENT
0
Entering edit mode

Hello James,

Sorry, it was my very first post and I did not know about the triple backtick, I will do it from now on, sorry for that. Thanks a lot for the quick reply and your input, I will keep trying the way you suggested.

Best,

ADD REPLY

Login before adding your answer.

Traffic: 458 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6