plotForest: Plot pathway forest plot from pathway/geneset/meta analysis...

View source: R/plot-forest.R

plotForestR Documentation

Plot pathway forest plot from pathway/geneset/meta analysis results

Description

pathways heatmap plot from pathway/geneset/meta analysis results.

Usage

plotForest(
  resultsList,
  yAxis = c("ID", "name"),
  statLims = c(-2.5, 2.5),
  useFDR = TRUE,
  selectedPathways = NULL
)

Arguments

resultsList

A named list of dataframes from pathway analysis, geneset analysis, and/or meta analysis results. The columns are ID, name, description, p.value, pFDR, size, nDE, score and normalizedScore.

yAxis

The column to use for the y-axis.

statLims

A numeric vector of length 2 specifying the limits for score to use in the x-axis.

useFDR

Logical to indicate whether to use FDR or p-value.

selectedPathways

A vector of pathways ID, which is in the same format as ID column in the pathway analysis result, to be included in the plot. If it is NULL, all pathways will be included.

Value

A ggplot2 object for presenting the heatmap of the pathways.

Examples


library(RCPA)
affyFgseaResult <- loadData("affyFgseaResult")
agilFgseaResult <- loadData("agilFgseaResult")
RNASeqFgseaResult <- loadData("RNASeqFgseaResult")
metaPAResult <- loadData("metaPAResult")

PAResults <- list(
    "Affymetrix - GSE5281" = affyFgseaResult,
    "Agilent - GSE61196" = agilFgseaResult,
    "RNASeq - GSE153873" = RNASeqFgseaResult,
    "Meta-analysis" = metaPAResult
)

selectedPathways <- c("path:hsa05010", "path:hsa05012", "path:hsa05014", "path:hsa05016",
                      "path:hsa05017", "path:hsa05020", "path:hsa05022", "path:hsa04724",
                      "path:hsa04727", "path:hsa04725", "path:hsa04728", "path:hsa04726",
                      "path:hsa04720", "path:hsa04730", "path:hsa04723", "path:hsa04721",
                      "path:hsa04722")
resultsToPlot <- lapply(PAResults, function(df) df[df$ID %in% selectedPathways,])

plotObj <- RCPA::plotForest(resultsToPlot, yAxis = "name", statLims = c(-3.5, 3.5))



RCPA documentation built on July 3, 2024, 5:08 p.m.