Ensembl_Gene_Id To Entrezgene With Biomart
2
2
Entering edit mode
10.4 years ago
pchiang5 ▴ 30

Hello,

I have a tab delimited txt file with ensembl_gene_id in the first column. The other columns represent the counts of RNA-seq alignment. Is that possible to convert those IDs to entrezgene with biomaRt package in R? Thanks.

r biomart id • 3.4k views
ADD COMMENT
3
Entering edit mode
10.4 years ago

This isn't a Biomart method, but uses the various org.XX.eg.db packages in R (org.Mm.eg.db in this example).

#Loading data not shown, but in this example it's stored in "d"
library(org.Mm.eg.db)
egENSEMBL <- toTable(org.Mm.egENSEMBL)
m <- match(d$EnsemblID, egENSEMBL$ensembl_id)
d$EntrezID <- egENSEMBL$gene_id[m]

The match() functions are quite useful. You can add gene symbols and names in a similar way.

Edit: I should mention that Ensembl IDs are generally more useful than Entrez IDs, at least in my experience.

ADD COMMENT
0
Entering edit mode

Thanks you dpryan79!

I was not able to load the library(org.Mm.eg.db). The R replied "there is no package called "org.Mm.eg.db", although loading "org.Hs.eg.dg" is OK. Did I miss something like dependencies to load the database? Or is there any other alternative databases for the purpose? Thanks again.

ADD REPLY
0
Entering edit mode

org.Mm.eg.db was just an example, use whatever is appropriate to your species of interest. Also, you have to install the relevant package before you can use it.

ADD REPLY
0
Entering edit mode

Finally I got it done by your match() function and biomaRt database.

Millions of thanks!

ADD REPLY
1
Entering edit mode
10.4 years ago
Neilfws 49k

Is that possible? Yes, it is.

A little more detail: use ensembl_gene_id as the filter and as a minimum, entrezgene and ensembl_gene_id as the attributes.

ADD COMMENT
0
Entering edit mode

Thank you Neilfws.

I am still having hard time loading library(org.Mm.eg.db). It is confusing since loading the human version 'org.Hs.eg.db' showed no problem.

ADD REPLY

Login before adding your answer.

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