Hi Alewa - seidel is correct. Ensembl and BioMart provide HGNC symbols for human genes. To retrieve the gene symbols for a list of mouse genes, you will need to select the 'MGI symbol' or 'gene name' attributes.
gene symbol not showing for ensembl gene ids using biomart
I have a list of esembl gene ids from RNA-seq experiment and i want to get their corresponding ref-seq ids and gene symbols but the gene symbol not showing. I may be doing something wrong, could you please take a look at my code?
#load library
library(biomaRt)
ids <- c("ENSMUSG00000047180", "ENSMUSG00000025964", "ENSMUSG00000012187", "ENSMUSG00000055980", "ENSMUSG00000034220",
"ENSMUSG00000026463","ENSMUSG00000026688", "ENSMUSG00000015090", "ENSMUSG00000026879", "ENSMUSG00000027254")
#map ensembl gene ids to ref-seq ids and show gene symbols
mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL",
dataset = "mmusculus_gene_ensembl",
host = "https://www.ensembl.org")
genes <- getBM(filters = "ensembl_gene_id", attributes = c("hgnc_symbol", "refseq_mrna"), values = ids, mart = mart)
We can see that corresponding gene symbols are missing from resulting query
> genes
hgnc_symbol refseq_mrna
1 NA
2 NA NM_026713
3 NA NM_008963
4 NA NM_011780
5 NA NM_001167949
6 NA NM_213616
7 NA NM_025569
8 NA NM_001362945
9 NA NM_001362947
10 NA NM_001362948
11 NA NM_001206367
12 NA NM_001206368
13 NA NM_001206369
14 NA NM_146120
15 NA NM_032393
16 NA NM_001173506
17 NA NM_016696
18 NA NM_153408
19 NA NM_010570
• 3,774 views
•
link
1 answer
The hgnc_symbol field appears to be empty for all available records, but "external_gene_name" returns MGI gene symbols (names), and these two fields return the same thing: "mgi_symbol", "uniprot_gn_symbol".
• 0 views
•
link
• 0 views
•
link
Log in to answer this question.
Hi, try "entrezgene_accession" instead of "hgnc_symbol" in attributes vector for getting gene symbol
Awwww! thank you all (@seidel @Ben_Ensembl @mohammadhassanj) for your help :)
A small educational note: if an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one answer if they work. This will help future users that might find this post find the right answer.