Title: | Advanced Pathway Enrichment Analysis Representation |
---|---|
Description: | Simplify pathway enrichment analysis results by detecting clusters of similar pathways and visualizing it as an enrichment network, where nodes and edges describe the pathways and similarity between them, respectively. This reduces the redundancy of the overlapping pathways and helps to notice the most important biological themes in the data (Kerseviciute and Gordevicius (2023) <doi:10.1101/2023.03.28.534514>). |
Authors: | Ieva Kerseviciute [aut, cre] , Juozas Gordevicius [ths] , VUGENE, LLC [cph, fnd] |
Maintainer: | Ieva Kerseviciute <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2025-01-10 07:36:38 UTC |
Source: | https://github.com/cranhaven/cranhaven.r-universe.dev |
A list with parameters for customizing how the clusters within the enrichment data are calculated.
aPEAR.methods
aPEAR.methods
An object of class aPEAR.methods.config
of length 5.
similarity: method for calculating similarity matrix between the pathways. Available methods: 'jaccard', 'cosine' and 'correlation'
cluster: method for detecting pathway clusters. Available methods: 'markov', 'hier'
and 'spectral'. Using 'spectral' method requires that you have the Spectrum
package installed
clusterName: method for selecting cluster names. Available methods: 'pagerank',
'hits', 'nes' and 'pval'. The 'pagerank' and 'hits' algorithms analyse the connectivity
within the cluster to detect the most important node. The 'nes' and 'pval' methods
use enrichment results to determine the most important node within the cluster: the 'nes'
method will choose the node with the maximum absolute enrichment score value and the
'pval' method will choose the node with the lowest p-value. When using the 'nes' and
'pval' methods, please specify which column in the data to use with the clusterNameColumn
parameter
clusterNameColumn: which column in the dataset should be used to select the cluster
title. Required when clusterName = 'nes'
and clusterName = 'pval'
minClusterSize: minimum cluster size (default: 2). Clusters with less elements than specified will be dropped
an object of class aPEAR.methods.config
# Display all default methods used by aPEAR aPEAR.methods # Update methods to use different similarity metric settings <- aPEAR.methods settings$similarity <- 'cosine' settings
# Display all default methods used by aPEAR aPEAR.methods # Update methods to use different similarity metric settings <- aPEAR.methods settings$similarity <- 'cosine' settings
A list with parameters for customizing the theme of the enrichment network plot.
aPEAR.theme
aPEAR.theme
An object of class aPEAR.theme.config
of length 9.
colorBy: which column in the data should be used to color the nodes in the enrichment network plot (default: 'NES')
nodeSize: which column in the data should be used to get the node size for the enrichment network plot (default: 'setSize')
innerCutoff: similarity cutoff for within-cluster nodes (default: 0.1). Decreasing this value results in greater connectivity within the nodes in the same cluster. For example, innerCutoff = 0 would display all connections within the same cluster.
outerCutoff: similarity cutoff for between-cluster nodes (default: 0.5). Decreasing this value results in greater connectivity between the nodes in different clusters. For example, outerCutoff = 0 would display all connections between different clusters.
colorType: how to colour the nodes: 'nes' - will center around 0 with blue min and red max, 'pval' - will use log transform on the colorBy column and adjust color range (default: 'nes')
pCutoff: adjust p-value colouring cutoff when using colorType = 'pval'
(default: -10)
drawEllipses: enable / disable ellipse drawing (default: FALSE)
fontSize: adjust cluster label font size (default: 3)
repelLabels: whether the cluster label positions should be corrected (default: FALSE)
an object of class aPEAR.theme.config
# Display the default theme configuration used by aPEAR aPEAR.theme # Update the theme to draw ellipses settings <- aPEAR.theme settings$drawEllipses <- TRUE settings
# Display the default theme configuration used by aPEAR aPEAR.theme # Update the theme to draw ellipses settings <- aPEAR.theme settings$drawEllipses <- TRUE settings
Creates an enrichment network plot. This function internally calls
findPathClusters
to obtain pathway clusters and then plotPathClusters
to create the enrichment network visualization.
enrichmentNetwork( enrichment, methods = aPEAR.methods, theme = aPEAR.theme, verbose = FALSE, ... )
enrichmentNetwork( enrichment, methods = aPEAR.methods, theme = aPEAR.theme, verbose = FALSE, ... )
enrichment |
a data.frame containing enrichment results |
methods |
object of class |
theme |
object of class |
verbose |
enable / disable log messages |
... |
additional parameters (see |
a ggplot2
object
?findPathClusters
, ?plotPathClusters
# Load libraries library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(geneList) # Perform enrichment using clusterProfiler enrich <- gseGO(geneList, OrgDb = org.Hs.eg.db, ont = 'CC') # Create enrichment network visualization with default parameters enrichmentNetwork(enrich@result) # Create enrichment network visualization with repelled labels and elipses enrichmentNetwork(enrich@result, repelLabels = TRUE, drawEllipses = TRUE)
# Load libraries library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(geneList) # Perform enrichment using clusterProfiler enrich <- gseGO(geneList, OrgDb = org.Hs.eg.db, ont = 'CC') # Create enrichment network visualization with default parameters enrichmentNetwork(enrich@result) # Create enrichment network visualization with repelled labels and elipses enrichmentNetwork(enrich@result, repelLabels = TRUE, drawEllipses = TRUE)
Calculates the clusters within the enrichment data based on pathway similarity.
findPathClusters(enrichment, methods = aPEAR.methods, verbose = FALSE, ...)
findPathClusters(enrichment, methods = aPEAR.methods, verbose = FALSE, ...)
enrichment |
a data.frame containing enrichment results |
methods |
methods for calculating the pathway clusters within the enrichment result (object of class aPEAR.methods; default: aPEAR.methods) |
verbose |
enable / disable log messages (default: FALSE) |
... |
additional parameters (see |
a list of two objects: sim
- pathway similarity matrix; and
clusters
- pathway clusters
a list of clusters and similarity matrix
# Load libraries library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(geneList) # Perform enrichment using clusterProfiler enrich <- gseGO(geneList, OrgDb = org.Hs.eg.db, ont = 'CC') # Obtain clusters within the enriched pathways using default parameters data <- findPathClusters(enrich@result) data$clusters # Obtain clusters within the enriched pathways using hierarchical clustering # and minClusterSize = 1 data <- findPathClusters(enrich@result, cluster = 'hier', minClusterSize = 1) data$clusters
# Load libraries library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(geneList) # Perform enrichment using clusterProfiler enrich <- gseGO(geneList, OrgDb = org.Hs.eg.db, ont = 'CC') # Obtain clusters within the enriched pathways using default parameters data <- findPathClusters(enrich@result) data$clusters # Obtain clusters within the enriched pathways using hierarchical clustering # and minClusterSize = 1 data <- findPathClusters(enrich@result, cluster = 'hier', minClusterSize = 1) data$clusters
Creates enrichment network plot.
plotPathClusters( enrichment, sim, clusters, theme = aPEAR.theme, verbose = FALSE, ... )
plotPathClusters( enrichment, sim, clusters, theme = aPEAR.theme, verbose = FALSE, ... )
enrichment |
a data.frame containing enrichment results |
sim |
similarity matrix of the enriched pathways |
clusters |
clusters of the enriched pathways |
theme |
object of class |
verbose |
enable / disable log messages |
... |
additional parameters (see |
a ggplot2
object
# Load libraries library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(geneList) # Perform enrichment using clusterProfiler enrich <- gseGO(geneList, OrgDb = org.Hs.eg.db, ont = 'CC') # Obtain clusters within the enriched pathways using default parameters data <- findPathClusters(enrich@result) # Create the enrichment network visualization using default parameters plotPathClusters(enrich@result, data$sim, data$clusters) # Create the enrichment network visualization with repelled labels and elipses plotPathClusters(enrich@result, data$sim, data$clusters, repelLabels = TRUE, drawEllipses = TRUE)
# Load libraries library(clusterProfiler) library(DOSE) library(org.Hs.eg.db) data(geneList) # Perform enrichment using clusterProfiler enrich <- gseGO(geneList, OrgDb = org.Hs.eg.db, ont = 'CC') # Obtain clusters within the enriched pathways using default parameters data <- findPathClusters(enrich@result) # Create the enrichment network visualization using default parameters plotPathClusters(enrich@result, data$sim, data$clusters) # Create the enrichment network visualization with repelled labels and elipses plotPathClusters(enrich@result, data$sim, data$clusters, repelLabels = TRUE, drawEllipses = TRUE)