如何使用GOplot画一张精美的GO分析图
首先,我们打开R,用以下命令进行 G O p l o t 包的安装
install.packages('GOplot')#安装GOplot包
data(EC) #导入数据
head(EC$david)#查看数据结构
head(EC$genelist) #查看数据结构
circ <- circle_dat(EC$david, EC$genelist) #创建项目
head(circ)
接下来,我们先根据富集的GO条目及pvalue绘制一张带热度的条形图
GOBar(subset(circ, category == 'BP'))#bp类别条形图
GOBar(circ, display = 'multiple')#所有类别条形图
还可以绘制GO富集气泡图
GOBubble(circ, labels = 3) #气泡图
GOBubble(circ, title = 'Bubble plot', colour = c('orange', 'darkred', 'gold'), display = 'multiple', labels = 3) #改变气泡颜色
GOBubble(circ, title = 'Bubble plot with background colour', display = 'multiple', bg.col = T, labels = 3) #改变背景色
可以去除冗余的条目,将所有类别的气泡画在一张图上
reduced_circ <- reduce_overlap(circ, overlap = 0.75) GOBubble(reduced_circ, labels = 2.8)
另外,还可以绘制圈图
GOCircle(circ)
IDs <- c('GO:0007507', 'GO:0001568', 'GO:0001944', 'GO:0048729', 'GO:0048514', 'GO:0005886', 'GO:0008092', 'GO:0008047') #选择特定GO画圈图GOCircle(circ, nsub = IDs)
GOCircle(circ, nsub = 10) #选择相应数量Go画圈图
另外,我们还可以用图像展现特定的GO间的GO关系
EC$process
chord <- chord_dat(circ, EC$genes, EC$process) #建立矩阵
head(chord)
chord <- chord_dat(data = circ, genes = EC$genes) # 根据列表选择基因
chord <- chord_dat(data = circ, process = EC$process) # 根据列表选择进程
chord <- chord_dat(data = circ, genes = EC$genes, process = EC$process) # 画连线图
GOChord(chord, space = 0.02, gene.order = 'logFC', gene.space = 0.25, gene.size = 5)
GOChord(chord, limit = c(3, 0), gene.order = 'logFC') #只画参与3个以上进程的基因
chord <- chord_dat(circ, EC$genes, EC$process)
GOHeat(chord[,-8], nlfc = 0) #用热图展现
GOHeat(chord, nlfc = 1, fill.col = c('red', 'yellow', 'green')) #更改热图颜色
GOCluster(circ, EC$process, clust.by = 'logFC', term.width = 2) #展现GO聚类
GOCluster(circ, EC$process, clust.by = 'term', lfc.col = c('darkgoldenrod1', 'black', 'cyan1')) #GO聚类加热图
用韦恩图展现GO结果
l2 <- subset(circ, term == 'plasma membrane', c(genes,logFC))
l3 <- subset(circ, term == 'tissue morphogenesis', c(genes,logFC))
GOVenn(l1,l2,l3, label = c('heart development', 'plasma membrane', 'tissue morphogenesis'))