Question: biomaRt expected a character string of length 1
gravatar for salamandra
22 days ago by
salamandra0 wrote:

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

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 • 58 views
ADD COMMENTlink modified 22 days ago by James W. MacDonald52k • written 22 days ago by salamandra0
Answer: biomaRt expected a character string of length 1
gravatar for James W. MacDonald
22 days ago by
United States
James W. MacDonald52k wrote:

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 COMMENTlink written 22 days ago by James W. MacDonald52k

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 REPLYlink modified 21 days ago • written 21 days ago by Mike Smith4.0k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 143 users visited in the last hour