Package 'iSEEpathways'

Title: iSEE extension for panels related to pathway analysis
Description: This package contains diverse functionality to extend the usage of the iSEE package, including additional classes for the panels or modes facilitating the analysis of pathway analysis results. This package does not perform pathway analysis. Instead, it provides methods to embed precomputed pathway analysis results in a SummarizedExperiment object, in a manner that is compatible with interactive visualisation in iSEE applications.
Authors: Kevin Rue-Albrecht [aut, cre] , Thomas Sandmann [ctb] , Charlotte Soneson [aut] , Federico Marini [ctb] , Denali Therapeutics [fnd]
Maintainer: Kevin Rue-Albrecht <[email protected]>
License: Artistic-2.0
Version: 1.3.0
Built: 2024-06-30 03:30:56 UTC
Source: https://github.com/bioc/iSEEpathways

Help Index


The FgseaEnrichmentPlot class

Description

The FgseaEnrichmentPlot is a Panel subclass where each row represents a set of features (i.e., rows). Selections in this panel can be transmitted to other row-oriented panels.

Value

FgseaEnrichmentPlot() returns an object of class FgseaEnrichmentPlot.

In addition, this class inherits all slots from its parent Panel class.

Slot overview

The following slots control the test procedure:

  • ResultName, a character scalar indicating the name of the pathway analysis result to display.

  • PathwayId, a character scalar indicating the identifier of the pathway to display.

  • BrushData, a list containing a Shiny brush along the x-axis (see ?brushedPoints). Defaults to an empty list, i.e., no brush or lasso.

Examples

x <- FgseaEnrichmentPlot(ResultName="fgsea", PathwayId="GO:0000002")
x

The iSEEfgseaResults class

Description

The iSEEfgseaResults class is used to provide an common interface to pathway analysis results produced by the fgsea package. It provides methods to access the set of features in each pathway.

Value

iSEEfgseaResults() returns an object of class iSEEfgseaResults.

Slot overview

This class inherits all its slots directly from its parent class iSEEpathwaysResults.

Constructor

iSEEfgseaResults(data, pathwayType, pathwaysList = NULL, featuresStats = NULL) creates an instance of a iSEEfgseaResults class, with:

data

A data.frame produced by fgsea::fgsea().

pathwayType

A character scalar specifying the type of pathway (e.g., "GO"). See embedPathwaysResults.

pathwaysList

A named list of pathways and associated feature identifiers.

featuresStats

Feature-level statistics used in the pathway analysis.

Supported methods

In the following code snippets, x is an instance of a iSEEfgseaResults class. Refer to the documentation for each method for more details on the remaining arguments.

  • embedPathwaysResults(x, se, name, pathwayType, ...) embeds x in se under the identifier name. See embedPathwaysResults() for more details.

  • pathwaysList(x) returns the named list of pathway identifiers and associated

Author(s)

Kevin Rue-Albrecht

Examples

library("fgsea")

##
# Simulate example data
##

simulated_data <- simulateExampleData(n_pathways = 5, n_features = 100, pathway_sizes = 15:100)

pathways_list <- simulated_data$pathwaysList
features_stats <- simulated_data$featuresStat
se <- simulated_data$summarizedexperiment

##
# Run pathway analysis ----
##

set.seed(42)
fgseaRes <- fgsea(pathways = pathways_list,
                  stats    = features_stats,
                  minSize  = 15,
                  maxSize  = 500)
head(fgseaRes[order(pval), ])

##
# iSEEfgseaResults ----
##

# Embed the FGSEA results in the SummarizedExperiment object
se <- embedPathwaysResults(fgseaRes, se, name = "fgsea", class = "fgsea",
  pathwayType = "simulated", pathwaysList = pathways_list, featuresStats = features_stats)
se

##
# Access ----
##

pathwaysResultsNames(se)
pathwaysResults(se)
pathwaysResults(se, "fgsea")

pathwayType(pathwaysResults(se, "fgsea"))
head(lengths(pathwaysList(pathwaysResults(se, "fgsea"))))
head(featuresStats(pathwaysResults(se, "fgsea")))

The iSEEpathwaysResults class

Description

The iSEEpathwaysResults is a virtual class for storing a set of pathway analysis results.

Value

In the following code snippets, x is an instance of a iSEEpathwaysResults class. Refer to the documentation for each method for more details on the remaining arguments.

  • pathwayType(x) returns the type of pathways stored in x.

Slot overview

This class inherits all its slots directly from its parent class DataFrame.

Author(s)

Kevin Rue-Albrecht

Examples

showClass("iSEEpathwaysResults")

Generics for Pathway Analysis Results

Description

An overview of the generics for accessing common pieces of information in pathway analysis results.

Value

pathwayType(x) returns a character scalar indicating the type of pathways analysed.

pathwaysList(x) returns the named list of pathways used in the analysis, or NULL.

featuresStats(x) returns the named numeric vector of feature-level statistics used in the analysis, or NULL.

Author(s)

Kevin Rue-Albrecht

Examples

showMethods(pathwayType)
showMethods(pathwaysList)
showMethods(featuresStats)

Extract contrast results embedded in a SummarizedExperiment object

Description

pathwaysResults returns either all pathway analysis results stored in object or a single pathway analysis result by name.

pathwaysResultsNames returns the names of pathway analysis results embedded in object.

Usage

pathwaysResultsNames(object)

pathwaysResults(object, name)

Arguments

object

A SummarizedExperiment object.

name

