Chapter 3 Universal enrichment analysis

ClusterProfiler支持多种基因GO富集分析和和超几何检验,但是不能用于不支持的物种以及slim版本的以及新颖的功能注释(如GO通过BlastGO和KEGG通过KAAS来分析其数据)。

ClusterProfiler为超几何分布提供给了enricher函数,为基因富集提供了GEA分析功能,这些功能用户可以进行自定义。他们接受两个附加参数TERM2GENETERM2NAME. 前者是第一列具有Term ID 和第二列具有映射的基因名GENE的一个数据框;TERM2NAME是一个第一列具有Term ID 和第二列具有相应的Term的名字,后者是可选的。

3.1文件的输入

为了进行过量表达分析,需要的数据集的形式

  1. 包含基因ID的向量(Vector),这些基因可以通过差异获取(差异分析可以通过Deseq2包进行分析)

为了基因富集分析(Gsea Set Enricher Analysis)分析,需要对基因列表进行排序,DOSE提供了一个示例数据集geneList,这个数据集来自于R包中的数据集breastCancerMAINZ,其中包含200个样本,其中1级包含29个样本,2级包含136个样本和3级包含35个样本。这个geneList是作者通过计算2级样本与3级样本几何平均值的对数比。

  1. geneList 包含的三个元素

数值向量

基因名向量

排序向量(包数字按照降序排列)

形如

自己准备的文件的数据的提示

包含两列,一列是基因的ID(不能包含有重复ID),另一列是是基因的差异值(通常是Log2FC)

利用命令行进行数据的处理

d <- read.csv(your_csv_file)
## assume that 1st column is ID
## 2nd column is fold change

## 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)

将样本装在进入R可以使用DOSE()函数,命令如下

data(geneList,package="DOSE")

head(geneList)

选择基因的变异倍数大于2的基因用于下一步的分析

gene=names(geneList)[abs(geneList)>2]

head(gene)

3.2维基通路分析(WikiPathways analysis)

WikiPathways 是一个不断更新的通路的数据库,可以在data.wikipathways.org网站上下载相关的通路数据,主要是gmt数据,它里面含有多个物种 ,可以根据自己的需要进行下载,2020年一月份的人的gmt文件如下

选择合适的gmt文件后,然后产生TERM2GENETERM2NAME这两个文件进行后续的enricher分析和GSEA功能分析。

library(magrittr)

library(clusterProfiler)

data(geneList, package="DOSE")

gene <- names(geneList)[abs(geneList) > 2]

wpgmtfile <- system.file("extdata/wikipathways-20180810-gmt-Homo_sapiens.gmt", package="clusterProfiler")

wp2gene <- read.gmt(wpgmtfile)

wp2gene <- wp2gene %>% tidyr::separate(ont, c("name","version","wpid","org"), "%") ##将下载的未分割的文本进行分割,按照%进行分割,并分别进行命名如c()里面的内容,   %>%主要是将后面的结果传递到前面

wpid2gene <- wp2gene %>% dplyr::select(wpid, gene) #TERM2GENE选择wpid和gene作为TERM2GENE

wpid2name <- wp2gene %>% dplyr::select(wpid, name) #TERM2NAME 选择wpid和name作为TERM2NAME

ewp <- enricher(gene, TERM2GENE = wpid2gene, TERM2NAME = wpid2name)

head(ewp)

ewp2 <- GSEA(geneList, TERM2GENE = wpid2gene, TERM2NAME = wpid2name, verbose=FALSE)

head(ewp2)

得到的结果是包含有ID ,Description,GeneRatio ,BgRatio, pvalue ,p.adjust,qvalue,GeneID的列的数据

如下

通过以下代码将gene ENTREZID转化成GeneSymbol

library(org.Hs.eg.db)
ewp <- setReadable(ewp, org.Hs.eg.db, keyType = "ENTREZID")
ewp2 <- setReadable(ewp2, org.Hs.eg.db, keyType = "ENTREZID")
head(ewp)

3.3Cellular marker(细胞标记物)

cell_markers <- vroom::vroom('http://bio-bigdata.hrbmu.edu.cn/CellMarker/download/Human_cell_markers.txt') %>% tidyr::unite("cellMarker", tissueType, cancerType, cellName, sep=", ")%>%                                                                              dplyr::select(cellMarker, geneID) %>%                                                                                                                                               dplyr::mutate(geneID = strsplit(geneID, ', '))

cell_markers

y <- enricher(gene, TERM2GENE=cell_markers, minGSSize=1)
DT::datatable(as.data.frame(y))

3.43.4 MSigDb analysis

Users can download GMT files from Broad Institute and use read.gmt to parse the file to be used in enricher() and GSEA().

用户可以使用GMT文件,利用read,gmt来读取文件,用于后续的enricher()和GSEA()函数分析

