Convert GENCODE IDs to Ensembl - Ranged SummarizedExperiment
2
1
Entering edit mode
7.4 years ago
r_mvl ▴ 60

I have an expression set matrix with the rownames being what I think is a GENCODE ID in the format for example "ENSG00000000003.14" "ENSG00000000457.13" "ENSG00000000005.5" and so on.

I would like to convert these to gene_symbol but I am not sure of the best way to do so, especially because of the ".14" or ".13" which I believe is the version.

Should I first trim all IDs for what is after the dot and then use biomaRt to convert? if so, what is the most efficient way of doing it? Is there a better way to get to the gene_symbol?

Many thanks for you help

R biomart • 11k views
ADD COMMENT
0
Entering edit mode

you can try this database. It s super fast and accurate

https://biodbnet-abcc.ncifcrf.gov/db/db2db.php

ADD REPLY
2
Entering edit mode
7.4 years ago
r_mvl ▴ 60

Thanks! In the meantime I did this and seem to have worked. Although with larger sets I guess the sapply would be faster

df$ensembl_gene_id <- gsub('\\..+$', '', df$ensembl_gene_id)

library(biomaRt)
mart <- useDataset("hsapiens_gene_ensembl", useMart("ensembl"))
genes <- df$ensembl_gene_id
symbol <- getBM(filters = "ensembl_gene_id",
                attributes = c("ensembl_gene_id","hgnc_symbol"),
                values = genes, 
                mart = mart)
df <- merge(x = symbol, 
              y = df, 
              by.x="ensembl_gene_id",
              by.y="ensembl_gene_id")
ADD COMMENT
0
Entering edit mode

Can't argue with a working solution :)

ADD REPLY
1
Entering edit mode
7.4 years ago

Yes, you will likely need to trim off the version before merging with data from biomart, which will lack those. I don't know if it's the "most efficient" method, but at least a convenient and "good enough" one is:

> foo = as.character(c("ENSG00000000003.14", "ENSG00000000457.13", "ENSG00000000005.5"))
> fixed_names = sapply(strsplit(foo, ".", fixed=T), function(x) x[1])

You can replace foo with the row.names() accessor.

ADD COMMENT

Login before adding your answer.

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