一次运行
## complete MSigDB module
data_msigdb <- runMSigDB(
data_gse,
dir = "msigdb_out",
prefix = "5-runMSigDB",
top = 10
)
分解动作
数据获取
data_msigdb <- msigdbGet(data_gse)
富集分析
## run Hyper of MSigDB
data_msigdb <- gseMSigDB(data_msigdb)
## run GSEA of MSigDB
data_msigdb <- hyperMSigDB(data_msigdb)
GSVA
## run GSVA
data_msigdb <- gsvaResolve(data_msigdb)
结果整理
## summary results
dir = "out_msigdb"
prefix = "5-runMSigDB"
top = 10
MSigDBSummary(data_msigdb, dir = dir, prefix = prefix,top =top)
结果提取
GSVA分数矩阵
## score matrix
gsvares <- msigdbGSVAresult(data_msigdb)[["GSVA_matrix"]][["H"]]
pdf_file = "GSVA_heatmap.pdf"
ac=data.frame(Groups=groupInfo(data_msigdb))
rownames(ac)=sampleNames(data_msigdb,filtered = T)
pheatmap::pheatmap(gsvares,
annotation_col = ac,
filename = pdf_file)
GSVA差异分析结果
## gsva deg results
gsvadiff <- msigdbGSVAresult(data_msigdb)[["GSVA_diff"]][["H"]]
volcano_file = "GSVA_volcano.pdf"
p <- PointVolcano(object = data_msigdb,which = "MSigDB",category = "H",gene = 5,expend = c(0.4,0.4))
ggplot2::ggsave(p,filename = volcano_file, width = 1600,height = 1600,units = "px",limitsize = FALSE,device = cairo_pdf)