# ReactomePA试用

## 安装补充包

- conda activate clusterprofiler
- ~/dev/xray/xray -c ~/etc/xui2.json &
- wget -e “https_proxy=http://127.0.0.1:20809“ https://github.com/YuLab-SMU/ReactomePA/archive/refs/heads/master.zip -O ReactomePA-master.zip
- BiocManager::install(“reactome.db”)
- devtools::install_local(‘ReactomePA-master.zip’)

## 读入数据

差异基因分析

    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://occdn.limour.top/2289.html
Author
Limour
Posted on
September 2, 2022
Licensed under
分享壁纸一张，测试一下图床接口 Previous
让NPM面板只允许CDN回源IP访问 Next

#### Search

Keyword