Ensembl ids to gene symbol: Error The query to the BioMart webservice returned an invalid result

36 views
Skip to first unread message

Sanjeev Sariya

unread,
Jun 12, 2019, 12:30:30 PM6/12/19
to biomart-users
hi All,

I'm trying to get mapped gene symbol to a list of ENSEMBL Ids i've. 


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.

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

##run code  
G_list
<- getBM(filters= "ensembl_gene_id", attributes= c("ensembl_gene_id","hgnc_symbol"), values=genersem$gene_ID,mart= mart)
##


I'm using following platform and R packages:
BLAS: /mnt/mfs/cluster/bin/R-3.4/lib/libRblas.so
LAPACK
: /mnt/mfs/cluster/bin/R-3.4/lib/libRlapack.so
other attached packages
:
[1] biomaRt_2.34.2

loaded via a
namespace (and not attached):
 
[1] Rcpp_1.0.1           AnnotationDbi_1.42.1 xml2_1.2.0
 
[4] magrittr_1.5         BiocGenerics_0.24.0  hms_0.4.2
 
[7] progress_1.2.0       IRanges_2.12.0       bit_1.1-14
[10] R6_2.4.0             rlang_0.3.3          httr_1.4.0
[13] stringr_1.4.0        blob_1.1.1           tools_3.4.2
[16] parallel_3.4.2       Biobase_2.38.0       DBI_1.0.0
[19] bit64_0.9-7          digest_0.6.18        assertthat_0.2.1
[22] crayon_1.3.4         S4Vectors_0.16.0     bitops_1.0-6
[25] curl_3.3             RCurl_1.95-4.12      memoise_1.1.0
[28] RSQLite_2.1.1        stringi_1.4.3        compiler_3.4.2
[31] prettyunits_1.0.2    stats4_3.4.2         XML_3.98-1.19
[34] pkgconfig_2.0.2


Let me know if I can circumvent this anyhow.
Thanks!

Syed Haider

unread,
Jun 12, 2019, 5:42:30 PM6/12/19
to Sanjeev Sariya, biomart-users
Hi Sanjeev,

Not sure whether it was but one thing i couldnt see in your code is your genersem$gene_ID.

Here is an equivalent (but modified gene.id variable) example that works on my end:


library(biomaRt);


mart<-useMart(biomart = "ENSEMBL_MART_ENSEMBL", dataset = "hsapiens_gene_ensembl", host = 

"www.ensembl.org", ensemblRedirect = FALSE);


gene.ids <- c("ENSG00000284532", "ENSG00000238933", "ENSG00000275693");


G_list <- getBM(filters= "ensembl_gene_id", attributes= c("ensembl_gene_id","hgnc_symbol"), values=gene.ids, mart= mart)



Best,
Syed



--
You received this message because you are subscribed to the Google Groups "biomart-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biomart-user...@googlegroups.com.
Visit this group at https://groups.google.com/group/biomart-users.
To view this discussion on the web, visit https://groups.google.com/d/msgid/biomart-users/89817796-1086-405c-acab-0ec0fded22f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
<font color="green">Please consider environment before you print this!</font>

Sanjeev Sariya

unread,
Jun 13, 2019, 12:30:56 PM6/13/19
to biomart-users
Dear Haider,

Thanks for looking into it.
The code works fine, say if I provide 10-20 ensembl gene ids. It starts honking with current list of ensembl ids I've, which is 50K+.

G_list <- getBM(filters= "ensembl_gene_id", attributes= c("ensembl_gene_id","hgnc_symbol"),  values=head(df$gene_ID),mart= mart)


It works fine with above code. If I remove head, I get error:

Batch submitting query [>------------------------------]   3% eta:  1hError in getBM(filters = "ensembl_gene_id", attributes = c("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.



--Sanjeev

---------------------------------------------------------------------------------------------------

---
To unsubscribe from this group and stop receiving emails from it, send an email to biomar...@googlegroups.com.

Syed Haider

unread,
Jun 13, 2019, 5:18:39 PM6/13/19
to Sanjeev Sariya, biomart-users
Hi Sanjeev,

50K+ ids in the same query are perhaps too many. Worth sending multiple queries (sequentially) with smaller list of ids e.g 500 each!

Best,
Syed


To unsubscribe from this group and stop receiving emails from it, send an email to biomart-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages