spateo.plotting.static.three_d_plot.morphometrics_plots

Functions

_check_index_in_adata(adata, model)

_check_key_in_adata(adata, key, where)

jacobian(adata, model[, jacobian_key, filename, ...])

Visualize the jacobian result.

feature(adata, model, feature_key[, filename, ...])

Visualize the feature values.

torsion(adata, model[, torsion_key, filename, ...])

Visualize the torsion result.

acceleration(adata, model[, acceleration_key, ...])

Visualize the torsion result.

curvature(adata, model[, curvature_key, filename, ...])

Visualize the curvature result.

curl(adata, model[, curl_key, filename, jupyter, ...])

Visualize the curl result.

divergence(adata, model[, divergence_key, filename, ...])

Visualize the divergence result.

Module Contents

spateo.plotting.static.three_d_plot.morphometrics_plots._check_index_in_adata(adata, model)[source]
spateo.plotting.static.three_d_plot.morphometrics_plots._check_key_in_adata(adata: anndata.AnnData, key: str, where: str)[source]
spateo.plotting.static.three_d_plot.morphometrics_plots.jacobian(adata: anndata.AnnData, model: pyvista.PolyData | pyvista.UnstructuredGrid | pyvista.MultiBlock | list, jacobian_key: str = 'jacobian', filename: str | None = None, jupyter: bool | Literal['none', 'static', 'trame'] = False, off_screen: bool = False, shape: str | list | tuple = (3, 3), window_size: tuple | None = (512 * 3, 512 * 3), background: str = 'black', colormap: str | list | None = 'default_cmap', ambient: float | list = 0.2, opacity: float | numpy.ndarray | list = 1.0, model_style: Literal['points', 'surface', 'wireframe'] | list = 'points', model_size: float | list = 3.0, show_axes: bool = True, show_legend: bool = True, legend_kwargs: dict | None = None, text: bool | str = True, text_kwargs: dict | None = None, **kwargs)[source]

Visualize the jacobian result.

Parameters:
adata

An anndata object contain jacobian matrix in .uns[jacobian_key].

model

A reconstructed model contains obs_index values.

jacobian_key

The key in .uns that corresponds to the jacobian matrix in the anndata object.

filename

Filename of output file. Writer type is inferred from the extension of the filename.

  • Output an image file,please enter a filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'. When jupyter=False, if you want to save ‘.png’ file, please ensure off_screen=True.

  • Output a gif file, please enter a filename ending with .gif.

  • Output a mp4 file, please enter a filename ending with .mp4.

jupyter

Whether to plot in jupyter notebook. Available jupyter are:

  • 'none' - Do not display in the notebook.

  • 'trame' - Show a trame widget

  • 'static' - Display a static figure.

off_screen

Renders off-screen when True. Useful for automated screenshots.

shape

Number of sub-render windows inside the main window. By default, there are nine render window.

  • Specify two across with ``shape``=(2, 1) and a two by two grid with ``shape``=(2, 2).

  • shape Can also accept a string descriptor as shape.

    E.g.: shape="3|1" means 3 plots on the left and 1 on the right, E.g.: shape="4/2" means 4 plots on top and 2 at the bottom.

window_size

Window size in pixels. The default window_size is [512*3, 512*3].

background

The background color of the window.

colormap

Name of the Matplotlib colormap to use when mapping the scalars.

When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars.

ambient

When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer.

opacity

Opacity of the model.

If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1.

A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: ‘linear’, ‘linear_r’, ‘geom’, ‘geom_r’).

model_style

Visualization style of the model. One of the following:

  • model_style = 'surface',

  • model_style = 'wireframe',

  • model_style = 'points'.

model_size

If model_style = 'points', point size of any nodes in the dataset plotted.

If model_style = 'wireframe', thickness of lines.

show_axes

Whether to add a camera orientation widget to the active renderer.

show_legend

whether to add a legend to the plotter.

legend_kwargs

A dictionary that will be pass to the add_legend function. By default, it is an empty dictionary and the add_legend function will use the {"legend_size": None, "legend_loc": None,  "legend_size": None, "legend_loc": None, "title_font_size": None, "label_font_size": None, "font_family": "arial", "fmt": "%.2e", "n_labels": 5, "vertical": True} as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs.

text

The text to add the rendering.

text_kwargs

A dictionary that will be pass to the add_text function.

