引言
复现最新一篇 Nature 期刊文章 Cancer-induced nerve injury promotes resistance to anti-PD-1 therapy 里的 GSEA 富集的图形。我们·使用 gseaVis 来复现试试。
GSEA 富集图:
安装
install.packages(“devtools”)
devtools::install_github(“junjunlab/GseaVis”)
测试
这里使用测试数据来展示:
library(GseaVis)
load data
test_data <- system.file(“extdata”, “gseaRes.RDS”, package = “GseaVis”)
gseaRes <- readRDS(test_data)
gseaRes.df <- data.frame(gseaRes)
multiplot
neg <- gseaRes.df %>%
dplyr::filter(NES <= -1 & pvalue < 0.05)
terms <- sample(neg$ID,4)
plot
lapply(terms, function(x){
gseaNb(object = gseaRes,
geneSetID = x,
curveCol = “#5EABD6”,
htHeight = 1,
htCol = c(“#1450A3″,”#8C1007”),
htAlpha = 0.8,
subRatio = c(0.5, 0.1, 0.3),
rankCol = “#FFC436”,
addPval = T,
pvalX = 0.9,pvalY = 0.8,
addZeroLine = T)
}) -> gseaList
combine
cowplot::plot_grid(plotlist = gseaList,ncol = 4,align = ‘hv’)
结尾
路漫漫其修远兮,吾将上下而求索。
欢迎加入生信交流群。加我微信我也拉你进 微信群聊老俊俊生信交流群(微信交流群需收取 20 元入群费用,一旦交费,拒不退还!(防止骗子和便于管理)) 。
声明:来自老俊俊的生信笔记,仅代表创作者观点。链接:https://eyangzhen.com/2407.html