How To Use Boolean Filters In Biomart Under R?
1
3
Entering edit mode
13.8 years ago
Assa Yeroslaviz ★ 1.9k

I am trying to use the biomart data in my R session.

As biomart at the moment has problems working with RefSeq data I need to use this command:

gene_names <- getBM(attributes = c("affy_drosophila_2","flybasename_gene","flybase_gene_id", "external_gene_id", "ensembl_gene_id", "entrezgene"), filter = c("with_ox_refseq_mrna"), values = nmids, mart = ensembl)

Unfortunately i am getting an error:

Error in getBM(attributes = c("affy_drosophila_2", "flybasename_gene", : biomaRt error: with_ox_refseq_mrna is a boolean filter and needs a corresponding logical value of TRUE or FALSE to indicate if the query should retrieve all data that fulfill the boolean or alternatively that all data that not fulfill the requirement should be retrieved.

Does anyone know how to set this TRUE or FALSE values? I couldn't find anything about it in the manuals or forum.

Thanks

Assa

biomart r • 7.1k views
ADD COMMENT
5
Entering edit mode
13.8 years ago
Neilfws 49k

Your query is not quite correct. If the only filter is "with_ox_refseq_mrna", then the values cannot be nmids, whatever they are. To get all records with a Refseq ID use:

gene_names <- getBM(attributes = c("affy_drosophila_2","flybasename_gene",
                                   "flybase_gene_id", "external_gene_id",
                                   "ensembl_gene_id", "entrezgene"),
                    filters = "with_ox_refseq_mrna",
                    values = TRUE, mart = ensembl)

If you want to specify a vector of nmids as an additional filter, you'll need filters to be a list. It should look something like:

filters = c(XXXX, "with_ox_refseq_mrna"), values = list(nmids, TRUE)

Where XXXX is the filter name corresponding to whatever nmids are.

As an example, using Homo sapiens:

mart <- useMart(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")
getBM(attributes = c("ensembl_gene_id", "hgnc_symbol"),
      filters    = c("hgnc_symbol", "with_ox_refseq_mrna"),
      values     = list(c("GUCA2A", "GUCA2B"), TRUE), mart = mart)

This biomaRt guide (PDF) might help you with syntax.

ADD COMMENT

Login before adding your answer.

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