Getting ENTREZ GENE IDs for data frame, any help?
1
0
Entering edit mode
3.1 years ago

Hello everyone, I need to make a gene enrichment analysis with clusterProfiler tool implemented in R. I have a gene list with only gene names in it. So far, I used these codes that I write right down below and I get a data frame with my gene names:

>View(Gaye_30mins)
> mydata=na.omit(Gaye_30mins)
> mydata2=t(mydata)
> mydata3=as.data.frame(mydata2)
> mydata4=gather(mydata3)
> mydata4=mydata3[-1]
> is.data.frame(mydata4)
[1] TRUE
> mydata5=gather(mydata4)
> mydata6=mydata5[-1]
> mydata7=unique(mydata6$value)
> mydata8=as.data.frame(mydata7)

I want to extract Entrez IDs for my genes from org.Hs.eg.db database. For that I used select function and had some problems. The kode I used for extracting ENTREZ GENE IDs was:

>mydata9=select(org.Hs.eg.db, keys = rownames(mydata8), columns = c("ENTREZID", "SYMBOL"), keytype = "ENTREZID")

But after I ran this kode, the values from my data got lost some of them was replaced with NAs and although the number of observations was the same the data frame I got after this kode was completely different from the data frame I started with. How can I extract Entrez IDs with select function from org.Hs.eg.db? Sorry for inconvenience, and thank you very much for the help, Mervenur

R gene Assembly • 508 views
ADD COMMENT
0
Entering edit mode
3.1 years ago
Basti ★ 2.0k

Hi, I would better use mapIds

mapIds(org.Hs.eg.db, rownames(mydata8), 'ENTREZID', 'SYMBOL')
ADD COMMENT

Login before adding your answer.

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