This is a test version of Biostars. For the public version, visit https://www.biostars.org.
converting transcript IDs (Ensembl) to gene symbols in R

I have a list of transcript IDs (Ensembl) and trying to get the gene symbols for all transcripts. so I might have some gene symbols repeated but that is not a problem. I tried to do in R for example using Biomart but did not manage. do you know how I can do it in R?

rna-seq

ashkan : Please do not delete threads that have received a comment/answer.

1 answer

You can do as following:

library(biomaRt)
# Set up the Ensembl BioMart connection
ensembl <- useEnsembl(biomart = "genes", dataset = "hsapiens_gene_ensembl")

# Example list of Ensembl transcript IDs
transcript_ids <- c("ENST00000489730","ENST00000505370","ENST00000608083")

# Retrieve gene IDs corresponding to the transcript IDs
result <- getBM(
  attributes = c("ensembl_transcript_id", "ensembl_gene_id","hgnc_symbol"),
  filters = "ensembl_transcript_id",
  values = transcript_ids,
  mart = ensembl
)

result
ensembl_transcript_id ensembl_gene_id hgnc_symbol
1       ENST00000489730 ENSG00000069812        HES2
2       ENST00000505370 ENSG00000197530        MIB2
3       ENST00000608083 ENSG00000097021       ACOT7

Log in to answer this question.