###########安装
#install.packages('GOplot')
#install_github('wencke/wencke.github.io')
###########加载
library(GOplot)
data(EC)
head(EC$david)###DAVID富集分析结果
head(EC$genelist)###差异分析结果
###大家也可以根据上面的格式将自己的文件读入
circ <- circle_dat(EC$david, EC$genelist)#创建绘图对象
head(circ)
GOBar(circ, display = 'multiple',
title = 'Z-score coloured barplot', ##设置标题
zsc.col = c('firebrick3', 'white', 'royalblue3')##设置颜色
)
GOBar(subset(circ, category == 'BP'))##仅展示部分GO
GOBubble(circ, title="GOBubble plot",##设置标题
labels = 5,##-log(adj p-value)>5
ID = TRUE,##TRUE显示符合标准的GO term ID,FALSE显示GO term name
table.legend = TRUE, table.col = TRUE, ##右侧表格设置
bg.col = FALSE#背景颜色设置
)
GOBubble(circ, title = 'GOBubble plot', labels = 3,
colour = c('orange', 'darkred', 'gold'), ##颜色设置
display = 'multiple',##根据类别对图像进行分面处理
bg.col = TRUE#背景颜色设置
)
GOCircle(circ,
rad1=2, rad2=3,##内径、外径设置
zsc.col=c('firebrick3', 'white', 'royalblue3'),#z-score颜色设置
lfc.col=c('firebrick3', 'royalblue3'),##上调下调颜色设置
label.size=5,label.fontface='bold',##字体大小格式设置
table.legend=TRUE##右侧表格设置
)
$ GOCircle(circ, nsub = 5)###选择GO term 进行展示(即选取前n行展示)
$ IDs <- c('GO:0007507', 'GO:0001568', 'GO:0001944', 'GO:0048729', 'GO:0048514', 'GO:0005886', 'GO:0008092', 'GO:0008047')
GOCircle(circ, nsub = IDs)##用户自定义选择GO term 进行展示
head(EC$genes)
head(EC$process)
chord <- chord_dat(data = circ, genes = EC$genes)#生成带有选定基因列表的矩阵
chord <- chord_dat(data = circ, process = EC$process)#生成带有选定GO term列表的矩阵
chord <- chord_dat(data=circ, genes=EC$genes, process=EC$process)#构建数据
head(chord)
GOChord(chord, title="GOChord plot",#标题设置
space = 0.02, #GO term处间隔大小设置
limit = c(3, 5),#第一个数值为至少分配给一个基因的Goterm数,第二个数值为至少分配给一个GOterm的基因数
gene.order = 'logFC', gene.space = 0.25, gene.size = 5,#基因排序,间隔,名字大小设置
lfc.col=c('firebrick3', 'white','royalblue3'),##上调下调颜色设置
#ribbon.col=colorRampPalette(c("blue", "red"))(length(EC$process)),#GO term 颜色设置
ribbon.col=brewer.pal(length(EC$process), "Set3"),#GO term 颜色设置
)
GOHeat(chord[,-ncol(chord)], ##去除最后一列logFC
nlfc = 0,#定义logFC列的数量(默认值为0)
)
GOHeat(chord,
nlfc = 1,
fill.col = c('firebrick3', 'white','royalblue3')#颜色设置
)
GOCluster(data=circ, process=EC$process,#选择GO term
metric='euclidean',#选择距离度量方法
clust='average', #选择聚类方法
clust.by = 'term',#指定是否应该对基因表达模式或功能类别进行聚类。term(default) or logFC
term.width = 2,term.col=brewer.pal(length(EC$process), "Set3"),#GO term 宽度,颜色设置
nlfc=FALSE, lfc.col=c('firebrick3', 'white','royalblue3')#是否包含多个logFC列,颜色设置
)
l1 <- subset(circ, term == 'heart development', c(genes,logFC))
l2 <- subset(circ, term == 'plasma membrane', c(genes,logFC))
l3 <- subset(circ, term == 'tissue morphogenesis', c(genes,logFC))
GOVenn(l1,l2,l3,
lfc.col=c('firebrick3', 'white','royalblue3'),#logFC颜色设置
circle.col=brewer.pal(3, "Dark2"),#Venn颜色设置
label = c('heart development', 'plasma membrane', 'tissue morphogenesis')#标签设置
)
欢迎关注生信人
TCGA | 小工具 | 数据库 |组装| 注释 | 基因家族 | Pvalue
基因预测 |bestorf | sci | NAR | 在线工具 | 生存分析 | 热图
生信不死 | 初学者 | circRNA | 一箭画心| 十二生肖 | circos
舞台|基因组 | 黄金测序 | 套路 | 杂谈组装 | 进化 | 测序简史