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.5.0 |
Built: | 2024-10-30 08:36:43 UTC |
Source: | https://github.com/bioc/iSEEpathways |
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.
FgseaEnrichmentPlot()
returns an object of class FgseaEnrichmentPlot
.
In addition, this class inherits all slots from its parent Panel class.
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.
x <- FgseaEnrichmentPlot(ResultName="fgsea", PathwayId="GO:0000002") x
x <- FgseaEnrichmentPlot(ResultName="fgsea", PathwayId="GO:0000002") x
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.
iSEEfgseaResults()
returns an object of class iSEEfgseaResults
.
This class inherits all its slots directly from its parent class iSEEpathwaysResults
.
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.
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
Kevin Rue-Albrecht
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")))
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 is a virtual class for storing a set of pathway analysis results.
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
.
This class inherits all its slots directly from its parent class DataFrame
.
Kevin Rue-Albrecht
showClass("iSEEpathwaysResults")
showClass("iSEEpathwaysResults")
An overview of the generics for accessing common pieces of information in pathway analysis results.
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
.
Kevin Rue-Albrecht
showMethods(pathwayType) showMethods(pathwaysList) showMethods(featuresStats)
showMethods(pathwayType) showMethods(pathwaysList) showMethods(featuresStats)
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
.
pathwaysResultsNames(object) pathwaysResults(object, name)
pathwaysResultsNames(object) pathwaysResults(object, name)
object |
A SummarizedExperiment object. |
name |
(Optional) Name of a single pathway analysis result name to extract.
Use |
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.
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")
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
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.
PathwaysTable()
returns an object of class PathwaysTable
.
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.
x <- PathwaysTable(ResultName="fgsea") x
x <- PathwaysTable(ResultName="fgsea") x
Simulates various pieces of data for the purpose of demonstration in vignettes and help pages.
simulateExampleData( n_pathways = 5000, n_features = 15000, n_samples = 8, pathway_sizes = 15:500 )
simulateExampleData( n_pathways = 5000, n_features = 15000, n_samples = 8, pathway_sizes = 15:500 )
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. |
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.
A list of three elements:
A named list of dummy pathways. Names represent pathway identifiers; values represent character vectors of feature identifiers.
A named numeric vector of dummy feature-wise statistics. Names represent feature identifiers; values represent 'scores' (e.g., log2 fold-change)
A SummarizedExperiment object that contains a count matrix with rownames and colnames.
set.seed(1) simulated_data <- simulateExampleData() head(lengths(simulated_data$pathwaysList)) head(simulated_data$featuresStat)
set.seed(1) simulated_data <- simulateExampleData() head(lengths(simulated_data$pathwaysList)) head(simulated_data$featuresStat)
An overview of the generics for embedding pathway analysis results into a SummarizedExperiment object, in a format compatible with iSEEpathways.
embedPathwaysResults(x, se, name, pathwayType, ...) embedPathwaysResultsMethods ## S4 method for signature 'data.frame' embedPathwaysResults(x, se, name, class, pathwayType, ...)
embedPathwaysResults(x, se, name, pathwayType, ...) embedPathwaysResultsMethods ## S4 method for signature 'data.frame' embedPathwaysResults(x, se, name, class, pathwayType, ...)
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 |
embedPathwaysResultsMethods
: Named character vector mapping keywords to class names designed to store pathway analysis results.
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.
embedPathwaysResults
returns an updated SummarizedExperiment object that contains the
embedded object.
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.
Kevin Rue-Albrecht
embedPathwaysResultsMethods showMethods(embedPathwaysResults)
embedPathwaysResultsMethods showMethods(embedPathwaysResults)