R package, msigdbr, that already packed the MSigDB gene sets in tidy data format that can be used directly with clusterProfiler

.

3Y叔的clusterProfiler-book阅读Chapter 3 Universal enrichment analysis相关推荐

  1. 2Y叔的clusterProfiler-book阅读Chapter 2 Functional Enrichment Analysis Methods

    第二章Chapter 2 Functional Enrichment Analysis Methods 2.1DEG后的基因富集分析 Y叔讲到DEG后的基因富集分析,p值的通过超几何分布计算出来的 其 ...

  2. 5Y叔的clusterProfiler-book阅读 Chapter 5 Gene Ontology Analysis

    计划在年前回家前完成此资料的学习,前几日耽搁的多了些,这两日还是得抽空把这个看完,然后继续学习机器学习相关的内容...... 5.1 Supported organisms GO分析(GroupGO( ...

  3. 6Y叔的clusterProfiler-book阅读 Chapter 6 KEGG analysis

    Chapter 6 KEGG analysis 注释包KEGG.db自2012年起就没有进行过更新,并且在clusterProfiler中,richKEGG(用于KEGG路径分析)richMKEGG( ...

  4. 【生信分析】clusterProfiler: universal enrichment tool for functional and comparative study(3)

    clusterProfiler: universal enrichment tool for functional and comparative study ClusterProfiler: 用于功 ...

  5. 【论文阅读】Graphonomy: Universal Human Parsing via Graph Transfer Learning通过图迁移学习进行的通用人体解析

    Problem问题 人体解析是指将在图像中捕获的人分割成多个语义上一致的区域,例如, 身体部位和衣物.作为一种细粒度的语义分割任务,它比仅是寻找人体轮廓的人物分割更具挑战性. 人体解析对于以人为中心的 ...

  6. 阅读笔记:Universal Domain Adaptation through Self-Supervision

    paper: https://arxiv.org/pdf/2002.07953.pdf code: https://github.com/VisionLearningGroup/DANCE 参考请引用 ...

  7. Chapter 17 Causal Survival Analysis

    文章目录 17.1 Hazards and risks 17.2 From hazards to risks 17.3 Why censoring matters 17.4 IP weighting ...

  8. PAPR论文阅读笔记1之Performance Analysis of Deliberately Clipped OFDM Signals

    论文里的公式(11) Pout=(1−e−γ2)PinP_{\textrm{out}}=(1-e^{-\gamma^2})P_{\textrm{in}}Pout​=(1−e−γ2)Pin​ 根据公式( ...

  9. R 实战 | 使用clusterProfiler进行多组基因富集分析

    R 实战 | 使用clusterProfiler进行多组基因富集分析 clusterProfiler这个包我就不再介绍了,网上关于用这个包做的基础的富集分析的教程已经非常多了,今天主要介绍一下使用co ...

最新文章

  1. PHP date函数参数详解
  2. nginxmysql负载均衡,神操作!
  3. 反反复复的磁盘丢失故障处理过程
  4. 计算机组成原理节拍分为几种,计算机组成原理习题答案第七章
  5. 设定asp服务器外部组件对象的方法是,ASP 3.0对ASP 2.0的改进
  6. centos6.3 mysql安装_CentOS 6.3 安装MySQL-5.7.10
  7. 广义线性模型python
  8. P2342 叠积木 并查集
  9. skyWalking相关
  10. 转载:ecCodes 学习 利用ecCodes Python API对GRIB文件进行读写
  11. 虚拟机2008安装DHPC服务器,Windows Server 2008 配置DHCP服务器
  12. oracle用户常见job权限不足,JOB调用的权限问题
  13. 属性动画Android动画,Android动画(三)属性动画Animator与Interpolator
  14. Python:loc和iloc的区别
  15. P4315 月下“毛景树” (树链剖分)
  16. Java生鲜电商平台-小程序或者APP优惠券的设计与源码实战
  17. 内容运营是什么?怎么拉动用户增长
  18. ASP.NET视频教程_ASP.NET软件工程师IT高端培训
  19. vue自定义指令之防抖函数
  20. AD18层次原理图绘制

热门文章

  1. RMAN 系列(四) ---- RMAN 备份
  2. 奇门遁甲鸣法 第四章 正格
  3. 转载:Windows Mobile 开发资源(精)
  4. 上班一族“黑话”辞典大曝光
  5. winscp怎么更改linux权限,Linux下,WinSCP普通用户登录sftp后切换到root权限 教程
  6. LeetCode从读题到自闭:1. 两数之和
  7. glibc之pthread_mutex_t/pthread_cond_t实现原理(十七)
  8. android手机误删通讯录恢复
  9. android audio混音
  10. 没有博士学位,照样玩转TensorFlow深度学习