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!