R语言ENTREZID ID 转换 gene SYMBOL

library(data.table)
library(org.Hs.eg.db)
library(clusterProfiler)

setwd("example")
 
dt <- read.table("VanAllen.self_subtract", sep = "\t", header = T)
dt$geneid <- rownames(dt)

# transform id  
map_dt <- bitr(dt$geneid, fromType = "ENTREZID",toType = c( "SYMBOL"),OrgDb = org.Hs.eg.db)
dt_merge <- merge(map_dt,dt, by.y = "geneid", by.x = "ENTREZID")
rownames(dt_merge) <- dt_merge$SYMBOL
dt_merge$SYMBOL <- NULL
dt_merge$ENTREZID <- NULL

# write out
write.table(dt_merge, file = "example42.txt", sep = "\t", col.names = T, row.names = T, quote = F)

 

你可能感兴趣的:(R语言ENTREZID ID 转换 gene SYMBOL)