setwd("C:/Users/daizao/Desktop/Single_Cell_Annotation")
library(magrittr)
library(vroom)
library(tidyverse)
library(clusterProfiler)
library(DT)
library(org.Hs.eg.db)
library(hash)
#cell-marker <- vroom("http://bio-bigdata.hrbmu.edu.cn/CellMarker/download/Human_cell_markers.txt")
CellMarker <- vroom("Human_cell_markers.txt")
CellMarker_table <- as.data.frame(CellMarker)
cellmarker_unite <-unite(CellMarker_table,"cellMarker",c("tissueType","cancerType","cellName"),sep=",")
temp <- as.tbl(cellmarker_unite)
temp1 <- dplyr::select(temp,cellMarker,geneID)
cell_marker <- mutate(temp1,geneID=strsplit(geneID,","))
#test data
data(geneList, package="DOSE")
gene <- names(geneList[abs(geneList)>2])
result <- enricher(gene, TERM2GENE=cell_marker, minGSSize=1)
bb <- bitr(as.data.frame(result)$geneID,fromType="ENTREZID",toType="SYMBOL",OrgDb="org.Hs.eg.db")
h=hash()
for (i in 1:nrow(bb)){.set(h,keys=bb[i,1],values=bb[i,2])}
dz <- as.data.frame(result)
for (i in 1:nrow(dz)){dz$geneID[i] <- as.list(values(h,as.data.frame(result)$geneID[i]))[[1]]}
DT::datatable(dz)
参考连接:你那一串差异基因,到底是在哪个组织、哪种细胞中富集?
群主,你有微信公众号没有,我想关注你,另外我也有些问题想咨询你,方便加个WX不,416891498
没有公众号,问的话就在博客吧
请问你的博客号是多少呢
这个网站就是我的博客