Dear All,
I have used this code to query biomart database previously with no error.
mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL", dataset = "hsapiens_gene_ensembl", host = 'ensembl.org')
mart Object of class 'Mart': Using the ENSEMBL_MART_ENSEMBL BioMart database Using the hsapiens_gene_ensembl datasetmapping <- getBM(attributes = c("ensembl_gene_id", "ensembl_transcript_id"), mart = mart)
But now, I get two different errors:
mapping <- getBM(attributes = c("ensembl_gene_id","ensembl_transcript_id"), mart = mart)
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 1 did not have 3 elements
mapping <- biomaRt::getBM(attributes = c("ensembl_gene_id","ensembl_transcript_id"), mart = mart)
No encoding supplied: defaulting to UTF-8.
Error in biomaRt::getBM(mart = mart, attributes = c("ensembl_transcript_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.
Is this related to the biomaRt connection issues that have been recently posted ?
sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.6 (Final)
Matrix products: default
BLAS: /projects/builder-group/jpg/R-bioconductor/lib64/R/lib/libRblas.so
LAPACK: /projects/builder-group/jpg/R-bioconductor/lib64/R/lib/libRlapack.so
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.7.4 biomaRt_2.34.1
Thank you Mike! That fixed the issue.
Hi Mike,
I am having the same issue. I get the following error:
"Error in getBM(attributes = c("hgnc_symbol", "ensembl_gene_id"), filters = "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.".
My code is:
library(biomaRt)
listMarts()
ensembl <- useMart(biomart = "ENSEMBL_MART_ENSEMBL",
dataset="hsapiens_gene_ensembl",
host = "www.ensembl.org",
path="/biomart/martservice")
ids=HLD$ensembl_gene_id
symbols = getBM(attributes = c("hgnc_symbol", "ensembl_gene_id"),
filters = "ensembl_gene_id",
values = ids,
mart = ensembl)
I have tried the code even without path function in useMart but keeps getting the same error.
Thank you for your help.
On this site it's normally good practice to start a new question, rather than comment on an old one, they're much more likely to get noticed.
I can run your example without a problem, so can you post a new question and also include the output of the command `sessionInfo()`. This lets us see the versions of R and biomaRt that you are using.