scHopfield.tools.load_jacobians

scHopfield.tools.load_jacobians(adata: AnnData, filename: str, load_eigenvectors: bool = False) ndarray | None[source]

Load Jacobian eigenvalues and optionally eigenvectors from HDF5 file.

Loads eigenvalues into adata.obsm[‘jacobian_eigenvalues’]. Optionally loads and returns eigenvectors as a numpy array (not stored in adata to save memory).

Parameters:
  • adata (AnnData) – Annotated data object to load data into

  • filename (str) – Path to HDF5 file with saved Jacobian data

  • load_eigenvectors (bool, optional (default: False)) – Whether to load eigenvectors (returns them if True)

Returns:

If load_eigenvectors=True, returns eigenvectors array of shape (n_cells, n_genes, n_genes). Otherwise returns None. Always loads eigenvalues into adata.obsm[‘jacobian_eigenvalues’]

Return type:

Optional[np.ndarray]