biomaRt getBM error in scan
1
0
Entering edit mode
e.everman • 0
@eeverman-14774
Last seen 2.1 years ago
United States

Hi all,

I am encountering an error using the getBM function. This same error occurred with the recent ensembl.org release in December 2017. After a few days, the problem was resolved, and the code below ran without error. Then, following the new year, the exact same code produces the error again. I've updated all packages and my version of R, and I've looked through answers to previous posts with the same error, but these posts are often several months or years old, and the fixes proposed haven't resolved my issue.

> map_mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL", dataset = "dmelanogaster_gene_ensembl", host = "ensembl.org")                
> t2g <- biomaRt::getBM(attributes=c("ensembl_transcript_id","external_gene_name"), mart = map_mart)                                            
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
  line 1 did not have 3 elements

Session Info:

R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.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.34.1 sleuth_0.29.0  dplyr_0.7.4    ggplot2_2.2.1 

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.14         pillar_1.0.1         compiler_3.4.3      
 [4] plyr_1.8.4           bindr_0.1            tools_3.4.3         
 [7] prettyunits_1.0.2    progress_1.1.2       bitops_1.0-6        
[10] digest_0.6.13        bit_1.1-12           RSQLite_2.0         
[13] memoise_1.1.0        tibble_1.4.1         gtable_0.2.0        
[16] pkgconfig_2.0.1      rlang_0.1.6          DBI_0.7             
[19] curl_3.1             parallel_3.4.3       bindrcpp_0.2        
[22] httr_1.3.1           stringr_1.2.0        IRanges_2.12.0      
[25] S4Vectors_0.16.0     stats4_3.4.3         bit64_0.9-7         
[28] grid_3.4.3           glue_1.2.0           data.table_1.10.4-3 
[31] Biobase_2.38.0       R6_2.2.2             AnnotationDbi_1.40.0
[34] XML_3.98-1.9         blob_1.1.0           magrittr_1.5        
[37] scales_0.5.0         BiocGenerics_0.24.0  assertthat_0.2.0    
[40] colorspace_1.3-2     stringi_1.1.6        RCurl_1.95-4.10     
[43] lazyeval_0.2.1       munsell_0.4.3       

Thanks for the help,

Elizabeth

biomart • 2.0k views
ADD COMMENT
0
Entering edit mode

Just confirming that I can reproduce the error - thanks for the example code.  I'll take a look over the weekend and try to get this resolved.

ADD REPLY
0
Entering edit mode
Mike Smith ★ 6.5k
@mike-smith
Last seen 5 hours ago
EMBL Heidelberg

A quick fix is to make sure you provide the 'www' to the host argument e.g. 

map_mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL", 
                             dataset = "dmelanogaster_gene_ensembl", 
                             host = "www.ensembl.org")  

I think this is related to some changes involving how the Ensembl mirrors are handled.  You can also use local mirrors like uswest.ensembl.org and useast.ensembl.org, but it's ambiguous in your example and doesn't get handled well by biomaRt.

I'll add a patch to try and catch this in the future since it's clear what you're trying to do, but this change should be sufficient for your example.

ADD COMMENT
0
Entering edit mode

You should now be able to use the 'ensembl.org' variant in biomaRt version >= 2.35.6

> library(biomaRt)
> map_mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL", 
+                              dataset = "dmelanogaster_gene_ensembl", 
+                              host = "ensembl.org")  
> t2g <- biomaRt::getBM(attributes=c("ensembl_transcript_id","external_gene_name"),
+                       mart = map_mart)   
> 
> dim(t2g)
[1] 34776     2
> 
> packageVersion('biomaRt')
[1] ‘2.35.6’

You can install that immediately via

BiocInstaller::biocLite('grimbough/biomaRt')
ADD REPLY
0
Entering edit mode

Thanks very much, Mike. Adding www seems to have fixed the issue. I never would have thought to try that. I appreciate the help.

Elizabeth 

ADD REPLY

Login before adding your answer.

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