一次运行

  1. ## complete MSigDB module
  2. data_msigdb <- runMSigDB(
  3. data_gse,
  4. dir = "msigdb_out",
  5. prefix = "5-runMSigDB",
  6. top = 10
  7. )

分解动作

数据获取

  1. data_msigdb <- msigdbGet(data_gse)

富集分析

  1. ## run Hyper of MSigDB
  2. data_msigdb <- gseMSigDB(data_msigdb)
  3. ## run GSEA of MSigDB
  4. data_msigdb <- hyperMSigDB(data_msigdb)

GSVA

  1. ## run GSVA
  2. data_msigdb <- gsvaResolve(data_msigdb)

结果整理

  1. ## summary results
  2. dir = "out_msigdb"
  3. prefix = "5-runMSigDB"
  4. top = 10
  5. MSigDBSummary(data_msigdb, dir = dir, prefix = prefix,top =top)

结果提取

GSVA分数矩阵

  1. ## score matrix
  2. gsvares <- msigdbGSVAresult(data_msigdb)[["GSVA_matrix"]][["H"]]
  3. pdf_file = "GSVA_heatmap.pdf"
  4. ac=data.frame(Groups=groupInfo(data_msigdb))
  5. rownames(ac)=sampleNames(data_msigdb,filtered = T)
  6. pheatmap::pheatmap(gsvares,
  7. annotation_col = ac,
  8. filename = pdf_file)

GSVA差异分析结果

  1. ## gsva deg results
  2. gsvadiff <- msigdbGSVAresult(data_msigdb)[["GSVA_diff"]][["H"]]
  3. volcano_file = "GSVA_volcano.pdf"
  4. p <- PointVolcano(object = data_msigdb,which = "MSigDB",category = "H",gene = 5,expend = c(0.4,0.4))
  5. ggplot2::ggsave(p,filename = volcano_file, width = 1600,height = 1600,units = "px",limitsize = FALSE,device = cairo_pdf)