[BioC] Help using biomaRt

steffen at stat.Berkeley.EDU steffen at stat.Berkeley.EDU
Mon Jan 26 00:19:38 CET 2009

Hi John,

> Question 1
> ===========
> I am using the Ensembl database. Looking at the www.ensembl.org website
> it looks like you do not have to specify a filter. Do you have to
> specify a filter using biomaRt/R? If not how is it done?

No you don't have to specify a filter and associated values.  You can do
for example:

mart = useMart("ensembl",dataset="hsapiens_gene_ensembl")
ensid = getBM(attributes="ensembl_gene_id", mart=mart)

This will return all ensembl gene identifiers.

> Question 2
> ==============
> While trying things I get the following error message, presumably caused
> by the attribute not being in that table.
> V1
> 1 Query ERROR: caught BioMart::Exception::Usage: Attributes from
> multiple attribute pages are not allowed
> Error in getBM(attnames, filters = filtnames, values = transcripts, mart
> = mart) :
>   Number of columns in the query result doesn't equal number of
> attributes in query.  This is probably an internal error, please report.
> How can I avoid this error other than by trial and error? Is there a bit
> more documentation somewhere that I have not found that describes the
> data structure/format in more detail? i.e. how to select the attributes
> that are not on "multiple attribute pages"?  At the moment I am just
> building my queries by trying something and seeing if it works which
> does not seem right. I think there must be some more information that
> will make it a bit easier.
> Also I cannot find anything that describes the groups/categories/types
> and what they mean or do.

You can see to which attribute page an attribute belongs using the
function listAttributes(mart, showGroups = TRUE)

note that if you're using the developmental version of biomaRt you can get
this information with:
listAttributes(mart, what=c("name","page"))

hope this helps.


More information about the Bioconductor mailing list