By default, it is an empty dictionary and the add_legend function will use the { "font_family": "arial", "font_size": 12, "font_color": "black", "text_loc": "upper_left"} as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs.

**kwargs

Additional parameters that will be passed into the st.pl.three_d_multi_plot function.

Returns:

List of camera position, focal point, and view up.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

img: Numpy array of the last image.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

Return type:

cpo

Examples

Visualize only in one model:

st.pl.jacobian(

adata=stage_adata, model=stage_pc, jacobian_key=”jacobian”, jupyter=”static”, model_style=”points”, model_size=3

)

Visualize in multiple model:

st.pl.jacobian(

adata=stage_adata, model=[stage_pc, trajectory_model], jacobian_key=”jacobian”, jupyter=”static”, model_style=[“points”, “wireframe”], model_size=[3, 1]

)

spateo.plotting.static.three_d_plot.morphometrics_plots.feature(adata: anndata.AnnData, model: pyvista.PolyData | pyvista.UnstructuredGrid | pyvista.MultiBlock | list, feature_key: str, filename: str | None = None, jupyter: bool | Literal['none', 'static', 'trame'] = False, off_screen: bool = False, window_size: tuple | None = (512, 512), background: str = 'black', colormap: str | list | None = 'default_cmap', ambient: float | list = 0.2, opacity: float | numpy.ndarray | list = 1.0, model_style: Literal['points', 'surface', 'wireframe'] | list = 'points', model_size: float | list = 3.0, show_axes: bool = True, show_legend: bool = True, legend_kwargs: dict | None = dict(title=''), text: bool | str = True, text_kwargs: dict | None = None, **kwargs)[source]

Visualize the feature values.

Parameters:
adata

An anndata object contain feature values in .obs[feature_key].

model

A reconstructed model contains obs_index values.

feature_key

The key in .obs that corresponds to the feature values in the anndata object.

filename

Filename of output file. Writer type is inferred from the extension of the filename.

  • Output an image file,please enter a filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'. When jupyter=False, if you want to save ‘.png’ file, please ensure off_screen=True.

  • Output a gif file, please enter a filename ending with .gif.

  • Output a mp4 file, please enter a filename ending with .mp4.

jupyter

Whether to plot in jupyter notebook. Available jupyter are:

  • 'none' - Do not display in the notebook.

  • 'trame' - Show a trame widget

  • 'static' - Display a static figure.

off_screen

Renders off-screen when True. Useful for automated screenshots.

window_size

Window size in pixels. The default window_size is [512, 512].

background

The background color of the window.

colormap

Name of the Matplotlib colormap to use when mapping the scalars.

When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars.

ambient

When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer.

opacity

Opacity of the model.

If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1.

A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: ‘linear’, ‘linear_r’, ‘geom’, ‘geom_r’).

model_style

Visualization style of the model. One of the following:

  • model_style = 'surface',

  • model_style = 'wireframe',

  • model_style = 'points'.

model_size

If model_style = 'points', point size of any nodes in the dataset plotted.

If model_style = 'wireframe', thickness of lines.

show_axes

Whether to add a camera orientation widget to the active renderer.

show_legend

whether to add a legend to the plotter.

legend_kwargs

A dictionary that will be pass to the add_legend function. By default, it is an empty dictionary and the add_legend function will use the {"legend_size": None, "legend_loc": None,  "legend_size": None, "legend_loc": None, "title_font_size": None, "label_font_size": None, "font_family": "arial", "fmt": "%.2e", "n_labels": 5, "vertical": True} as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs.

text

The text to add the rendering.

text_kwargs

A dictionary that will be pass to the add_text function.

By default, it is an empty dictionary and the add_legend function will use the { "font_family": "arial", "font_size": 12, "font_color": "black", "text_loc": "upper_left"} as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs.

**kwargs

Additional parameters that will be passed into the st.pl.three_d_plot function.

Examples

Visualize only in one model:

st.pl.feature(

adata=stage_adata, model=stage_pc, feature_key=”torsion”, jupyter=”static”, model_style=”points”, model_size=3

)

Visualize in multiple model:

st.pl.feature(

adata=stage_adata, model=[stage_pc, trajectory_model], feature_key=”torsion”, jupyter=”static”, model_style=[“points”, “wireframe”], model_size=[3, 1]

)

