spateo.tdr.morphometrics.morphofield_dg.GPVectorField
#
Module Contents#
Classes#
Functions#
|
Calculate acceleration. |
|
Calculate curvature. |
|
Calculate curl for 2D or 3D systems. |
|
Calculate torsion. |
|
Calculate divergence for many samples by taking the trace of a Jacobian matrix. |
|
Calculate sensitivity. |
|
analytical Jacobian for RKHS vector field functions with Gaussian kernel. |
- spateo.tdr.morphometrics.morphofield_dg.GPVectorField.compute_acceleration(vf, f_jac, X, Js=None, return_all=False)[source]#
Calculate acceleration.
- spateo.tdr.morphometrics.morphofield_dg.GPVectorField.compute_curvature(vf, f_jac, X, Js=None, formula=2)[source]#
Calculate curvature.
- spateo.tdr.morphometrics.morphofield_dg.GPVectorField.compute_curl(f_jac, X)[source]#
Calculate curl for 2D or 3D systems.
- spateo.tdr.morphometrics.morphofield_dg.GPVectorField.compute_torsion(vf, f_jac, X)[source]#
Calculate torsion.
- spateo.tdr.morphometrics.morphofield_dg.GPVectorField.compute_divergence(f_jac, X: numpy.ndarray, Js: numpy.ndarray | None = None, vectorize_size: int = 1000) numpy.ndarray [source]#
Calculate divergence for many samples by taking the trace of a Jacobian matrix.
- vectorize_size is used to control the number of samples computed in each vectorized batch.
If vectorize_size = 1, there’s no vectorization whatsoever. If vectorize_size = None, all samples are vectorized.
- Parameters:
- f_jac
function for calculating Jacobian from cell states
- X
cell states
- Js
Jacobian matrices for each sample, if X is not provided
- vectorize_size
number of Jacobian matrices to process at once in the vectorization
- Returns:
divergence np.ndarray across Jacobians for many samples
- spateo.tdr.morphometrics.morphofield_dg.GPVectorField.compute_sensitivity(f_jac, X)[source]#
Calculate sensitivity.
- spateo.tdr.morphometrics.morphofield_dg.GPVectorField.Jacobian_GP_gaussian_kernel(X: numpy.ndarray, vf_dict: dict, vectorize: bool = False) numpy.ndarray [source]#
analytical Jacobian for RKHS vector field functions with Gaussian kernel.
Args: x: Coordinates where the Jacobian is evaluated. vf_dict: A dictionary containing RKHS vector field control points, Gaussian bandwidth,
and RKHS coefficients. Essential keys: ‘X_ctrl’, ‘beta’, ‘C’
- Returns:
- Jacobian matrices stored as d-by-d-by-n numpy arrays evaluated at x.
d is the number of dimensions and n the number of coordinates in x.
- class spateo.tdr.morphometrics.morphofield_dg.GPVectorField.GPVectorField[source]#
- from_adata(adata: anndata.AnnData, vf_key: str = 'VecFld')[source]#
- get_data() Tuple[numpy.ndarray, numpy.ndarray] [source]#
- compute_velocity(X: numpy.ndarray)[source]#
- compute_acceleration(X: numpy.ndarray | None = None, **kwargs)[source]#
- compute_curvature(X: numpy.ndarray | None = None, formula: int = 2, **kwargs)[source]#
- compute_curl(X: numpy.ndarray | None = None, dim1: int = 0, dim2: int = 1, dim3: int = 2, **kwargs) numpy.ndarray [source]#
- compute_torsion(X: numpy.ndarray | None = None, **kwargs) numpy.ndarray [source]#
- compute_divergence(X: numpy.ndarray | None = None, **kwargs) numpy.ndarray [source]#
- get_Jacobian(method: str = 'analytical', **kwargs) Callable [source]#
Get the Jacobian of the vector field function. The analytical Jacobian will be returned and it always take row vectors as input no matter what input_vector_convention is.
- The returned Jacobian is of the following format:
df_1/dx_1 df_1/dx_2 df_1/dx_3 … df_2/dx_1 df_2/dx_2 df_2/dx_3 … df_3/dx_1 df_3/dx_2 df_3/dx_3 … … … … …