一步运行

  1. ## complete GSEA module
  2. data_gse <- runGSEA(data_hyper,dir = "gse_out",
  3. GO = TRUE,
  4. KEGG = TRUE)

分步运行

计算

  1. ## step only resolve
  2. data_gse <- gseResolve(
  3. data_hyper,
  4. GO = FALSE,
  5. KEGG = TRUE)

结果整理

  1. ## step summary results
  2. gseSummary(
  3. data_gse,
  4. dir = "gse_out",
  5. prefix = "4-runGSEA",
  6. top = 10)

辅助工具

自定义GO注释的富集分析

  1. gseGO2(
  2. geneList,
  3. ont = "ALL",
  4. TERM2GENE,
  5. TERM2NAME = NA,
  6. organism = "UNKNOW",
  7. keyType = "SYMBOL",
  8. exponent = 1,
  9. minGSSize = 10,
  10. maxGSSize = 500,
  11. eps = 1e-10,
  12. pvalueCutoff = 0.05,
  13. pAdjustMethod = "BH",
  14. verbose = TRUE,
  15. seed = FALSE,
  16. by = "fgsea",
  17. ...
  18. )

可视化工具

gsea 图

  1. p_gsea_list <- GSEAplot(gsob,top = 10)
  2. down_plots_pdf <- "GO_limma_gseplot_down.pdf"
  3. pdf(down_plots_pdf,height = 3,width = 4)
  4. invisible(lapply(p_gsea_list[["down_plots"]], print))
  5. dev.off()

image.png

gse 柱状图

  1. gsob <- gseRes(data_gse)[["gseGO_res"]][["limma"]]
  2. p_gsegbar <- GSEAbar(gsob,top = 10)
  3. ggplot2::ggsave(p_gsegbar,filename = "gse_GO_bar.pdf", width = 3000,height = 3600,units = "px",limitsize = FALSE,device = cairo_pdf)

image.png