spateo.plotting.static.three_d_plot.morphometrics_plots.torsion(adata: anndata.AnnData, model: pyvista.PolyData | pyvista.UnstructuredGrid | pyvista.MultiBlock | list, torsion_key: str = 'torsion', filename: str | None = None, jupyter: bool | Literal['none', 'static', 'trame'] = False, colormap: str | list | None = 'default_cmap', ambient: float | list = 0.2, opacity: float | numpy.ndarray | list = 1.0, model_style: Literal['points', 'surface', 'wireframe'] | list = 'points', model_size: float | list = 3.0, **kwargs)[source]

Visualize the torsion result.

Parameters:
adata

An anndata object contain torsion values in .obs[torsion_key].

model

A reconstructed model contains obs_index values.

torsion_key

The key in .obs that corresponds to the torsion values in the anndata object.

filename

Filename of output file. Writer type is inferred from the extension of the filename.

  • Output an image file,please enter a filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'. When jupyter=False, if you want to save ‘.png’ file, please ensure off_screen=True.

  • Output a gif file, please enter a filename ending with .gif.

  • Output a mp4 file, please enter a filename ending with .mp4.

jupyter

Whether to plot in jupyter notebook. Available jupyter are:

  • 'none' - Do not display in the notebook.

  • 'trame' - Show a trame widget

  • 'static' - Display a static figure.

colormap

Name of the Matplotlib colormap to use when mapping the scalars.

When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars.

ambient

When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer.

opacity

Opacity of the model.

If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1.

A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: ‘linear’, ‘linear_r’, ‘geom’, ‘geom_r’).

model_style

Visualization style of the model. One of the following:

  • model_style = 'surface',

  • model_style = 'wireframe',

  • model_style = 'points'.

model_size

If model_style = 'points', point size of any nodes in the dataset plotted.

If model_style = 'wireframe', thickness of lines.

**kwargs

Additional parameters that will be passed into the st.pl.feature function.

Returns:

List of camera position, focal point, and view up.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

img: Numpy array of the last image.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

Return type:

cpo

Examples

Visualize only in one model:

st.pl.torsion(

adata=stage_adata, model=stage_pc, torsion_key=”torsion”, jupyter=”static”, model_style=”points”, model_size=3

)

Visualize in multiple model:

st.pl.torsion(

adata=stage_adata, model=[stage_pc, trajectory_model], torsion_key=”torsion”, jupyter=”static”, model_style=[“points”, “wireframe”], model_size=[3, 1]

)

spateo.plotting.static.three_d_plot.morphometrics_plots.acceleration(adata: anndata.AnnData, model: pyvista.PolyData | pyvista.UnstructuredGrid | pyvista.MultiBlock | list, acceleration_key: str = 'acceleration', filename: str | None = None, jupyter: bool | Literal['none', 'static', 'trame'] = False, colormap: str | list | None = 'default_cmap', ambient: float | list = 0.2, opacity: float | numpy.ndarray | list = 1.0, model_style: Literal['points', 'surface', 'wireframe'] | list = 'points', model_size: float | list = 3.0, **kwargs)[source]

Visualize the torsion result.

Parameters:
adata

An anndata object contain acceleration values in .obs[acceleration_key].

model

A reconstructed model contains obs_index values.

acceleration_key

The key in .obs that corresponds to the acceleration values in the anndata object.

filename

Filename of output file. Writer type is inferred from the extension of the filename.

  • Output an image file,please enter a filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'. When jupyter=False, if you want to save ‘.png’ file, please ensure off_screen=True.

  • Output a gif file, please enter a filename ending with .gif.

  • Output a mp4 file, please enter a filename ending with .mp4.

jupyter

Whether to plot in jupyter notebook. Available jupyter are:

  • 'none' - Do not display in the notebook.

  • 'trame' - Show a trame widget

  • 'static' - Display a static figure.

colormap

Name of the Matplotlib colormap to use when mapping the scalars.

When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars.

ambient

When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer.

opacity

Opacity of the model.

If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1.

A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: ‘linear’, ‘linear_r’, ‘geom’, ‘geom_r’).

model_style

Visualization style of the model. One of the following:

  • model_style = 'surface',

  • model_style = 'wireframe',

  • model_style = 'points'.

model_size

If model_style = 'points', point size of any nodes in the dataset plotted.

If model_style = 'wireframe', thickness of lines.

**kwargs

Additional parameters that will be passed into the st.pl.feature function.

Returns:

