Entering edit mode
3.8 years ago
imaparna27
▴
20
Hi, I am trying to convert my whole list of deferentially expressed genes (DEG) to their respective HGNC symbols against ensembl ID that I have pre-defined in my table.
I referred to some biomart scripts, but seems I could only retrieve all genes mentioned in the ensembl and not according to my requirements.
dim(df)
[1] 56804 7
dim(G_list)
[1] 67180 3
Here's the code I am using-
library('biomaRt')
ensembl = useMart("ensembl",dataset="hsapiens_gene_ensembl")
genes = df$Ensembl_ID
G_list <- getBM(filters= "ensembl_gene_id", attributes= c("ensembl_gene_id",
"entrezgene_id", "hgnc_symbol"), values=genes, mart=ensembl)
I have my first column as Ensembl ID for DEG, against which I want to add gene symbols. How can I achieve this?
Thanks in advance!
Thanks a lot for your response. But, what I am trying to achieve here is, I want to specify a specific column of my data frame (in my case, df) as input, how can I do that?
Exactly the same. This function is vectorized so it'll work on every element of the vector you supply with
df$Ensembl_ID
I could finally solve this issue, all the syntax and steps given above are correct. I could not get desired results earlier due to Ensembl version issue in my Ensembl_IDs. I could correct that, by changing values to-