(Optional) Name of a single pathway analysis result name to extract. Use pathwaysResultsNames(object) to list available names.

Value

For pathwaysResultsNames: the names of embedded contrast results available.

For pathwaysResults: a list of differential expression statistics.

If name is missing, pathwaysResults returns a list in which each item contains the results of a single pathway analysis. If name is given, pathwaysResults returns a DataFrame that contains the results of a single pathway analysis.

Examples

library("fgsea")

##
# Simulate example data
##

simulated_data <- simulateExampleData(n_pathways = 5, n_features = 100, pathway_sizes = 15:100)

pathways_list <- simulated_data$pathwaysList
features_stats <- simulated_data$featuresStat
se <- simulated_data$summarizedexperiment

##
# Run pathway analysis ----
##

set.seed(42)
fgseaRes <- fgsea(pathways = pathways_list,
  stats    = features_stats,
  minSize  = 15,
  maxSize  = 500)
head(fgseaRes[order(pval), ])

##
# iSEEfgseaResults ----
##

se <- embedPathwaysResults(fgseaRes, se, name = "fgsea", class = "fgsea", pathwayType = "GO",
  pathwaysList = pathways_list, featuresStats = features_stats)

##
# List result names ---
##

pathwaysResultsNames(se)

##
# Extract results ---
##

pathwaysResults(se)
pathwaysResults(se, "fgsea")

The PathwaysTable class

Description

The PathwaysTable is a Panel where each row represents a set of features (i.e., rows). Selections in this panel can be transmitted to other row-oriented panels.

Value

PathwaysTable() returns an object of class PathwaysTable.

Slot overview

The following slots control the test procedure:

  • ResultName, a character scalar indicating the name of the pathway analysis result to display.

In addition, this class inherits all slots from its parent Table and Panel class.

Examples

x <- PathwaysTable(ResultName="fgsea")
x

Simulate Example Data

Description

Simulates various pieces of data for the purpose of demonstration in vignettes and help pages.

Usage

simulateExampleData(
  n_pathways = 5000,
  n_features = 15000,
  n_samples = 8,
  pathway_sizes = 15:500
)

Arguments

n_pathways

integer scalar, number of pathways to simulate.

n_features

integer scalar, number of features to simulate.

n_samples

integer scalar, number of samples to simulate.

pathway_sizes

integer vector, possible sizes of pathway to sample from.

Details

At least for the time being, this function generates dummy data purely for the purpose of demonstrating the format of expected inputs.

As such, the independent pieces of simulated data are just that – independent – in the meaning that simulated counts, statistics, and pathways are not related numerically, and do not make any biological sense.

The only coherent piece of information is the set of feature identifiers, carefully coordinated between the rownames of the count matrix, the names of the feature statistics, and the set of features in the list of pathways, so that panels in the app can transmit and interpret that shared piece of information.

Value

A list of three elements:

pathwaysList

A named list of dummy pathways. Names represent pathway identifiers; values represent character vectors of feature identifiers.

featuresStat

A named numeric vector of dummy feature-wise statistics. Names represent feature identifiers; values represent 'scores' (e.g., log2 fold-change)

summarizedexperiment

A SummarizedExperiment object that contains a count matrix with rownames and colnames.

Examples

set.seed(1)
simulated_data <- simulateExampleData()
head(lengths(simulated_data$pathwaysList))
head(simulated_data$featuresStat)

Generics for Embbedding Pathway Analysis Results into a SummarizedExperiment Object

Description

An overview of the generics for embedding pathway analysis results into a SummarizedExperiment object, in a format compatible with iSEEpathways.

Usage

embedPathwaysResults(x, se, name, pathwayType, ...)

embedPathwaysResultsMethods

## S4 method for signature 'data.frame'
embedPathwaysResults(x, se, name, class, pathwayType, ...)

Arguments

x

Object to be embedded.

se

A SummarizedExperiment object.

name

Identifier for the embedded object.

pathwayType

Character scalar indicating the type of pathway. See Details.

...

Arguments passed to individual constructors of pathway analysis result classes.

class

Class to use for embedding x. Only used when class(x) does not uniquely identify the package that generated the object x.

Format

embedPathwaysResultsMethods: Named character vector mapping keywords to class names designed to store pathway analysis results.

Details

The argument ⁠pathwayType=⁠ is used to identify the function mapping a certain type of pathway identifier to the corresponding feature identifiers. Pathway mapping functions must be registered as a named list using registerAppOptions(se, Pathways.map.functions = list(...)), where the name matching pathwayType identifies the function to use to map pathway identifiers to feature identifiers in a given pathway analysis result, e.g.

library(org.Hs.eg.db)
map_GO <- function(pathway_id) {
  mapIds(org.Hs.eg.db, pathway_id, "ENSEMBL", keytype = "GOALL", multiVals = "CharacterList")[[pathway_id]]
}
se <- registerAppOptions(se, Pathways.map.functions = list(GO = map_go))

See vignette("integration", package = "iSEEpathways") for examples.

Value

embedPathwaysResults returns an updated SummarizedExperiment object that contains the embedded object.

Definitions

  • embedPathwaysResults(x, se, name, pathwayType, ...) embeds the results x in the SummarizedExperiment se under the key name; pathwayType is a character scalar required to identify a function mapping a pathway identifier to asssociated feature identifiers; additional named arguments in ... are passed to the constructor of the pathway results class.

Author(s)

Kevin Rue-Albrecht

Examples

embedPathwaysResultsMethods

showMethods(embedPathwaysResults)