Closed ixxmu closed 1 month ago
❝借助 circlize 把多个 GSEA 富集通路使用环形图进行展示,circGsea 函数封装在 GseaVis中。
# install.packages("devtools")
devtools::install_github("junjunlab/GseaVis")
先富集分析:
library(ggplot2)
library(org.Hs.eg.db)
library(clusterProfiler)
library(dplyr)
library(GseaVis)
# load test data
data(geneList, package="DOSE")
gse <- gseGO(geneList = geneList,
ont = "BP",
keyType = "ENTREZID",
OrgDb = org.Hs.eg.db)
gse <- setReadable(x = gse,OrgDb = org.Hs.eg.db,keyType = "ENTREZID")
df_gse <- data.frame(gse)
geneSetID <- sample(df_gse$ID,size = 5)
然后拿这个对象来绘图:
circGsea(object = gse,
geneSetID = geneSetID)
修改通路形式:
circGsea(object = gse,
geneSetID = geneSetID,
GoIDfacing = "bending.inside")
添加通路名称:
circGsea(object = gse,
geneSetID = geneSetID,
addDescription = T)
调整一下距离:
circGsea(object = gse,
geneSetID = geneSetID,
addDescription = T,
descripLength = 50,
descripShift = 1.5)
不弯曲显示:
circGsea(object = gse,
geneSetID = geneSetID,
addDescription = T,
descriptionFacing = "outside",
descripShift = 1.5)
修改背景色:
circGsea(object = gse,
geneSetID = geneSetID,
bgCol = circlize::rand_color(n = 5))
修改热图颜色:
circGsea(object = gse,
geneSetID = geneSetID,
htCol = c("#339933","#9933CC"))
修改曲线颜色:
circGsea(object = gse,
geneSetID = geneSetID,
htCol = c("#339933","#9933CC"),
curveCol = "#003399")
添加基因的排序,会比较慢一些:
circGsea(object = gse,
geneSetID = geneSetID,
addGeneRank = T)
换个显示样式:
circGsea(object = gse,
geneSetID = geneSetID,
type = "h")
添加点:
circGsea(object = gse,
geneSetID = geneSetID,
type = "h",
addPoints = T)
修改竖线的颜色:
circGsea(object = gse,
geneSetID = geneSetID,
type = "h",
segmentsCol = "#003366")
居中显示:
circGsea(object = gse,
geneSetID = geneSetID,
type = "m")
标记一些基因:
mgene <- sample(gse@gene2Symbol,size = 3)
circGsea(object = gse,
geneSetID = geneSetID,
markGene = mgene)
❝路漫漫其修远兮,吾将上下而求索。
欢迎加入生信交流群。加我微信我也拉你进 微信群聊 老俊俊生信交流群 (微信交流群需收取 20 元入群费用,一旦交费,拒不退还!(防止骗子和便于管理)) 。QQ 群可免费加入, 记得进群按格式修改备注哦。
老俊俊微信:
知识星球:
❝送你一个环形富集分析图 enrichCluster 关于非模式物种富集分析的使用 tidyCoverage 计算 bigwig 文件在目标区域的信号 桑基图加富集图一行代码出图? GEO 上传数据最新教程 试试 bulkRNA 做拟时序分析? ClusterGVis 绘制 lineplot 的优化 RNAseqQC 给你的数据来个全面的 QC 检查 如何 Pull Request 到 github 贡献你的代码 ggplot 添加分类型数据双坐标轴
https://mp.weixin.qq.com/s/FzfZm-qY6DDWGhBXtYqP_A