spateo.tdr.models.models_migration.morphopath_model#

Module Contents#

Functions#

construct_genesis_X(→ Tuple[pyvista.MultiBlock, ...)

Reconstruction of cell-level cell developmental change model based on the cell fate prediction results. Here we only

construct_genesis(→ Tuple[pyvista.MultiBlock, ...)

Reconstruction of cell-level cell developmental change model based on the cell fate prediction results. Here we only

construct_trajectory_X(→ Tuple[Any, Optional[str]])

Reconstruction of cell developmental trajectory model.

construct_trajectory(→ Tuple[Any, Optional[str]])

Reconstruction of cell developmental trajectory model based on cell fate prediction.

spateo.tdr.models.models_migration.morphopath_model.construct_genesis_X(stages_X: List[numpy.ndarray], n_spacing: int | None = None, key_added: str = 'genesis', label: str | list | numpy.ndarray | None = None, color: str | list | dict = 'skyblue', alpha: float | list | dict = 1.0) Tuple[pyvista.MultiBlock, str | None][source]#

Reconstruction of cell-level cell developmental change model based on the cell fate prediction results. Here we only need to enter the three-dimensional coordinates of the cells at different developmental stages.

Parameters:
stages_X

The three-dimensional coordinates of the cells at different developmental stages.

n_spacing

Subdivided into n_spacing time points between two periods.

key_added

The key under which to add the labels.

label

The label of cell developmental change model. If label == None, the label will be automatically generated.

color

Color to use for plotting model.

alpha

The opacity of the color to use for plotting model.

Returns:

A MultiBlock contains cell models for all stages. plot_cmap: Recommended colormap parameter values for plotting.

spateo.tdr.models.models_migration.morphopath_model.construct_genesis(adata: anndata.AnnData, fate_key: str = 'fate_morpho', n_steps: int = 100, logspace: bool = False, t_end: int | float | None = None, key_added: str = 'genesis', label: str | list | numpy.ndarray | None = None, color: str | list | dict = 'skyblue', alpha: float | list | dict = 1.0) Tuple[pyvista.MultiBlock, str | None][source]#

Reconstruction of cell-level cell developmental change model based on the cell fate prediction results. Here we only need to enter the three-dimensional coordinates of the cells at different developmental stages.

Parameters:
adata

AnnData object that contains the fate prediction in the .uns attribute.

fate_key

The key under which are the active fate information.

n_steps

The number of times steps fate prediction will take.

logspace

Whether or to sample time points linearly on log space. If not, the sorted unique set of all times points from all cell states’ fate prediction will be used and then evenly sampled up to n_steps time points.

t_end

The length of the time period from which to predict cell state forward or backward over time.

key_added

The key under which to add the labels.

label

The label of cell developmental change model. If label == None, the label will be automatically generated.

color

Color to use for plotting model.

alpha

The opacity of the color to use for plotting model.

Returns:

A MultiBlock contains cell models for all stages. plot_cmap: Recommended colormap parameter values for plotting.

spateo.tdr.models.models_migration.morphopath_model.construct_trajectory_X(cells_states: numpy.ndarray | List[numpy.ndarray], init_states: numpy.ndarray | None = None, n_sampling: int | None = None, sampling_method: str = 'trn', key_added: str = 'trajectory', label: str | list | numpy.ndarray | None = None, tip_factor: int | float = 5, tip_radius: float = 0.2, trajectory_color: str | list | dict = 'gainsboro', tip_color: str | list | dict = 'orangered', alpha: float | list | dict = 1.0) Tuple[Any, str | None][source]#

Reconstruction of cell developmental trajectory model.

Parameters:
cells_states

Three-dimensional coordinates of all cells at all times points.

init_states

Three-dimensional coordinates of all cells at the starting time point.

n_sampling

n_sampling is the number of coordinates to keep after sampling. If there are too many coordinates in start_points, the generated arrows model will be too complex and unsightly, so sampling is used to reduce the number of coordinates.

sampling_method

The method to sample data points, can be one of ['trn', 'kmeans', 'random'].

key_added

The key under which to add the labels.

label

The label of trajectory model.

tip_factor

Scale factor applied to scaling the tips.

tip_radius

Radius of the tips.

trajectory_color

Color to use for plotting trajectory model.

tip_color

Color to use for plotting tips.

alpha

The opacity of the color to use for plotting model.

Returns:

3D cell developmental trajectory model. plot_cmap: Recommended colormap parameter values for plotting.

Return type:

trajectory_model

spateo.tdr.models.models_migration.morphopath_model.construct_trajectory(adata: anndata.AnnData, fate_key: str = 'fate_develop', n_sampling: int | None = None, sampling_method: str = 'trn', key_added: str = 'trajectory', label: str | list | numpy.ndarray | None = None, tip_factor: int | float = 5, tip_radius: float = 0.2, trajectory_color: str | list | dict = 'gainsboro', tip_color: str | list | dict = 'orangered', alpha: float = 1.0) Tuple[Any, str | None][source]#

Reconstruction of cell developmental trajectory model based on cell fate prediction.

Parameters:
adata

AnnData object that contains the fate prediction in the .uns attribute.

fate_key

The key under which are the active fate information.

n_sampling

n_sampling is the number of coordinates to keep after sampling. If there are too many coordinates in start_points, the generated arrows model will be too complex and unsightly, so sampling is used to reduce the number of coordinates.

sampling_method

The method to sample data points, can be one of ['trn', 'kmeans', 'random'].

key_added

The key under which to add the labels.

label

The label of trajectory model.

tip_factor

Scale factor applied to scaling the tips.

tip_radius

Radius of the tips.

trajectory_color

Color to use for plotting trajectory model.

tip_color

Color to use for plotting tips.

alpha

The opacity of the color to use for plotting model.

Returns:

3D cell developmental trajectory model. plot_cmap: Recommended colormap parameter values for plotting.

Return type:

trajectory_model