sctop.visualization

Functions

create_colorbar(data, label[, colormap, ax])

plot_highest(projections[, n, ax, color, fontsize])

Plots a horizontal bar chart of the top N projections with a fixed x-axis scale.

plot_expression_distribution(scores[, n, ax, ...])

Plots boxplots of expression for top genes with a fixed y-axis scale.

plot_two(projections, celltype1, celltype2[, gene, ...])

plot_all_contributions(→ None)

Create and save contribution plots for all cell types and samples.

Module Contents

sctop.visualization.create_colorbar(data, label, colormap='rocket_r', ax=None)[source]
sctop.visualization.plot_highest(projections, n=10, ax=None, color='olive', fontsize=40, **kwargs)[source]

Plots a horizontal bar chart of the top N projections with a fixed x-axis scale.

sctop.visualization.plot_expression_distribution(scores, n=10, ax=None, box_color='skyblue', fontsize=30, **kwargs)[source]

Plots boxplots of expression for top genes with a fixed y-axis scale.

sctop.visualization.plot_two(projections, celltype1, celltype2, gene=None, gene_expressions=None, ax=None, **kwargs)[source]
sctop.visualization.plot_all_contributions(results: sctop.utils.Dict[str, sctop.utils.Dict], sample_names: sctop.processing.List[str], output_dir: sctop.processing.Optional[str] = None, highlight_genes: sctop.processing.Optional[sctop.utils.Dict[str, sctop.processing.List[str]]] = None, dpi: int = 150, **plot_kwargs) None[source]

Create and save contribution plots for all cell types and samples.

Parameters:
  • results (dict) – Results from analyze_sample_contributions

  • sample_names (list) – List of sample names to plot

  • output_dir (str, optional) – Base directory for saving plots. If None, uses current directory

  • highlight_genes (dict, optional) – Dictionary mapping cell_type -> [genes_to_highlight]

  • dpi (int) – DPI for saved images

  • **plot_kwargs – Additional kwargs passed to plot_gene_contribution_scatter