map Ensembl gene ID from hg19 to hg38
1
0
Entering edit mode
13 months ago
pingu77 ▴ 20

Hello!

I would like to convert Ensembl gene ID from hg19 to hg38 with R. I tried with this code:

ensembl <- useMart("ensembl", dataset = "hsapiens_gene_ensembl", host= "grch37.ensembl.org")
ensembl_ids <- c("ENSG00000183878", "ENSG00000146083")
converted_ids <- getLDS(attributes = c("ensembl_gene_id"), filters = "ensembl_gene_id", values = your_ensembl_ids,  mart = ensembl, attributesL = c("ensembl_gene_id"), martL = useMart("ensembl", dataset= "hsapiens_gene_ensembl", host = "www.ensembl.org"))

But I get this error:

Error in getLDS(attributes = c("ensembl_gene_id"), filters = "ensembl_gene_id",  :    Both datasets must be located on the same host.

Do you any suggestions on how to map the ensembl id with bioMart? Or other R packages?

Thank you in advance!

biomart ensembl • 801 views
ADD COMMENT
0
Entering edit mode
13 months ago
Ben Moore ★ 2.4k

Hi pingu77,

It's not possible to convert gene IDs between different assemblies with BioMart. Instead, you can use the Ensembl ID History Convertor tool as either a web-based tool as a script:

[1] https://www.ensembl.org/Homo_sapiens/Tools/IDMapper [2] https://github.com/Ensembl/ensembl-tools/tree/release/110/scripts/id_history_converter

ADD COMMENT

Login before adding your answer.

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