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