library(ReactomePA)
library(tidyverse)
library(data.table)
library(org.Hs.eg.db)
library(clusterProfiler)
library(biomaRt)
library(enrichplot)
# 基因名转换
gene_map <- select(org.Hs.eg.db, keys=rownames(Myo_DE), keytype="SYMBOL", columns=c("ENTREZID"))
Myo_DE$ENTREZID <- gene_map$ENTREZID
Myo_DE_select <- Myo_DE %>%
arrange(desc(avg_log2FC)) %>%
filter(avg_log2FC > 0.5)
geneList <- Myo_DE_select$avg_log2FC
names(geneList) <- Myo_DE_select$ENTREZID
#GSEA分析——GO
Go_gseresult <- gseGO(geneList, 'org.Hs.eg.db', keyType = "ENTREZID", ont="all", nPerm = 1000,
minGSSize = 10, maxGSSize = 1000, pvalueCutoff=1)
#GSEA分析——KEGG
KEGG_gseresult <- gseKEGG(geneList, nPerm = 1000, minGSSize = 10, maxGSSize = 1000, pvalueCutoff=1)
#GSEA分析——Reactome
Go_Reactomeresult <- gsePathway(geneList, nPerm = 1000, minGSSize = 10, maxGSSize = 1000, pvalueCutoff=1)
#波浪图
ridgeplot(Go_gseresult,10)
ridgeplot(KEGG_gseresult,10)
ridgeplot(Go_Reactomeresult,20)
gseaplot(Go_Reactomeresult,1,pvalue_table = TRUE)
gseaplot2(Go_Reactomeresult,1,pvalue_table = TRUE)
gseaplot2(Go_Reactomeresult, 1:4, pvalue_table = TRUE)
参考
https://zhuanlan.zhihu.com/p/373388304
网友评论