展开

GSEA

最后发布时间 : 2023-05-09 15:17:59 浏览量 :

GSEA

d = read.csv(your_csv_file)
## assume 1st column is ID
## 2nd column is FC
## feature 1: numeric vector
geneList = d[,2]
## feature 2: named vector
names(geneList) = as.character(d[,1])
## feature 3: decreasing order
geneList = sort(geneList, decreasing = TRUE)
library(msigdf)
c2 <- msigdf.human %>% 
    filter(category_code == "c2") %>% select(geneset, symbol) %>% as.data.frame
library(clusterProfiler)
data(geneList, package="DOSE")
id = bitr(names(geneList), "ENTREZID", "SYMBOL", "org.Hs.eg.db")
geneList = geneList[names(geneList) %in% id[,1]]
names(geneList) = id[match(names(geneList), id[,1]), 2]
de <- names(geneList)[1:100]
x <- enricher(de, TERM2GENE = c2)
y <- GSEA(geneList, TERM2GENE = c2)
cnetplot(x, foldChange=geneList)  
gseaplot2(y, 1)

gseGO分析结果

图片alt

图片alt

  • enrichment score (ES):富集得分
  • NES: 归一化后富集分数