背景知识
在上一步已经做好了GO分析和KEGG分析,记下来要对分析结果进行可视化。
加载环境
# 加载软件包
library(clusterProfiler)
# 此处出现载入程辑包:‘clusterProfiler’
#
# The following object is masked from ‘package:stats’:
#
# filter
# 我的解决办法是点一下stats包,让系统不预先加在stats包,等clusterProfile加载完成后
# 再重新加载stats包
library(org.Hs.eg.db)
library(ggplot2)
library(cowplot)
加载GO分析和KEGG分析的结果。
load(file = "clusterProfiler_result.Rda")
dir.create('figures') #创建图片存储结果文件夹
柱状图
########## 柱状图 ##########
tiff(file="figures/clusterProfiler_GO_barplot.tiff",#创建一个tiff图片
width = 35,height = 22,units ="cm",#宽和高,单位为厘米
compression="lzw",bg="white"