Question: Get gene symbols from gene ids for mouse using BioMart
0
gravatar for nikitavlassenko
12 months ago by
nikitavlassenko10 wrote:

I am trying to get gene symbols for gene ids that I got for mouse datasets. Gene ids look like that: 0610009B22Rik. The code that I am trying to utilize is the following one:

ensembl <- useMart("ensembl", dataset="mmusculus_gene_ensembl")
mouse_gene_ids <- dataset[, 1]
foo <- getBM(attributes=c('ensembl_gene_id',
                      'external_gene_name'),
         filters = 'genedb',
         values = mouse_gene_ids,
         mart = ensembl)

I am getting zero results as an output after the query runs. I guess filters parameter is wrong. Any suggestions would be greatly appreciated.

ADD COMMENTlink modified 12 months ago • written 12 months ago by nikitavlassenko10
7
gravatar for Mike Smith
12 months ago by
Mike Smith1.1k
EMBL Heidelberg / de.NBI
Mike Smith1.1k wrote:

The filter you need is mgi_symbol e.g.

library(biomaRt)

ensembl <- useMart("ensembl", dataset="mmusculus_gene_ensembl")
mouse_gene_ids  <- "0610009B22Rik"

foo <- getBM(attributes=c('ensembl_gene_id',
                          'external_gene_name'),
             filters = 'mgi_symbol',
             values = mouse_gene_ids,
             mart = ensembl)

Here's the result:

> foo
     ensembl_gene_id external_gene_name
1 ENSMUSG00000007777      0610009B22Rik

I find the best way to choose the correct filter is to start with the Ensembl BioMart web interface, use the examples in the Filters -> external references ID list dropdown list to find the format I'm using, and then hit the XML button near the top. This will let you see the filter name required by biomaRt

ADD COMMENTlink written 12 months ago by Mike Smith1.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1011 users visited in the last hour