Hi, I am using biomaRt to retrieve gene annotation using Ensembl IDs, and the exact same code that worked properly just a month ago, now throws errors.
Please check the MWE below:
library(biomaRt) ensembl <- useMart("ENSEMBL_MART_ENSEMBL", dataset="hsapiens_gene_ensembl", host="www.ensembl.org") genes <- c("ENSG00000121671", "ENSG00000142208", "ENSG00000171051", "ENSG00000115271", "ENSG00000143537") getBM(attributes=c('ensembl_gene_id','entrezgene','hgnc_id','hgnc_symbol'), filters='ensembl_gene_id', values=genes, mart=ensembl)
And the error it returns:
Error in getBM(attributes = c("ensembl_gene_id", "entrezgene", "hgnc_id", : The query to the BioMart webservice returned an invalid result: the number of columns in the result table does not equal the number of attributes in the query. Please report this to the mailing list.
Has anything changed over the last month and things have to be done differently now? Is there anything wrong with my code? Thanks!
It seems it is working for some people, so I include my sessionInfo() output below, to see if someone can spot what the problem is. Thanks!
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.5
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:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] biomaRt_2.32.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.11 IRanges_2.10.2 XML_3.98-1.7 digest_0.6.12 bitops_1.0-6
[6] DBI_0.6-1 stats4_3.4.0 RSQLite_1.1-2 S4Vectors_0.14.3 tools_3.4.0
[11] Biobase_2.36.2 RCurl_1.95-4.8 parallel_3.4.0 compiler_3.4.0 BiocGenerics_0.22.0
[16] AnnotationDbi_1.38.1 memoise_1.1.0
I get the following when trying to install the package:
Warning in install.packages :
package ‘AnnotationHub’ is not available (for R version 3.4.0)
Warning in install.packages :
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/PACKAGES.rds': HTTP status was '404 Not Found'
Does this mean biomaRt is broken and shouldn't be used anymore? The code I posted seemed to be working properly just a month ago...