stt.pl submodule

Module contents (Calling by stt.pl.function_name)

stt.pl._plot_tensor.plot_tensor_single(adata, adata_aggr=None, state='joint', attractor=None, basis='umap', color='attractor', color_map=None, size=20, alpha=0.5, ax=None, show=None, filter_cells=False, member_thresh=0.05, density=2)

Function to plot a single tensor graph with assgined components

Parameters
  • adata (AnnData object) –

  • adata_aggr (AnnData object) –

  • state (str) – State of the tensor graph, ‘spliced’, ‘unspliced’ or ‘joint’

  • attractor (int) – Attractor index

  • basis (str) – Dimensionality reduction basis for the plot

  • color (str) – Color of the cells, ‘attractor’ or ‘rho’

  • color_map (str) – Color map for the plot

  • size (int) – Size of the cells

  • alpha (float) – Transparency of the cells

  • ax (matplotlib.axes._subplots.AxesSubplot) – Axes for the plot

  • show (bool) – Show the plot

  • filter_cells (bool) – Filter cells based on the member threshold

  • member_thresh (float) – Member threshold

  • density (int) – Density of the streamlines

Return type

None, but plots the tensor graph

stt.pl._plot_tensor.plot_tensor(adata, adata_aggr, list_state=['joint', 'spliced', 'unspliced'], list_attractor='all', basis='umap', figsize=(8, 8), hspace=0.2, wspace=0.2, color_map=None, size=20, alpha=0.5, filter_cells=False, member_thresh=0.05, density=2)

Function to plot a series of tensor graphs with assgined components

Parameters
  • adata (AnnData object) –

  • adata_aggr (AnnData object) –

  • list_state (list) – List of states of the tensor graph, ‘spliced’, ‘unspliced’ or ‘joint’

  • list_attractor (list) – List of attractor index

  • basis (str) – Dimensionality reduction basis for the plot

  • figsize (tuple) – Size of the figure

  • hspace (float) – Height space between subplots

  • wspace (float) – Width space between subplots

  • color_map (str) – Color map for the plot

  • size (int) – Size of the cells

  • alpha (float) – Transparency of the cells

  • filter_cells (bool) – Filter streamlines shown on cells based on the member threshold

  • member_thresh (float) – Member threshold

  • density (int) – Density of the streamlines

Return type

None, but plots the tensor graphs

stt.pl._plot_tensor.plot_tensor_pathway(adata, adata_aggr, pathway_name, basis)

Function to plot the tensor graph of the pathway

Parameters
  • adata (AnnData object) –

  • adata_aggr (AnnData object) –

  • pathway_name (str) – Name of the pathway

  • basis (str) – Dimensionality reduction basis for the plot

Return type

None, but plots the tensor graph of the pathway

stt.pl._plot_tensor.plot_pathway(adata, figsize=(10, 10), fontsize=12, cmp='Set2', size=20)

Function to plot the low dimensional emebedding of pathway similarity matrix

Parameters
  • adata (AnnData object) –

  • figsize (tuple) – Size of the figure

  • fontsize (int) – Font size of the labels

  • cmp (str) – Color map for clusters of pathways based on similariy

  • size (int) – Size of the cells

Return type

None, but plots the low dimensional emebedding of pathway similarity matrix

stt.pl._plot_utils.plot_top_genes(adata, top_genes=6, ncols=2, figsize=(8, 8), color_map='tab10', color='attractor', attractor=None, hspace=0.5, wspace=0.5)

Plot the top multi-stable genes in U-S planes

Parameters
  • adata (AnnData object) – Annotated data matrix.

  • top_genes (int) – Number of top genes to be plotted

  • ncols (int) – Number of columns

  • figsize (tuple) – Size of the figure

  • color_map (str) – Color map for the plot

  • color (str) – Color of the plot, either ‘attractor’ or ‘membership’

  • attractor (int) – Index of the attractor, if None, the average velocity will be used

  • hspace (float) – Height space between subplots

  • wspace (float) – Width space between subplots

Return type

None, but plots the top multi-stable genes in U-S planes

stt.pl._plot_utils.plot_landscape(sc_object, show_colorbar=False, dim=2, size_point=3, alpha_land=0.5, alpha_point=0.5, color_palette_name='Set1', contour_levels=15, elev=10, azim=4)

Plot the landscape of the attractor landscape

Parameters
  • sc_object (AnnData object) – Annotated data matrix.

  • show_colorbar (bool) – Whether to show the colorbar

  • dim (int) – Dimension of the plot

  • size_point (float) – Size of the points

  • alpha_land (float) – Transparency of the landscape

  • alpha_point (float) – Transparency of the points

  • color_palette_name (str) – Name of the color palette

  • contour_levels (int) – Number of contour levels

  • elev (int) – Elevation of the 3D plot

  • azim (int) – Azimuth of the 3D plot

Return type

None

stt.pl._plot_utils.infer_lineage(sc_object, si=0, sf=1, method='MPFT', flux_fraction=0.9, size_state=0.1, size_point=3, alpha_land=0.5, alpha_point=0.5, size_text=20, show_colorbar=False, color_palette_name='Set1', contour_levels=15)

Infer the lineage among the multi-stable attractors based on most probable flux tree or path

Parameters
  • sc_object (AnnData object) – Annotated data matrix.

  • si (int or list) – Initial state (attractor index number) of specified transition path, specified when method = ‘MPPT’

  • sf (int or list) – Final state (attractor index number) , specified when method = ‘MPPT’

  • method (str) – Method to infer the lineage, either ‘MPFT’(maxium probability flow tree, global) or ‘MPPT’(most probable path tree, local)

  • flux_fraction (float) – Fraction of the total flux to be considered

  • size_state (float) – Size of the state

  • size_point (float) – Size of the points

  • alpha_land (float) – Transparency of the landscape

  • alpha_point (float) – Transparency of the points

  • size_text (float) – Size of the text

  • show_colorbar (bool) – Whether to show the colorbar

  • color_palette_name (str) – Name of the color palette

  • contour_levels (int) – Number of contour levels

Return type

None

stt.pl._plot_utils.plot_tensor_heatmap(adata, attractor='all', component='spliced', top_genes=50)

Plot the heatmap of the transition tensor

Parameters
  • adata (AnnData object) – Annotated data matrix.

  • attractor (int) – Index of the attractor, if None, the average velocity will be used

  • component (str) – Component of the tensor, either ‘spliced’ or ‘unspliced’

  • top_genes (int) – Number of top genes to be plotted

Return type

None