spateo.tdr.morphometrics.morphofield_dg¶
Submodules¶
Functions¶
|
Calculate acceleration for each cell with the reconstructed vector field function. |
|
Calculate curl for each cell with the reconstructed vector field function. |
|
Calculate curvature for each cell with the reconstructed vector field function. |
|
Calculate divergence for each cell with the reconstructed vector field function. |
|
Calculate jacobian for each cell with the reconstructed vector field function. |
|
Calculate torsion for each cell with the reconstructed vector field function. |
|
Calculate the velocity for each cell with the reconstructed vector field function. |
Package Contents¶
- spateo.tdr.morphometrics.morphofield_dg.morphofield_acceleration(adata: anndata.AnnData, vf_key: str = 'VecFld_morpho', key_added: str = 'acceleration', method: str = 'analytical', nonrigid_only: bool = False, inplace: bool = True) anndata.AnnData | None[source]¶
Calculate acceleration for each cell with the reconstructed vector field function.
- Parameters:
- adata
AnnData object that contains the reconstructed vector field.
- vf_key
The key in
.unsthat corresponds to the reconstructed vector field.- key_added
The key that will be used for the acceleration key in
.obsand.obsm.- method
The method that will be used for calculating acceleration field, either
'analytical'or'numerical'.'analytical'method uses the analytical expressions for calculating acceleration while'numerical'method uses numdifftools, a numerical differentiation tool, for computing acceleration.'analytical'method is much more efficient.- nonrigid_only
If True, only the nonrigid part of the vector field will be calculated.
- inplace
Whether to copy adata or modify it inplace.
- Returns:
An
AnnDataobject is updated/copied with thekey_addedin the.obsand.obsmattribute.The
key_addedin the.obswhich contains acceleration. Thekey_addedin the.obsmwhich contains acceleration vectors.
- spateo.tdr.morphometrics.morphofield_dg.morphofield_curl(adata: anndata.AnnData, vf_key: str = 'VecFld_morpho', key_added: str = 'curl', method: str = 'analytical', nonrigid_only: bool = False, inplace: bool = True) anndata.AnnData | None[source]¶
Calculate curl for each cell with the reconstructed vector field function.
- Parameters:
- adata
AnnData object that contains the reconstructed vector field.
- vf_key
The key in
.unsthat corresponds to the reconstructed vector field.- key_added
The key that will be used for the torsion key in
.obs.- method
The method that will be used for calculating torsion field, either
'analytical'or'numerical'.'analytical'method uses the analytical expressions for calculating torsion while'numerical'method uses numdifftools, a numerical differentiation tool, for computing torsion.'analytical'method is much more efficient.- nonrigid_only
If True, only the nonrigid part of the vector field will be calculated.
- inplace
Whether to copy adata or modify it inplace.
- Returns:
An
AnnDataobject is updated/copied with thekey_addedin the.obsand.obsmattribute.The
key_addedin the.obswhich contains magnitude of curl. Thekey_addedin the.obsmwhich contains curl vectors.
- spateo.tdr.morphometrics.morphofield_dg.morphofield_curvature(adata: anndata.AnnData, vf_key: str = 'VecFld_morpho', key_added: str = 'curvature', formula: int = 2, method: str = 'analytical', nonrigid_only: bool = False, inplace: bool = True) anndata.AnnData | None[source]¶
Calculate curvature for each cell with the reconstructed vector field function.
- Parameters:
- adata
AnnData object that contains the reconstructed vector field.
- vf_key
The key in
.unsthat corresponds to the reconstructed vector field.- key_added
The key that will be used for the curvature key in
.obsand.obsm.- formula
Which formula of curvature will be used, there are two formulas, so formula can be either
{1, 2}. By default it is 2 and returns both the curvature vectors and the norm of the curvature. The formula one only gives the norm of the curvature.- method
The method that will be used for calculating curvature field, either
'analytical'or'numerical'.'analytical'method uses the analytical expressions for calculating curvature while'numerical'method uses numdifftools, a numerical differentiation tool, for computing curvature.'analytical'method is much more efficient.- nonrigid_only
If True, only the nonrigid part of the vector field will be calculated.
- inplace
Whether to copy adata or modify it inplace.
- Returns:
An
AnnDataobject is updated/copied with thekey_addedin the.obsand.obsmattribute.The
key_addedin the.obswhich contains curvature. Thekey_addedin the.obsmwhich contains curvature vectors.
- spateo.tdr.morphometrics.morphofield_dg.morphofield_divergence(adata: anndata.AnnData, vf_key: str = 'VecFld_morpho', key_added: str = 'divergence', method: str = 'analytical', vectorize_size: int | None = 1000, nonrigid_only: bool = False, inplace: bool = True) anndata.AnnData | None[source]¶
Calculate divergence for each cell with the reconstructed vector field function.
- Parameters:
- adata
AnnData object that contains the reconstructed vector field.
- vf_key
The key in
.unsthat corresponds to the reconstructed vector field.- key_added
The key that will be used for the acceleration key in
.obsand.obsm.- method
The method that will be used for calculating acceleration field, either
'analytical'or'numerical'.'analytical'method uses the analytical expressions for calculating acceleration while'numerical'method uses numdifftools, a numerical differentiation tool, for computing acceleration.'analytical'method is much more efficient.- vectorize_size
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.
- nonrigid_only
If True, only the nonrigid part of the vector field will be calculated.
- inplace
Whether to copy adata or modify it inplace.
- Returns:
An
AnnDataobject is updated/copied with thekey_addedin the.obsattribute.The
key_addedin the.obswhich contains divergence.
- spateo.tdr.morphometrics.morphofield_dg.morphofield_jacobian(adata: anndata.AnnData, vf_key: str = 'VecFld_morpho', key_added: str = 'jacobian', method: str = 'analytical', nonrigid_only: bool = False, inplace: bool = True) anndata.AnnData | None[source]¶
Calculate jacobian for each cell with the reconstructed vector field function.
- Parameters:
- adata
AnnData object that contains the reconstructed vector field.
- vf_key
The key in
.unsthat corresponds to the reconstructed vector field.- key_added
The key that will be used for the jacobian key in
.obsand.obsm.- method
The method that will be used for calculating jacobian field, either
'analytical'or'numerical'.'analytical'method uses the analytical expressions for calculating jacobian while'numerical'method uses numdifftools, a numerical differentiation tool, for computing jacobian.'analytical'method is much more efficient.- nonrigid_only
If True, only the nonrigid part of the vector field will be calculated.
- inplace
Whether to copy adata or modify it inplace.
- Returns:
An
AnnDataobject is updated/copied with thekey_addedin the.obsand.unsattribute.The
key_addedin the.obswhich contains jacobian. Thekey_addedin the.unswhich contains jacobian tensor.
- spateo.tdr.morphometrics.morphofield_dg.morphofield_torsion(adata: anndata.AnnData, vf_key: str = 'VecFld_morpho', key_added: str = 'torsion', method: str = 'analytical', nonrigid_only: bool = False, inplace: bool = True) anndata.AnnData | None[source]¶
Calculate torsion for each cell with the reconstructed vector field function.
- Parameters:
- adata
AnnData object that contains the reconstructed vector field.
- vf_key
The key in
.unsthat corresponds to the reconstructed vector field.- key_added
The key that will be used for the torsion key in
.obsand.obsm.- method
The method that will be used for calculating torsion field, either
'analytical'or'numerical'.'analytical'method uses the analytical expressions for calculating torsion while'numerical'method uses numdifftools, a numerical differentiation tool, for computing torsion.'analytical'method is much more efficient.- nonrigid_only
If True, only the nonrigid part of the vector field will be calculated.
- inplace
Whether to copy adata or modify it inplace.
- Returns:
An
AnnDataobject is updated/copied with thekey_addedin the.obsand.unsattribute.The
key_addedin the.obswhich contains torsion. Thekey_addedin the.unswhich contains torsion matrix.
- spateo.tdr.morphometrics.morphofield_dg.morphofield_velocity(adata: anndata.AnnData, vf_key: str = 'VecFld_morpho', key_added: str = 'velocity', nonrigid_only: bool = False, inplace: bool = True) anndata.AnnData | None[source]¶
Calculate the velocity for each cell with the reconstructed vector field function.
- Parameters:
- adata
AnnData object that contains the reconstructed vector field.
- vf_key
The key in
.unsthat corresponds to the reconstructed vector field.- key_added
The key that will be used for the velocity key in
.obsm.- nonrigid_only
If True, only the nonrigid part of the vector field will be calculated.
- inplace
Whether to copy adata or modify it inplace.
- Returns:
An
AnnDataobject is updated/copied with thekey_addedin the.obsmattribute which contains velocities.