Question: Scan error using biomart with version option
4
gravatar for Chris Stubben
16 months ago by
Salt Lake City, Utah
Chris Stubben40 wrote:

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 • 1.6k views
ADD COMMENTlink modified 15 months ago by Mike Smith3.3k • written 16 months ago by Chris Stubben40
Answer: Scan error using biomart with version option
4
gravatar for Mike Smith
16 months ago by
Mike Smith3.3k
EMBL Heidelberg / de.NBI
Mike Smith3.3k wrote:

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 COMMENTlink written 16 months ago by Mike Smith3.3k
Answer: Scan error using biomart with version option
3
gravatar for Mike Smith
15 months ago by
Mike Smith3.3k
EMBL Heidelberg / de.NBI
Mike Smith3.3k wrote:

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 COMMENTlink written 15 months ago by Mike Smith3.3k

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 REPLYlink written 14 months ago by mullpaul0

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

ADD REPLYlink written 13 months ago by rbenel0

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 REPLYlink written 13 months ago by Mike Smith3.3k
Please log in to add an answer.

Help
Access

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