spateo.tdr.morphometrics.morphofield.gaussian_process

Functions

_con_K(→ Union[Tuple[numpy.ndarray, numpy.ndarray], ...)

_con_K_geodist(→ Union[Tuple[numpy.ndarray, ...)

_gp_velocity(→ numpy.ndarray)

morphofield_gp(→ Optional[anndata.AnnData])

Calculating and predicting the vector field during development by the Gaussian Process method.

Module Contents

spateo.tdr.morphometrics.morphofield.gaussian_process._con_K(x: numpy.ndarray, y: numpy.ndarray, beta: float = 0.1, method: str = 'cdist', return_d: bool = False) Tuple[numpy.ndarray, numpy.ndarray] | numpy.ndarray[source]
spateo.tdr.morphometrics.morphofield.gaussian_process._con_K_geodist(x: numpy.ndarray, kernel_dict: dict, beta: float = 0.1, return_d: bool = False) Tuple[numpy.ndarray, numpy.ndarray] | numpy.ndarray[source]
spateo.tdr.morphometrics.morphofield.gaussian_process._gp_velocity(X: numpy.ndarray, vf_dict: dict) numpy.ndarray[source]
spateo.tdr.morphometrics.morphofield.gaussian_process.morphofield_gp(adata: anndata.AnnData, spatial_key: str = 'align_spatial', vf_key: str = 'VecFld_morpho', NX: numpy.ndarray | None = None, grid_num: List[int] | None = None, inplace: bool = True) anndata.AnnData | None[source]

Calculating and predicting the vector field during development by the Gaussian Process method.

Parameters:
adata

AnnData object that contains the cell coordinates of the two states after alignment.

spatial_key

The key from the .obsm that corresponds to the spatial coordinates of each cell.

vf_key

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

key_added

The key that will be used for the vector field key in .uns.

NX

The spatial coordinates of new data point. If NX is None, generate new points based on grid_num.

grid_num

The number of grids in each dimension for generating the grid velocity. Default is [50, 50, 50].

inplace

Whether to copy adata or modify it inplace.

Returns:

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

The key_added dictionary which contains:

X: Cell coordinates of the current state. V: Developmental direction of the X. grid: Grid coordinates of current state. grid_V: Prediction of developmental direction of the grid. method: The method of learning vector field. Here method == ‘gaussian_process’.