List of camera position, focal point, and view up.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

img: Numpy array of the last image.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

Return type:

cpo

Examples

Visualize only in one model:

st.pl.acceleration(

adata=stage_adata, model=stage_pc, acceleration_key=”acceleration”, jupyter=”static”, model_style=”points”, model_size=3

)

Visualize in multiple model:

st.pl.acceleration(

adata=stage_adata, model=[stage_pc, trajectory_model], acceleration_key=”acceleration”, jupyter=”static”, model_style=[“points”, “wireframe”], model_size=[3, 1]

)

spateo.plotting.static.three_d_plot.morphometrics_plots.curvature(adata: anndata.AnnData, model: pyvista.PolyData | pyvista.UnstructuredGrid | pyvista.MultiBlock | list, curvature_key: str = 'curvature', filename: str | None = None, jupyter: bool | Literal['none', 'static', 'trame'] = False, colormap: str | list | None = 'default_cmap', ambient: float | list = 0.2, opacity: float | numpy.ndarray | list = 1.0, model_style: Literal['points', 'surface', 'wireframe'] | list = 'points', model_size: float | list = 3.0, **kwargs)[source]

Visualize the curvature result.

Parameters:
adata

An anndata object contain curvature values in .obs[curvature_key].

model

A reconstructed model contains obs_index values.

curvature_key

The key in .obs that corresponds to the curvature values in the anndata object.

filename

Filename of output file. Writer type is inferred from the extension of the filename.

  • Output an image file,please enter a filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'. When jupyter=False, if you want to save ‘.png’ file, please ensure off_screen=True.

  • Output a gif file, please enter a filename ending with .gif.

  • Output a mp4 file, please enter a filename ending with .mp4.

jupyter

Whether to plot in jupyter notebook. Available jupyter are:

  • 'none' - Do not display in the notebook.

  • 'trame' - Show a trame widget

  • 'static' - Display a static figure.

colormap

Name of the Matplotlib colormap to use when mapping the scalars.

When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars.

ambient

When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer.

opacity

Opacity of the model.

If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1.

A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: ‘linear’, ‘linear_r’, ‘geom’, ‘geom_r’).

model_style

Visualization style of the model. One of the following:

  • model_style = 'surface',

  • model_style = 'wireframe',

  • model_style = 'points'.

model_size

If model_style = 'points', point size of any nodes in the dataset plotted.

If model_style = 'wireframe', thickness of lines.

**kwargs

Additional parameters that will be passed into the st.pl.feature function.

Returns:

List of camera position, focal point, and view up.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

img: Numpy array of the last image.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

Return type:

cpo

Examples

Visualize only in one model:

st.pl.curvature(

adata=stage_adata, model=stage_pc, curvature_key=”curvature”, jupyter=”static”, model_style=”points”, model_size=3

)

Visualize in multiple model:

st.pl.curvature(

adata=stage_adata, model=[stage_pc, trajectory_model], curvature_key=”curvature”, jupyter=”static”, model_style=[“points”, “wireframe”], model_size=[3, 1]

)

spateo.plotting.static.three_d_plot.morphometrics_plots.curl(adata: anndata.AnnData, model: pyvista.PolyData | pyvista.UnstructuredGrid | pyvista.MultiBlock | list, curl_key: str = 'curl', filename: str | None = None, jupyter: bool | Literal['none', 'static', 'trame'] = False, colormap: str | list | None = 'default_cmap', ambient: float | list = 0.2, opacity: float | numpy.ndarray | list = 1.0, model_style: Literal['points', 'surface', 'wireframe'] | list = 'points', model_size: float | list = 3.0, **kwargs)[source]

Visualize the curl result.

Parameters:
adata

An anndata object contain curl values in .obs[curl_key].

model

A reconstructed model contains obs_index values.

curl_key

The key in .obs that corresponds to the curl values in the anndata object.

filename

Filename of output file. Writer type is inferred from the extension of the filename.

  • Output an image file,please enter a filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'. When jupyter=False, if you want to save ‘.png’ file, please ensure off_screen=True.

  • Output a gif file, please enter a filename ending with .gif.

  • Output a mp4 file, please enter a filename ending with .mp4.

jupyter

Whether to plot in jupyter notebook. Available jupyter are:

  • 'none' - Do not display in the notebook.

  • 'trame' - Show a trame widget

  • 'static' - Display a static figure.

