scHopfield.tools.compute_eigenanalysis

scHopfield.tools.compute_eigenanalysis(adata: AnnData, cluster_key: str = 'cell_type', copy: bool = False) AnnData | None[source]

Compute eigenvalue decomposition for each cluster’s interaction matrix.

Performs eigendecomposition (eigenvalues and eigenvectors) on the interaction matrices W for each cluster. Results are stored in adata.uns[‘scHopfield’][‘eigenanalysis’].

Parameters:
  • adata (AnnData) – Annotated data object with fitted interaction matrices

  • cluster_key (str, optional (default: 'cell_type')) – Key in adata.obs for cluster labels

  • 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.uns[‘scHopfield’][‘eigenanalysis’] for each cluster: - ‘eigenvalues_{cluster}’: complex eigenvalues array - ‘eigenvectors_{cluster}’: complex eigenvectors matrix

Return type:

AnnData or None

Notes

Eigenvalues with large positive real parts indicate unstable directions. Eigenvalues with large negative real parts indicate fast decay directions. The eigenvectors show which gene combinations are associated with these dynamics.