biomaRt encoding - string char expected
1
0
Entering edit mode
TriS ▴ 200
@tris-5635
Last seen 3.7 years ago
United States

hi all

I am trying to run the following query on biomaRt: 

mart <- useMart(biomart = "ENSEMBL_MART_ENSEMBL",dataset = "hsapiens_gene_ensembl",host = 'www.ensembl.org')
t2g <- getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id","external_gene_name","transcript_biotype","entrezgene"), mart = mart)

 

up until yesterday it always worked, however, since this morning I keep getting the following error:

No encoding supplied: defaulting to UTF-8.
Error in getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id",  : 
  The query to the BioMart webservice returned an invalid result: biomaRt expected a character string of length 1. Please report this to the mailing list.

I checked online but none of the offered solutions helped.

i tried even changing the host with "asia.ensembl.org" or "uswest.ensemble.org" but same error comes up.

if I run it with verbose = T I get the following:

<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE Query><Query  virtualSchemaName = 'default' uniqueRows = '1' count = '0' datasetConfigVersion = '0.6' header='1' requestid= 'biomaRt'> <Dataset name = 'hsapiens_gene_ensembl'><Attribute name = 'ensembl_transcript_id'/><Attribute name = 'ensembl_gene_id'/><Attribute name = 'external_gene_name'/><Attribute name = 'transcript_biotype'/><Attribute name = 'entrezgene'/></Dataset></Query>
No encoding supplied: defaulting to UTF-8.
#################
Results from server:
{xml_document}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb">
[1] <head>\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\n<link rel="Shortcut Icon" href="/errors/ensembl_ico.png" type="image/png">\n<title>The Ensembl Genome Browser</tit ...
[2] <body>\n  <div id="masthead">\n<img alt="[e!] " src="/ensembl_logo.png"><strong>Ensembl Genome Browser</strong>\n</div>\n    <div id="content">\n<div class="msg">This mirror site is currentl ...
Error in getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id",  : 
  The query to the BioMart webservice returned an invalid result: biomaRt expected a character string of length 1. Please report this to the mailing list.

the mart object looks fine (I believe):

> mart
Object of class 'Mart':
  Using the ENSEMBL_MART_ENSEMBL BioMart database
  Using the hsapiens_gene_ensembl dataset

the sessionInfo("biomaRt") is:

R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.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.4/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:
character(0)

other attached packages:
[1] biomaRt_2.34.1

loaded via a namespace (and not attached):
 [1] pcaPP_1.9-73         Rcpp_0.12.14         bindr_0.1            DEoptimR_1.0-8       compiler_3.4.1       pillar_1.1.0         methods_3.4.1        prettyunits_1.0.2    bitops_1.0-6        
[10] utils_3.4.1          tools_3.4.1          grDevices_3.4.1      progress_1.1.2       digest_0.6.14        bit_1.1-12           RSQLite_2.0          memoise_1.1.0        tibble_1.4.1        
[19] lattice_0.20-35      pkgconfig_2.0.1      rlang_0.1.6          graph_1.54.0         DBI_0.7              curl_3.1             parallel_3.4.1       mvtnorm_1.0-6        bindrcpp_0.2        
[28] xml2_1.1.1           dplyr_0.7.4          httr_1.3.1           stringr_1.2.0        cluster_2.0.6        graphics_3.4.1       S4Vectors_0.14.7     datasets_3.4.1       stats_3.4.1         
[37] IRanges_2.10.5       stats4_3.4.1         bit64_0.9-7          grid_3.4.1           glue_1.2.0           robustbase_0.92-8    base_3.4.1           Biobase_2.36.2       rrcov_1.4-3         
[46] R6_2.2.2             AnnotationDbi_1.38.2 XML_3.98-1.9         magrittr_1.5         corpcor_1.6.9        blob_1.1.0           matrixStats_0.52.2   BiocGenerics_0.22.1  assertthat_0.2.0    
[55] flowCore_1.42.3      stringi_1.1.6        RCurl_1.95-4.10     

 

any help would be great, thanks!

biomaRt encoding • 1.5k views
ADD COMMENT
0
Entering edit mode

Same issue with biomaRt_2.35.8

ADD REPLY
1
Entering edit mode
Mike Smith ★ 6.5k
@mike-smith
Last seen 9 hours ago
EMBL Heidelberg

For me the Ensembl mirror sites are down.  It looks like you're US based, so by default you'll get redirected to uswest.ensembl.org or useast.ensembl.org, neither of which are working for me at the moment.

Choosing an alternative host is the right strategy, but currently, if you specify an alternative host for Ensembl, you also have to supply the argument ensemblRedirect = FALSE, otherwise their internal redirection will simply send you back to your local site.  So all your queries were probably failing at the same place.  This works for me, even if I'm using a server based in Texas:

mart <- useMart(biomart = "ENSEMBL_MART_ENSEMBL", 
                dataset = "hsapiens_gene_ensembl", 
                host = 'www.ensembl.org',
                ensemblRedirect = FALSE)

After some discussion with the Ensembl team the plan going forward is to remove the redirection entirely when using biomaRt, so this should no longer be an issue.

ADD COMMENT
0
Entering edit mode

thanks Mike.

the ensembl website did not state that the servers were running so that's definitely possible. I didn't redirect, that's a good point.

as of now it seems it works (without redirect) so maybe servers are up and running again.

 

ADD REPLY

Login before adding your answer.

Traffic: 536 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