CellMarker enrichment analysis (CellMarker 富集分析)

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)

参考连接:你那一串差异基因,到底是在哪个组织、哪种细胞中富集?

此条目发表在R分类目录。将固定链接加入收藏夹。

CellMarker enrichment analysis (CellMarker 富集分析)》有4条回应

  1. 罗鑫说:

    群主,你有微信公众号没有,我想关注你,另外我也有些问题想咨询你,方便加个WX不,416891498

发表评论

邮箱地址不会被公开。 必填项已用*标注

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

Protected with IP Blacklist CloudIP Blacklist Cloud