Scan error using biomart with version option
2
4
Entering edit mode
@chris-stubben-12524
Last seen 4.7 years ago
Salt Lake City, Utah

I get a scan error if I use the version option in biomaRt while running latest R version 3.4.2.   

ensembl <- useEnsembl(biomart="ensembl", dataset="hsapiens_gene_ensembl", version=90)
ensembl@host
[1] "http://e90.ensembl.org:80/biomart/martservice"
getBM(attributes=c('ensembl_gene_id','external_gene_name', 'gene_biotype'),
       filter="ensembl_gene_id", values="ENSG00000000003", mart = ensembl)
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :
  line 1 did not have 3 elements

 

BiomaRt queries without the version work fine

ensembl <- useEnsembl(biomart="ensembl", dataset="hsapiens_gene_ensembl")
ensembl@host
[1] "http://www.ensembl.org:80/biomart/martservice"
getBM(attributes=c('ensembl_gene_id','external_gene_name', 'gene_biotype'),
       filter="ensembl_gene_id", values="ENSG00000000003", mart = ensembl)
 ensembl_gene_id external_gene_name   gene_biotype
1 ENSG00000000003             TSPAN6 protein_coding

I'm adding this extra sentence since submitting returns the message Language fr is not one of the supported language.  That did not work either, so I'm adding one more sentence.  

 

biomart • 4.2k views
ADD COMMENT
4
Entering edit mode
Mike Smith ★ 6.6k
@mike-smith
Last seen 4 hours ago
EMBL Heidelberg

I'm not sure why this is happening, but I've added an issue so I remember to check it out after the holiday season.

For now I suggest using useMart() and specifying the appropriate host directly e.g.

ensembl <- useMart("ensembl", host = "http://aug2017.archive.ensembl.org", 
              dataset = "hsapiens_gene_ensembl")
getBM(attributes=c('ensembl_gene_id','external_gene_name', 'gene_biotype'),
      filter="ensembl_gene_id", values="ENSG00000000003", mart = ensembl)
  ensembl_gene_id external_gene_name   gene_biotype
1 ENSG00000000003             TSPAN6 protein_coding

You can list the available versions using listEnsemblArchives()

> listEnsemblArchives()
      version          date       url                                 
 [1,] "Ensembl GRCh37" "Feb 2014" "http://grch37.ensembl.org"         
 [2,] "Ensembl 91"     "Dec 2017" "http://Dec2017.archive.ensembl.org"
 [3,] "Ensembl 90"     "Aug 2017" "http://Aug2017.archive.ensembl.org"
 [4,] "Ensembl 89"     "May 2017" "http://May2017.archive.ensembl.org"
 [5,] "Ensembl 88"     "Mar 2017" "http://Mar2017.archive.ensembl.org"
 [6,] "Ensembl 87"     "Dec 2016" "http://Dec2016.archive.ensembl.org"
 [7,] "Ensembl 86"     "Oct 2016" "http://Oct2016.archive.ensembl.org"
 [8,] "Ensembl 85"     "Jul 2016" "http://Jul2016.archive.ensembl.org"
 [9,] "Ensembl 84"     "Mar 2016" "http://Mar2016.archive.ensembl.org"
[10,] "Ensembl 83"     "Dec 2015" "http://Dec2015.archive.ensembl.org"
[11,] "Ensembl 82"     "Sep 2015" "http://Sep2015.archive.ensembl.org"
[12,] "Ensembl 81"     "Jul 2015" "http://Jul2015.archive.ensembl.org"
[13,] "Ensembl 80"     "May 2015" "http://May2015.archive.ensembl.org"
[14,] "Ensembl 79"     "Mar 2015" "http://Mar2015.archive.ensembl.org"
[15,] "Ensembl 78"     "Dec 2014" "http://Dec2014.archive.ensembl.org"
[16,] "Ensembl 77"     "Oct 2014" "http://Oct2014.archive.ensembl.org"
[17,] "Ensembl 76"     "Aug 2014" "http://Aug2014.archive.ensembl.org"
[18,] "Ensembl 75"     "Feb 2014" "http://Feb2014.archive.ensembl.org"
[19,] "Ensembl 74"     "Dec 2013" "http://Dec2013.archive.ensembl.org"
[20,] "Ensembl 67"     "May 2012" "http://May2012.archive.ensembl.org"
[21,] "Ensembl 54"     "May 2009" "http://May2009.archive.ensembl.org"

 

ADD COMMENT
3
Entering edit mode
Mike Smith ★ 6.6k
@mike-smith
Last seen 4 hours ago
EMBL Heidelberg

This issue was related to changes in how users get redirected when the access Ensembl subdomains.  If you go to http://e90.ensembl.org you are redirected to http://aug2017.archive.ensembl.orgbiomaRt was unable to handle this correctly.

I've patched this behaviour, so if you provide a version number, it will automatically use the correct URL e.g.

> ensembl <- useEnsembl(biomart="ensembl", 
+                       dataset="hsapiens_gene_ensembl", 
+                       version=90)
> 
> ensembl@host
[1] "http://aug2017.archive.ensembl.org:80/biomart/martservice"
> 
> getBM(attributes=c('ensembl_gene_id','external_gene_name', 'gene_biotype'),
+       filter="ensembl_gene_id", 
+       values="ENSG00000000003", 
+       mart = ensembl)
  ensembl_gene_id external_gene_name   gene_biotype
1 ENSG00000000003             TSPAN6 protein_coding

This is available in biomaRt version >= 2.35.8

ADD COMMENT
0
Entering edit mode

I am running biomaRt version 2.35.11 and I get a scan error when I try to access the most current version of a dataset. Removing the version solves this, but is it possible to indicate the latest version (91) so that running the code in the future will always access this dataset?

​> mart_obj <- useEnsembl(biomart="ensembl", dataset='mmusculus_gene_ensembl', version=91)
> mart_obj@host
[1] "http://dec2017.archive.ensembl.org:80/biomart/martservice"
> df <- getBM(attributes = c('ensembl_transcript_id', 'ensembl_gene_id', 'external_gene_name', 'chromosome_name', 'description'),
+             mart       = mart_obj)
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :
  line 1 did not have 3 elements
ADD REPLY
0
Entering edit mode

I am having the same issue....have anyone come up with a solution? 

ADD REPLY
0
Entering edit mode

I replied to this in C: biomaRt scan error for latest assembly when indicating version Number

Can you make sure you're using biomaRt version 2.35.12 or newer.

If that doesn't fix the issue please start a new question with a example of the code you're trying to run, plus the output of sessionInfo() so I can see what versions of R & biomaRt you're using.

ADD REPLY

Login before adding your answer.

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