[BioC] Biomart with human genes NCBI 35

Durinck, Steffen (NIH/NCI) [F] durincks at mail.nih.gov
Mon Jul 2 17:06:21 CEST 2007


Hi Marco,

There is a better attribute to query the start and end positions of genes, use the following query:


gene.list   <- getBM(c("entrezgene","chr_name","chrom_start","chrom_end"), filters="chr_name",values=1, mart=ensmart)

Best regards,
Steffen


-----Original Message-----
From: marco zucchelli [mailto:marco.bioc at gmail.com]
Sent: Mon 7/2/2007 5:25 AM
To: bioconductor; Durinck, Steffen (NIH/NCI) [F]
Subject: [BioC] Biomart with human genes NCBI 35
 
Dear Steffen,

 thanks for your help!
Works fine but seems like there are other problems with the archived
versions.
I would like to get the positions of the genes on chromosome 1 but seems
like I cannot do that running mysql (see below)
Do you have any idea about how to bypass the problem ?

##########################################
> ensmart        <-
useMart("ensembl_mart_37",dataset="hsapiens_gene_ensembl",mysql=TRUE,archive=TRUE)

Loading required package: RMySQL
Loading required package: DBI
connected to:  ensembl_mart_37
Reading database configuration of: hsapiens_gene_ensembl
Checking attributes and filters ... ok
Checking main tables ... ok
> gene.list   <- getBM(c("entrezgene","chr_name"),
filters="chr_name",values=1, mart=ensmart)
> gene.list.x <-
getBM(c("entrezgene","chr_name","hsapiens_gene_ensembl_structure.5utr_start"),
filters="entrezgene",values= gene.list[,1], mart=ensmart)
Error in queryGenerator(attributes = attributes, filter = filters, values =
values,  :
    attribute: hsapiens_gene_ensembl_structure.5utr_start is not retrievable
via BioMart in MySQL mode, please perform query in the default web service
mode
#####################################################

Marco



On 6/29/07, Durinck, Steffen (NIH/NCI) [F] < durincks at mail.nih.gov> wrote:
>
> 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",mysql=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 at 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.
>
>



More information about the Bioconductor mailing list