biomaRt expected a character string of length 1
1
0
Entering edit mode
salamandra ▴ 20
@salamandra-12825
Last seen 2.3 years ago
Portugal

Hi, I'm getting this error:

Error in getBM(attributes = c(micrTypeFilter, "ensembl_gene_id"), filters = micrTypeFilter,  :    The query to the BioMart webservice returned an invalid result: biomaRt expected a character string of length 1.  Please report this on the support site at http://support.bioconductor.org

when I do this:

micrTypeFilter <- "illumina_humanht_12_v4"
dataset <- "hsapiens_gene_ensembl"
ensembl = useMart(biomart ="ENSEMBL_MART_ENSEMBL", dataset = dataset)
ConversionTable <- getBM(attributes=c(micrTypeFilter,'ensembl_gene_id'),filters = micrTypeFilter, values = list(ids) ,mart = ensembl)

doing head(ids) gives this:

[1] "ILMN_1343291" "ILMN_1343295" "ILMN_1651199" "ILMN_1651209" "ILMN_1651210" "ILMN_1651221"

What am I doing wrong?

biomaRt • 700 views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

The values argument should be a character vector, not a list.

> library(biomaRt)
> mart <- useEnsembl("ensembl","hsapiens_gene_ensembl", mirror = "useast")
> getBM(c("illumina_humanht_12_v4","ensembl_gene_id"), "illumina_humanht_12_v4", c("ILMN_1343291", "ILMN_1343295", "ILMN_1651199", "ILMN_1651209", "ILMN_1651210", "ILMN_1651221"), mart)
  illumina_humanht_12_v4 ensembl_gene_id
1           ILMN_1651210 ENSG00000112679
2           ILMN_1343295 ENSG00000111640
3           ILMN_1343291 ENSG00000196205
4           ILMN_1343291 ENSG00000156508
5           ILMN_1343291 ENSG00000233476
6           ILMN_1651209 ENSG00000215790
ADD COMMENT
1
Entering edit mode

This is certainly how values is intended to be provided, but I think biomaRt will simply unlist the values in this case and it should still work.

More likely switching to using the the US mirror avoids a timeout with the main site. I would recommend following James' example and defining the mart object via:

mart <- useEnsembl("ensembl","hsapiens_gene_ensembl", mirror = "useast")
ADD REPLY

Login before adding your answer.

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