scHopfield.tools.compute_jacobian_stats

scHopfield.tools.compute_jacobian_stats(adata: AnnData, filename: str | None = None, store_in_obs: bool = True, copy: bool = False) AnnData | None[source]

Compute summary statistics from Jacobian eigenvalues.

Computes and stores: - First eigenvalue (real and imaginary parts) - Number of positive/negative real eigenvalues - Jacobian trace (sum of eigenvalues) - Rotational part magnitude (if full Jacobians available)

Parameters:
  • adata (AnnData) – Annotated data object with jacobian_eigenvalues in obsm or filename specified

  • filename (str, optional) – Path to HDF5 file with saved Jacobians. If None, uses adata.obsm[‘jacobian_eigenvalues’]

  • store_in_obs (bool, optional (default: True)) – Whether to store results in adata.obs

  • 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_eig1_real’: Real part of first eigenvalue - ‘jacobian_eig1_imag’: Imaginary part of first eigenvalue - ‘jacobian_positive_evals’: Count of positive real eigenvalues - ‘jacobian_negative_evals’: Count of negative real eigenvalues - ‘jacobian_trace’: Trace of Jacobian (sum of eigenvalues) - ‘jacobian_rotational’: Rotational part magnitude (if available)

Return type:

AnnData or None