colormap

Name of the Matplotlib colormap to use when mapping the scalars.

When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars.

ambient

When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer.

opacity

Opacity of the model.

If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1.

A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: ‘linear’, ‘linear_r’, ‘geom’, ‘geom_r’).

model_style

Visualization style of the model. One of the following:

  • model_style = 'surface',

  • model_style = 'wireframe',

  • model_style = 'points'.

model_size

If model_style = 'points', point size of any nodes in the dataset plotted.

If model_style = 'wireframe', thickness of lines.

**kwargs

Additional parameters that will be passed into the st.pl.feature function.

Returns:

List of camera position, focal point, and view up.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

img: Numpy array of the last image.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

Return type:

cpo

Examples

Visualize only in one model:

st.pl.curl(

adata=stage_adata, model=stage_pc, curl_key=”curl”, jupyter=”static”, model_style=”points”, model_size=3

)

Visualize in multiple model:

st.pl.curl(

adata=stage_adata, model=[stage_pc, trajectory_model], curl_key=”curl”, jupyter=”static”, model_style=[“points”, “wireframe”], model_size=[3, 1]

)

spateo.plotting.static.three_d_plot.morphometrics_plots.divergence(adata: anndata.AnnData, model: pyvista.PolyData | pyvista.UnstructuredGrid | pyvista.MultiBlock | list, divergence_key: str = 'divergence', filename: str | None = None, jupyter: bool | Literal['none', 'static', 'trame'] = False, colormap: str | list | None = 'default_cmap', ambient: float | list = 0.2, opacity: float | numpy.ndarray | list = 1.0, model_style: Literal['points', 'surface', 'wireframe'] | list = 'points', model_size: float | list = 3.0, **kwargs)[source]

Visualize the divergence result.

Parameters:
adata

An anndata object contain curl values in .obs[divergence_key].

model

A reconstructed model contains obs_index values.

divergence_key

The key in .obs that corresponds to the divergence values in the anndata object.

filename

Filename of output file. Writer type is inferred from the extension of the filename.

  • Output an image file,please enter a filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'. When jupyter=False, if you want to save ‘.png’ file, please ensure off_screen=True.

  • Output a gif file, please enter a filename ending with .gif.

  • Output a mp4 file, please enter a filename ending with .mp4.

jupyter

Whether to plot in jupyter notebook. Available jupyter are:

  • 'none' - Do not display in the notebook.

  • 'pythreejs' - Show a pythreejs widget

  • 'static' - Display a static figure.

  • 'ipygany' - Show an ipygany widget

  • 'panel' - Show a panel widget.

colormap

Name of the Matplotlib colormap to use when mapping the scalars.

When the colormap is None, use {key}_rgba to map the scalars, otherwise use the colormap to map scalars.

ambient

When lighting is enabled, this is the amount of light in the range of 0 to 1 (default 0.0) that reaches the actor when not directed at the light source emitted from the viewer.

opacity

Opacity of the model.

If a single float value is given, it will be the global opacity of the model and uniformly applied everywhere, elif a numpy.ndarray with single float values is given, it will be the opacity of each point. - should be between 0 and 1.

A string can also be specified to map the scalars range to a predefined opacity transfer function (options include: ‘linear’, ‘linear_r’, ‘geom’, ‘geom_r’).

model_style

Visualization style of the model. One of the following:

  • model_style = 'surface',

  • model_style = 'wireframe',

  • model_style = 'points'.

model_size

If model_style = 'points', point size of any nodes in the dataset plotted.

If model_style = 'wireframe', thickness of lines.

**kwargs

Additional parameters that will be passed into the st.pl.feature function.

Returns:

List of camera position, focal point, and view up.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

img: Numpy array of the last image.

Returned only if filename is None or filename ending with '.png', '.tif', '.tiff', '.bmp', '.jpeg', '.jpg', '.svg', '.eps', '.ps', '.pdf', '.tex'.

Return type:

cpo

Examples

Visualize only in one model:

st.pl.divergence(

adata=stage_adata, model=stage_pc, divergence_key=”divergence”, jupyter=”static”, model_style=”points”, model_size=3

)

Visualize in multiple model:

st.pl.divergence(

adata=stage_adata, model=[stage_pc, trajectory_model], divergence_key=”divergence”, jupyter=”static”, model_style=[“points”, “wireframe”], model_size=[3, 1]

)