Hi Marco, James,
Thank you for reporting this. It looks indeed like something goes
wrong when using getFeature with biomaRt in MySQL mode, I'll
investigate what causes this and provide a fix as soon as possible.
Part of the error is due to different naming of the attributes in
different versions of Ensembl this results in the failure of
getFeature when used on ensembl_mart_37
However I would recommend you to use the more generic getBM function,
which doesn't contain hardcoded attribute/filter names (and thus works
with any Ensembl version), you should be able to get the data as
follows:
ensmart <- useMart("ensembl_mart_37",dataset="hsapiens_gene_ensembl",m
ysql=TRUE,archive=TRUE)
gene.list = getBM(c("entrezgene","chr_name"),
filters="chr_name",values=1, mart=ensmart)
> gene.list[3:8,]
entrezgene chr_name
3 441866 1
4 81399 1
5 135896 1
6 26683 1
7 79854 1
8 148398 1
Cheers,
Steffen
-----Original Message-----
From: James W. MacDonald [mailto:jmacdon@med.umich.edu]
Sent: Thu 6/28/2007 11:55 AM
To: marco zucchelli
Cc: Durinck, Steffen (NIH/NCI) [F]; bioconductor
Subject: Re: [BioC] Biomart with human genes NCBI 35
Hi Marco,
marco zucchelli wrote:
> Dear James and Steffen,
>
> thanks , workks properly now. At the same time seems that the
functions
> defined in biomaRt do not work on
> the archived versions.
Actually, your code doesn't work with the MySQL interface regardless
of
the dataset. Although, interestingly enough the error message is
different depending on what dataset you use.
> mart <- useMart("ensembl","hsapiens_gene_ensembl", mysql=T)
Loading required package: RMySQL
Loading required package: DBI
connected to: ensembl
Reading database configuration of: hsapiens_gene_ensembl
Checking attributes and filters ... ok
Checking main tables ... ok
> gene.list <- getFeature(chromosome=1, type="entrezgene", mart=mart)
Error in queryGenerator(attributes = attributes, filter = filters,
values = values, :
'length(filter)' must be 1 when using biomaRt in MySQL mode.
> ensmart <-
useMart("ensembl_mart_37",dataset="hsapiens_gene_ensembl",
mysql=TRUE,archive=TRUE)
connected to: ensembl_mart_37
Reading database configuration of: hsapiens_gene_ensembl
Checking attributes and filters ... ok
Checking main tables ... ok
> gene.list <- getFeature(chromosome=1, type="entrezgene",
mart=ensmart)
Error in getFeature(chromosome = 1, type = "entrezgene", mart =
ensmart) :
This function only works when using to ensembl. To use this
function
use: mart = useMart('ensembl')
## This works
> cmart <- useMart("ensembl", "hsapiens_gene_ensembl")
Checking attributes and filters ... ok
> gene.list <- getFeature(chromosome=1, type="entrezgene",
mart=cmart)
> gene.list
chromosome_name entrezgene
1 1 79501
2 1 26683
3 1 81399
4 1 729759
This looks like something for Steffen.
Best,
Jim
>
> #######
>> ensmart <-
> useMart("ensembl_mart_37",dataset="hsapiens_gene_ensembl",mysql=TRUE
,archive=TRUE)
>
> connected to: ensembl_mart_37
> Reading database configuration of: hsapiens_gene_ensembl
> Checking attributes and filters ... ok
> Checking main tables ... ok
>> gene.list <- getFeature(chromosome=1,type="entrezgene",
> mart=ensmart)
> Error in getFeature(chromosome = 1, type = "entrezgene", mart =
ensmart) :
> This function only works when using to ensembl. To use this
function
> use: mart = useMart('ensembl')
> ########
--
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623
**********************************************************
Electronic Mail is not secure, may not be read every day, and should
not be used for urgent or sensitive issues.