ReactomePA试用

安装补充包

读入数据

差异基因分析

1
2
3
4
5
6
7
8
9
10
library(stringr)
library(org.Hs.eg.db)
DEG <- subset(readRDS('DEG.rds'), !grepl('pseudogene', gene_type) & baseMean > quantile(baseMean)['25%'] & padj < 0.05)
rownames(DEG) <- t(as.data.frame(str_split(DEG$gene_id, '\\.')))[,1]
allEntrez = clusterProfiler::bitr(rownames(DEG), fromType="ENSEMBL", toType="ENTREZID", OrgDb=org.Hs.eg.db)
DEG$ENSEMBL <- rownames(DEG)
lfc <- merge(data.frame(DEG), allEntrez, by="ENSEMBL")
lfc <- lfc[order(lfc$log2FoldChange, decreasing=TRUE),]
geneList <- lfc$log2FoldChange
names(geneList) <- lfc$ENTREZID
1
2
3
x <- readRDS('DEG_filer.rds')
rownames(x) <- t(as.data.frame(str_split(x$gene_id, '\\.')))[,1]
cand.entrez = clusterProfiler::bitr(rownames(x), fromType="ENSEMBL", toType="ENTREZID", OrgDb=org.Hs.eg.db)$ENTREZID

进行分析

ORA

1
2
3
4
5
set.seed(123)
pway = ReactomePA::enrichPathway(gene = cand.entrez)
pway = clusterProfiler::setReadable(pway, OrgDb=org.Hs.eg.db)
pway = enrichplot::pairwise_termsim(pway)
pway@result

GSEA

1
2
3
4
5
set.seed(123)
pwayGSE <- ReactomePA::gsePathway(geneList, eps = 0)
pwayGSE = clusterProfiler::setReadable(pwayGSE, OrgDb=org.Hs.eg.db)
pwayGSE = enrichplot::pairwise_termsim(pwayGSE)
pwayGSE@result

ReactomePA试用
https://b.limour.top/2001.html
Author
Limour
Posted on
September 2, 2022
Licensed under