scHopfield.tools.compute_rotational_part
- scHopfield.tools.compute_rotational_part(adata: AnnData, spliced_key: str = 'Ms', degradation_key: str = 'gamma', cluster_key: str = 'cell_type', device: str = 'cpu', copy: bool = False) AnnData | None[source]
Compute the rotational (antisymmetric) part of the Jacobian.
The rotational part is: A = 0.5 * (J - J^T) Its Frobenius norm indicates local rotation strength.
- Parameters:
adata (AnnData) – Annotated data object with fitted parameters
spliced_key (str, optional (default: 'Ms')) – Layer key for spliced counts
degradation_key (str, optional (default: 'gamma')) – Base key for degradation rates
cluster_key (str, optional (default: 'cell_type')) – Key in adata.obs for cluster labels
device (str, optional (default: 'cpu')) – Device for computation: ‘cpu’ or ‘cuda’
copy (bool, optional (default: False)) – If True, return a copy instead of modifying in-place
- Returns:
Returns adata if copy=True, otherwise None. Adds to adata.obs: - ‘jacobian_rotational’: Frobenius norm of rotational part
- Return type:
AnnData or None