Nebula visualization¶
- omicscope.MultipleData.MultipleVisualization.barplot(self, save=None, vector=True, dpi=300)[source]¶
Barplot Bar plot for proteins/genes identified and differentially regulated according to each group
- Parameters:
save (str, optional) – Path to save image. Defaults to None.
vector (bool, optional) – If image should be export as .svg. Defaults to True.
dpi (int, optional) – Image resolution. Defaults to 300.
- omicscope.MultipleData.MultipleVisualization.circos_plot(self, vmax=1, vmin=-1, colormap='RdYlBu_r', colorproteins='darkcyan', colorenrichment='black', linewidth_heatmap=0.1, save=None, vector=True, dpi=300)[source]¶
- Circos plot
This plot offers an overview of proteins differentially regulated between groups using circular plots.
- Parameters:
vmin (int, optional) – minimum value for foldchange. Defaults to -1.
vmax (int, optional) – maximum value for foldchange. Defaults to 1.
colormap (str, optional) – Colormap for heatmap. Defaults to ‘RdBu_r’.
colorproteins (str, optional) – Color for protein links. Defaults to ‘darkcyan’.
colorenrichment (str, optional) – Color for enrichment links. Defaults to ‘black’.
save (str, optional) – Path to save file. Defaults to None.
vector (bool, optional) – Save as svg extension, if False, save as png. Defaults to True.
dpi (int, optional) – Figure resolution. Defaults to 300.
- omicscope.MultipleData.MultipleVisualization.circular_term(self, *Terms, pvalue=0.05, vmin=-1, vmax=1, colormap='RdBu_r', label_size=12, save=None, vector=True, dpi=300)[source]¶
- Circular term
Allows the visualization of all proteins related to a pre-specified term. This term is extracted from enrichment data.
- Parameters:
pvalue (float, optional) – Pvalue to consider differentially regulated proteins . Defaults to 0.05.
vmin (int, optional) – minimum value for foldchange. Defaults to -1.
vmax (int, optional) – maximum value for foldchange. Defaults to 1.
colormap (str, optional) – Colormap for heatmap. Defaults to ‘RdBu_r’.
save (str, optional) – Path to save file. Defaults to None.
vector (bool, optional) – Save as svg extension, if False, save as png. Defaults to True.
dpi (int, optional) – Figure resolution. Defaults to 300.
- Raises:
TypeError – Term/Terms was/were not found in dataset.
- omicscope.MultipleData.MultipleVisualization.diff_reg(self, save=None, vector=True, dpi=300)[source]¶
Dotplot
Dotplot for number of proteins up- and down-regulated in each group.
- Parameters:
save (str, optional) – Path to save image. Defaults to None.
vector (bool, optional) – If image should be export as .svg.
Defaults to True.
dpi (int, optional) – Image resolution. Defaults to 300.
- omicscope.MultipleData.MultipleVisualization.distribution_test(self, protein_pvalue, method)[source]¶
- This function performs a statistical analysis on protein data considering overlaps between groups. The function performs different statistical tests depending on the chosen method:
t-test (ttest): This test is used to compare the means of two groups assuming normally distributed data.
Wilcoxon signed-rank test (wilcoxon): This non-parametric test is used to compare two related groups when the data may not be normally distributed.
Kolmogorov-Smirnov test (ks): This test is used to compare the probability distributions of two samples.
- Parameters:
protein_pvalue (float) – The cut-off value for protein p-values.
method (str) – The statistical method to be used for comparison. Valid options include “ttest” (t-test), “wilcoxon” (Wilcoxon signed-rank test), and “ks” (Kolmogorov-Smirnov test).
comparison among groups considering t-test (for parametric distributions)
wilcoxon (for non-parametric distributions), and ks (kolmorov-smirnov test)
- Returns:
matrix (DataFrame, pandas) – P-value
- omicscope.MultipleData.MultipleVisualization.dotplot_enrichment(self, *Terms, top=5, fig_height=None, palette='PuBu', save=None, vector=True, dpi=300)[source]¶
Dotplot Enrichment
Dotplot to visualize together the enrichment data for each group
- Parameters:
top (int, optional) – Top N pathway to considered in each group. Defaults to 5.
palette (str, optional) – color palette. Defaults to ‘PuBu’.
fig_height (int, optional) – User optionally can define figure height. Defaults to None
save (str, optional) – Path to save image. Defaults to None.
vector (bool, optional) – If image should be export as .svg.
Defaults to True.
dpi (int, optional) – Image resolution. Defaults to 300.
- omicscope.MultipleData.MultipleVisualization.enrichment_overlap(self, min_subset=1, face_color='darkcyan', shad_color='#f0f0f0', edge_color='black', linewidth=1, save=None, vector=True, dpi=300)[source]¶
Upset plot Upset plot to evaluate enrichment terms overlap among groups.
- Parameters:
min_subset (int, optional) – minimum number of overlap size to consider for upset plot . Defaults to 10.
face_color (str, optional) – Bar and dot colors. Defaults to ‘darkcyan’.
shad_color (str, optional) – Shad color in the dot part of the graph. Defaults to “#f0f0f0”.
edge_color (str, optional) – edge colors. Defaults to ‘black’.
linewidth (int, optional) – line widths. Defaults to 1.
save (str, optional) – Path to save image. Defaults to None.
vector (bool, optional) – If image should be export as .svg. Defaults to True.
dpi (int, optional) – Image resolution. Defaults to 300.
- Raises:
IndexError – If there is no Enrichment data on .omics file.
- omicscope.MultipleData.MultipleVisualization.fisher_test(self, protein_pvalue, background_lenght)[source]¶
This function performs a pair-wise statistical analysis using Fisher’s exact test. Fisher’s exact test is a statistical test used to compare two nominal variables from two samples. In this context, it’s used to compare the proportions of proteins with significant p-values (determined by protein_pvalue) between groups.
- Parameters:
protein_pvalue (float) – The cut-off value for protein p-values.
background_lenght (float, optional) – The total number of entities in the background set (optional).
If not provided, all genes from the original data are used as the background (Recommended)
- Returns:
matrix (DataFrame, pandas) – P-value
- omicscope.MultipleData.MultipleVisualization.overlap_fisher(group1, group2, union)[source]¶
Perform a pair-wise comparison based on hypergeometric distribution.
- Parameters:
group1 (Series, pandas) – Column condition 1
group2 (Series, pandas) – Column condition 2
union (int) – number of whole entities evaluated in the study
among all conditions
- Returns:
Pvalue (float) – P-value
- omicscope.MultipleData.MultipleVisualization.protein_overlap(self, min_subset=10, face_color='darkcyan', shad_color='#f0f0f0', edge_color='black', linewidth=1, save=None, vector=True, dpi=300)[source]¶
Upset plot Upset plot to evaluate protein overlap among groups.
- Parameters:
min_subset (int, optional) – Minimum overlap size to consider for upset plot. Defaults to 10.
face_color (str, optional) – Bar and dot colors. Defaults to ‘darkcyan’.
shad_color (str, optional) – Shad color in the dot part of the graph. Defaults to “#f0f0f0”.
edge_color (str, optional) – edge colors. Defaults to ‘black’.
linewidth (int, optional) – line widths. Defaults to 1.
save (str, optional) – Path to save image. Defaults to None.
vector (bool, optional) – If image should be export as .svg. Defaults to True.
dpi (int, optional) – Image resolution. Defaults to 300.
- omicscope.MultipleData.MultipleVisualization.similarity_heatmap(self, pvalue=1, comparison_param='log2(fc)', metric='correlation', center=0, palette='RdYlBu_r', annotation=True, save=None, vector=True, dpi=300)[source]¶
- Similarity heatmap plot
Perform a pair-wise similarity analysis and plot a heatmap.
When utilizing the Jaccard similarity index, this function takes into account the shared ‘gene_name’ between groups. In contrast, for the other available options, the function considers either ‘TotalMean’ or ‘log2(fc)’ columns
- Parameters:
pvalue (int, optional) – P-value threshold to proteins that OmicScope must consider for analysis. Defaults to 1.
comparison_param (str, optional) – Parameter to take into account in pairwise comparison.
Defaults to ‘log2 (fc)
metric (str, optional) – algorithm to perform pairwise comparison. Defaults to ‘correlation’. Optionally, user can test other algorithm described in scipy.spatial.distance.
center (float, optional) – number to center the heatmap color gradient.
palette (str, optional) – color palette to plot heatmap. Defaults to ‘RdYlBu’.
save (str, optional) – Path to save image. Defaults to None.
vector (bool, optional) – If image should be export as .svg. Defaults to True.
dpi (int, optional) – Image resolution. Defaults to 300.
- omicscope.MultipleData.MultipleVisualization.similarity_network(self, pvalue=1, comparison_param='log2(fc)', metric='jaccard', absolute_similarity_cutoff=0.2, save=None, vector=True, dpi=300)[source]¶
Similarity Network plot
Perform a pairwise correlation analysis and create a graph where groups are depicted as nodes, and pairwise similarity indices serve as edges. In order to establish a connection between two groups, the function filters edges based on an absolute similarity cutoff, excluding edges that fall within a specified interval range, for instance, -0.2 to 0.2, when the absolute_similarity_cutoff is set to 0.2.
Furthermore, when utilizing the Jaccard similarity index, this function takes into account the shared ‘gene_name’ between groups. In contrast, for the other available options, the function considers either ‘TotalMean’ or ‘log2(fc)’ columns
- Parameters:
pvalue (int, optional) – P-value threshold to proteins that OmicScope must consider for analysis. Defaults to 1.
comparison_param (str, optional) – Parameter/column to take into account in pairwise comparison. Defaults to ‘log2(fc)’. Optionally ‘TotalMean’.
absolute_similarity_cutoff (float, optional) – Cuttoff to consider the links between groups. Since major similarity indexes have positive and negative values, the function expect an absolute value to perform cuttof. Defaults to 0.2 (which means -0.2 < cutoff< 0.2).
metric (str, optional) – algorithm to perform pairwise comparison. Defaults to ‘correlation’. Optionally, user can test other algorithm described in scipy.spatial.distance.
center (float, optional) – number to center the heatmap color gradient.
palette (str, optional) – color palette to plot heatmap. Defaults to ‘RdYlBu’.
save (str, optional) – Path to save image. Defaults to None.
vector (bool, optional) – If image should be export as .svg. Defaults to True.
dpi (int, optional) – Image resolution. Defaults to 300.
- omicscope.MultipleData.MultipleVisualization.stat_heatmap(self, palette='Spectral', method='fisher', pvalue=0.05, background_lenght=None, annotation=True, save=None, vector=True, dpi=300)[source]¶
Generates a heatmap visualization to represent the p-values from pair-wise statistical comparisons between groups.
- Parameters:
palette (str, optional) – The color palette to use for the heatmap. Defaults to “Spectral”.
method (str, optional) – The statistical method used for comparison between groups. Valid options include:
- “fisher”: Performs Fisher’s exact test, suitable for comparing
proportions of significant proteins.
“ttest”: Performs a t-test, assuming normally distributed data.
- “wilcoxon”: Performs a Wilcoxon signed-rank test, a non-parametric
alternative for related groups when normality cannot be assumed.
- “ks”: Performs a Kolmogorov-Smirnov test, used to compare the
probability distributions of two samples.
Defaults to “fisher”.
pvalue (float, optional) – The cut-off value for protein p-values. This value determines which proteins are considered significant based on a previous analysis. Defaults to 0.05.
background_lenght (int, optional) – The total number of entities in the background set. This argument is only used for the “fisher” method to define the population size. If not provided, all genes from the original data are used as the background. Defaults to None.
annotation (bool, optional) – If True (default), displays the p-values within each heatmap cell. If False, hides the p-value annotations.
save (str, optional) – The filename prefix to save the heatmap image (e.g., “overlap_stat”). If provided, the function will save the plot image.
vector (bool, optional) – If True (default), saves the image as an SVG file (scalable vector graphics) suitable for high-quality printing. If False, saves the image as a PNG file.
dpi (int, optional) – The resolution (dots per inch) for the generated plot. Defaults to 300.
- Returns:
- None. This function generates a heatmap visualization and potentially
saves an image file, but it doesn’t return any data.
- omicscope.MultipleData.MultipleVisualization.stat_matrix(self, method, protein_pvalue, background_lenght)[source]¶
Performs a pair-wise statistical comparison between groups based on the chosen method and a protein p-value cut-off.
- Parameters:
self – Reference to the class instance where this function is called.
method (str) – The statistical method to be used for the comparison. Valid options include:
- “fisher”: Performs Fisher’s exact test, suitable for comparing
proportions of significant proteins between groups.
“ttest”: Performs a t-test, assuming normally distributed data.
- “wilcoxon”: Performs a Wilcoxon signed-rank test, a non-parametric
alternative for comparing related groups when normality cannot be assumed.
- “ks”: Performs a Kolmogorov-Smirnov test, used to compare the
probability distributions of two samples.
protein_pvalue (float) – The cut-off value for protein p-values. This value determines which proteins are considered significant based on a previous analysis.
background_lenght (int, optional) – The total number of entities in the background set. This argument is only used for the “fisher” method to define the population size. If not provided, all genes from the original data are used as the background.
- Returns:
pandas.DataFrame –
- A DataFrame containing the p-values for each pair-wise
comparison between groups.
- omicscope.MultipleData.MultipleVisualization.stat_network(self, method='fisher', protein_pvalue=0.05, background_lenght=None, dpi=300, graph_pvalue=0.1, save=None, vector=True)[source]¶
Generates a network visualization based on statistical comparisons between groups imported on Nebula
- Parameters:
method (str, optional) – The statistical method used for comparison between groups. Valid options include:
- “fisher”: Performs Fisher’s exact test, suitable for comparing
proportions of significant proteins.
“ttest”: Performs a t-test, assuming normally distributed data.
- “wilcoxon”: Performs a Wilcoxon signed-rank test, a non-parametric
alternative for related groups when normality cannot be assumed.
- “ks”: Performs a Kolmogorov-Smirnov test, used to compare the
probability distributions of two samples.
Defaults to “fisher”.
protein_pvalue (float, optional) – The cut-off value for protein p-values. This value determines which proteins are considered significant based on a previous analysis. Defaults to 0.05.
background_lenght (int, optional) – The total number of entities in the background set. This argument is only used for the “fisher” method to define the population size. If not provided, all genes from the original data are used as the background. Defaults to None (Recommended).
dpi (int, optional) – The resolution (dots per inch) for the generated plot. Defaults to 300.
graph_pvalue (float, optional) – The threshold for p-values to consider the links between network nodes. Edges with p-values greater than (for “fisher”) or less than (for other methods) to this value will be excluded from the network. Defaults to 0.1.
save (str, optional) – The filename prefix to save the network image (e.g., “groupNetwork”). If provided, the function will save both the GraphML representation of the network and the plot image.
vector (bool, optional) – If True (default), saves the image as an SVG file (scalable vector graphics) suitable for high-quality printing. If False, saves the image as a PNG file.
- Returns:
- None. This function generates a network visualization and potentially
saves image files, but it doesn’t return any data.
- omicscope.MultipleData.MultipleVisualization.whole_network(self, labels=False, save=None, vector=True, dpi=300)[source]¶
Network of entities differentially regulated for each group analyzed.
- Parameters:
labels (bool, optional) – Show graph labels. Defaults to False.
save (str, optional) – Path to save image. Defaults to None. Defaults to None. dpi (int, optional): Image resolution. Defaults to 300.