Enrichment visualization¶
Module for EnrichmentScope object visualization
This module allows the user to extract and visualize information from EnrichmentScope object.
Here, it is possible to evaluate enrichment results with 1) dotplots, 2)heatmaps and 3) network analysis. Dotplots allows the visualization of statistical significance and size of dataset enriched (number_deps), and the number of up- and down-regulated proteins (number_deps). Heatmaps can be plotted according statistical significance and also protein foldchange; for GSEA analysis, the function gsea_heatmap plots the normalization enrichment score (NES) as color pattern. Finally, the network plots can be used to visualize shared proteins between pathways (enrichment_network()), or perform an enrichment map (enrichment_map()).
Additionally, some functions optionally show a specific Term while add the name as Args.
- omicscope.EnrichmentAnalysis.EnrichmentVisualization.dotplot(self, top=10, palette='BuPu', alpha=1, s=10, x_size=5, y_size=6, label_wrap=50, save=None, dpi=300, vector=True)[source]¶
Dotplot for enriched terms.
- Parameters:
top (int, optional) – top-N enriched terms to be visualized. Defaults to 10.
palette (str, optional) – color map to visualization, for more information https://matplotlib.org/stable/tutorials/colors/colormaps.html. Defaults to ‘BuPu’. For GSEA enrichment, we advise a divergent palette.
alpha (int, optional) – dots transparency. Defaults to 1.
s (int, optional) – dotsize. Defaults to 10.
x_size (int, optional) – Size of horizontal axis. Defaults to 5.
y_size (int, optional) – Size of vertical axis. Defaults to 6.
label_wrap (int, optional) – Label wrap. Defaults to 50.
save (str, optional) – Path to save figure. Defaults to None.
dpi (int, optional) – Resolution to save figure. Defaults to 300.
vector (bool, optional) – Save figure in as vector (.svg). Defaults to True.
- omicscope.EnrichmentAnalysis.EnrichmentVisualization.enrichment_map(self, *Terms, top=1000, modules=True, labels=False, similarity_cutoff=0.25, metric='jaccard', save=None, vector=True, dpi=300)[source]¶
Enrichment map.
Since several proteins are presented in more than one pathway, enrichment map shows pathway as nodes and the edge thickness is proportional to the amount of proteins shared between two terms (similarity score)
- Parameters:
top (int, optional) – Top terms used to construct network. Defaults to 1000.
modules (bool, optional) – Returns modularity analysis of Terms. Defaults to True.
labels (bool, optional) – Add Term labels to graph. Defaults to False.
similarity_cutoff (float, optional) – similarity score cutoff based on statistical analysis performed. Defaults to 0.25.
metric (str, optional) – statistical algorithm to perform pairwise comparison. Defaults to ‘jaccard’. Optionally, user can test other algorithm described in scipy.spatial.distance.
save (str, optional) – OmicScope saves networks as figure and Graphml files, which can be used in other network software (recommended). Defaults to None.
vector (bool, optional) – Save image as vector (.svg) Defaults to True.
dpi (int, optional) – Figure resolution. Defaults to 300.
- Returns:
Graph (NetworkX output) – Graph
- omicscope.EnrichmentAnalysis.EnrichmentVisualization.enrichment_network(self, *Terms, top=5, labels=False, term_color='#a1a1a1', foldchange_range=[-0.5, 0.5], save=None, vector=True, dpi=300)[source]¶
EnrichmentTerm-protein network.
Network visualization to find proteins that are shared by different enriched Terms.
- Parameters:
top (int, optional) – top N enriched terms to be visualized. Defaults to 5.
labels (bool, optional) – Show node labels. Defaults to False.
term_color (str, optional) – Color to plot pathways. Defaults to ‘#a1a1a1’.
foldchange_range (list, optional) – Fold change range to plot protein colors, such as a heatmap. Defaults to [-0.5, 0.5].
save (str, optional) – OmicScope saves networks as figure and Graphml files, which can be used in other network software (recommended). Defaults to None.
vector (bool, optional) – Save image as vector (.svg) Defaults to True.
dpi (int, optional) – Figure resolution. Defaults to 300.
- Returns:
Graph (NetworkX output) – Graph
- omicscope.EnrichmentAnalysis.EnrichmentVisualization.gsea_heatmap(self, *Terms, top=5, linewidths=0.01, save=None, dpi=300, vector=True)[source]¶
GSEA Heatmap Plot a heatmap with colors based on Normalized Enrichment Score (NES) reported by GSEA Analysis.
- Parameters:
save (str, optional) – Path to save figure. Defaults to None.
dpi (int, optional) – Resolution to save figure. Defaults to 300.
vector (bool, optional) – Save figure in as vector (.svg). Defaults to True.
- omicscope.EnrichmentAnalysis.EnrichmentVisualization.heatmap(self, *Terms, top=5, foldchange=False, x_size=5, linewidths=0.01, foldchange_range=[-0.5, 0.5], save=None, dpi=300, vector=True)[source]¶
Heatmap for enriched terms and proteins
- Parameters:
top (int, optional) – top N enriched terms to be visualized. Defaults to 5.
foldchange (bool, optional) – show the protein fold change. Defaults to False.
foldchange_range (list, optional) – Fold change range to plot protein colors, such as a heatmap. Defaults to [-0.5, 0.5].
save (str, optional) – Path to save figure. Defaults to None.
dpi (int, optional) – Resolution to save figure. Defaults to 300.
vector (bool, optional) – Save figure in as vector (.svg). Defaults to True.
- omicscope.EnrichmentAnalysis.EnrichmentVisualization.number_deps(self, *Terms, top=20, palette='RdBu', save=None, dpi=300, vector=True)[source]¶
Number of DEPs
Return number of down- and up-regulated proteins in top-N or specified pathways.
- Parameters:
top (int, optional) – top-N enriched terms to be visualized.
Defaults to 10.
palette (str, optional) – color map for up- and down-regulated
representations. Defaults to ‘RdBu’.
save (str, optional) – Path to save figure. Defaults to None.
dpi (int, optional) – Resolution to save figure. Defaults to 300.
vector (bool, optional) – Save figure in as vector (.svg). Defaults to True.