Module Contents#


morphopath(→ Optional[anndata.AnnData])

Prediction of cell developmental trajectory based on reconstructed vector field.

spateo.tdr.morphometrics.morphofield.trajectory.morphopath(adata: anndata.AnnData, vf_key: str = 'VecFld_morpho', key_added: str = 'fate_morpho', layer: str = 'X', direction: str = 'forward', interpolation_num: int = 250, t_end: int | float | None = None, average: bool = False, cores: int = 1, inplace: bool = True, **kwargs) anndata.AnnData | None[source]#

Prediction of cell developmental trajectory based on reconstructed vector field.


AnnData object that contains the reconstructed vector field function in the .uns attribute.


The key in .uns that corresponds to the reconstructed vector field.


The key under which to add the dictionary Fate (includes t and prediction keys).


Which layer of the data will be used for predicting cell fate with the reconstructed vector field function.


The direction to predict the cell fate. One of the forward, backward or both string.


The number of uniformly interpolated time points.


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


The method to calculate the average cell state at each time step, can be one of origin or trajectory. If origin used, the average expression state from the init_cells will be calculated and the fate prediction is based on this state. If trajectory used, the average expression states of all cells predicted from the vector field function at each time point will be used. If average is False, no averaging will be applied.


Number of cores to calculate path integral for predicting cell fate. If cores is set to be > 1, multiprocessing will be used to parallel the fate prediction.


Whether to copy adata or modify it inplace.


Additional parameters that will be passed into the fate function.


An AnnData object is updated/copied with the key_added dictionary in the .uns attribute.

The key_added dictionary which contains:

t: The time at which the cell state are predicted. prediction: Predicted cells states at different time points. Row order corresponds to the element order in

t. If init_states corresponds to multiple cells, the expression dynamics over time for each cell is concatenated by rows. That is, the final dimension of prediction is (len(t) * n_cells, n_features). n_cells: number of cells; n_features: number of genes or number of low dimensional embeddings. Of note, if the average is set to be True, the average cell state at each time point is calculated for all cells.