[英]How to convert Entrez ids in a large list into gene symbols and replace entrez ids in list in R?
I have a large list data
with 300 names.我有一个包含 300 个名称的大型列表data
。 For eg:例如:
dput(data$name1)
c("55024", "29126", "3732", "1960", "79368", "115352", "10875",
"2530", "348654", "3070", "29969", "9124", "10125", "143686",
"6504", "25992", "26137")
dput(data$name2)
c("323", "836", "9976", "1407", "1840", "2289", "2317", "2739",
"8337", "10964", "3572", "3693", "4023", "4058", "124540", "4638",
"5214", "6238", "8115", "7049", "8459", "10791", "55884", "7494",
"7535")
df <- as.data.frame(data$name1)
colnames(df)[1] <- "ENTREZ_IDs"
library(clusterProfiler)
library(org.Hs.eg.db)
### Convert Entrez to Ensembl ids and Gene names
Ensembl_GeneNames <- bitr(df$ENTREZ_IDs, fromType = "ENTREZID",
toType = c("SYMBOL"),
OrgDb = org.Hs.eg.db)
This is the output I got:这是我得到的 output:
Now, I want to replace the ENTREZID of name1
in the large list data
with SYMBOL from the above output.现在,我想用上面 output 中的 SYMBOL 替换大列表data
中name1
的 ENTREZID。
Would like to do this for all names in the large list data
想对大列表data
中的所有名称执行此操作
We may loop over the list
and apply the bitr
我们可以遍历list
并应用bitr
out <- lapply(data, \(x) bitr(x, fromType = "ENTREZID",
toType = c("SYMBOL"),
OrgDb = org.Hs.eg.db)[['SYMBOL']])
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.