spateo.tdr.morphometrics.morphofield.trajectory =============================================== .. py:module:: spateo.tdr.morphometrics.morphofield.trajectory Functions --------- .. autoapisummary:: spateo.tdr.morphometrics.morphofield.trajectory.morphopath Module Contents --------------- .. py:function:: 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: Optional[Union[int, float]] = None, average: bool = False, cores: int = 1, nonrigid_only: bool = False, inplace: bool = True, **kwargs) -> Optional[anndata.AnnData] Prediction of cell developmental trajectory based on reconstructed vector field. :param adata: AnnData object that contains the reconstructed vector field function in the ``.uns`` attribute. :param vf_key: The key in ``.uns`` that corresponds to the reconstructed vector field. :param key_added: The key under which to add the dictionary Fate (includes ``t`` and ``prediction`` keys). :param layer: Which layer of the data will be used for predicting cell fate with the reconstructed vector field function. :param direction: The direction to predict the cell fate. One of the ``forward``, ``backward`` or ``both`` string. :param interpolation_num: The number of uniformly interpolated time points. :param t_end: The length of the time period from which to predict cell state forward or backward over time. :param average: 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. :param cores: 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. :param nonrigid_only: If True, only the nonrigid part of the vector field will be calculated. :param inplace: Whether to copy adata or modify it inplace. :param \*\*kwargs: Additional parameters that will be passed into the ``fate`` function. :returns: 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.