BiomaRt::getBM Error in UseMethod(filter_)
2
0
Entering edit mode
suyang • 0
@user-24092
Last seen 10 months ago

I'm trying to create annotation for mouse RNAseq data. When I run the getBM() function I get the follwoing error. I thought it could be the filter function but I tried reinstalling dplyr. The code had worked a week ago. Does any one have a suggestion on how to troubleshoot this?

mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL",
                         dataset = "mmusculus_gene_ensembl",
                         host = 'ensembl.org')
t2g <- biomaRt::getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id",
                                     "external_gene_name","transcript_version"), mart = mart)

Output:

Error in UseMethod("filter_") : 
  no applicable method for 'filter_' applied to an object of class "c('tbl_SQLiteConnection', 'tbl_dbi', 'tbl_sql', 'tbl_lazy', 'tbl')"
biomaRt • 4.3k views
ADD COMMENT
2
Entering edit mode
Mike Smith ★ 5.1k
@mike-smith
Last seen 2 hours ago
EMBL Heidelberg / de.NBI

What happens if you run getBM() with the argument useCache = FALSE? e.g.

t2g <- biomaRt::getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id",
                                     "external_gene_name","transcript_version"), 
                      mart = mart,
                      useCache = FALSE)

You haven't provided the output of sessionInfo(), but I suspect you're using an out-of-date version of R / Bioconductor. A recent update to dplyr isn't compatible with old versions of BiocFileCache, which is in turn used by biomaRt.

If setting useCache = FALSE works then you can stick with that, but I would recommend updating to the current versions of R & Bioconductor if possible.

ADD COMMENT
0
Entering edit mode

Thank you. Indeed, after updating R, the code works fine. Thanks again.

ADD REPLY
0
Entering edit mode
@kevin
Last seen 2 hours ago
Republic of Ireland

This works AOK (All Okay) for me if I permit that biomaRt chooses my mirror. The particular query that you are running will result in an 'appreciable' amount of data being transferred. If you want further assistance, please post the output of your sessionInfo() command.

require(biomaRt)

mart <- useMart(
  biomart = 'ENSEMBL_MART_ENSEMBL',
  dataset = 'mmusculus_gene_ensembl')

specific query of 4 genes

t2g <- getBM(
  attributes = c('ensembl_transcript_id', 'ensembl_gene_id',
    'external_gene_name', 'transcript_version'),
  values = c('Ccnd1','Brca1','Brca2','Braf'),
  filter = 'external_gene_name',
  mart = mart)

head(t2g)
  ensembl_transcript_id    ensembl_gene_id external_gene_name
1    ENSMUST00000017290 ENSMUSG00000017146              Brca1
2    ENSMUST00000156843 ENSMUSG00000017146              Brca1
3    ENSMUST00000131460 ENSMUSG00000017146              Brca1
4    ENSMUST00000191198 ENSMUSG00000017146              Brca1
5    ENSMUST00000188168 ENSMUSG00000017146              Brca1
6    ENSMUST00000142086 ENSMUSG00000017146              Brca1
  transcript_version
1                 10
2                  1
3                  1
4                  1
5                  1
6                  2

entire table (all genes)

t2g <- getBM( 
  attributes = c('ensembl_transcript_id', 'ensembl_gene_id',
    'external_gene_name', 'transcript_version'),
  mart = mart)

head(t2g)
  ensembl_transcript_id    ensembl_gene_id external_gene_name
1    ENSMUST00000082423 ENSMUSG00000064372              mt-Tp
2    ENSMUST00000082422 ENSMUSG00000064371              mt-Tt
3    ENSMUST00000082421 ENSMUSG00000064370            mt-Cytb
4    ENSMUST00000082420 ENSMUSG00000064369              mt-Te
5    ENSMUST00000082419 ENSMUSG00000064368             mt-Nd6
6    ENSMUST00000082418 ENSMUSG00000064367             mt-Nd5
  transcript_version
1                  1
2                  1
3                  1
4                  1
5                  1
6                  1

dim(t2g)
[1] 144778      4
ADD COMMENT

Login before adding your answer.

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