scHopfield.tools.network_correlations

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

Compute various similarity metrics between cluster interaction networks.

Computes pairwise similarity metrics between cluster-specific interaction matrices, allowing comparison of gene regulatory network structures across different cell types.

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’][‘network_correlations’]: - ‘jaccard’: Jaccard index (binary overlap) - ‘hamming’: Hamming distance (binary difference) - ‘euclidean’: Euclidean distance (continuous) - ‘pearson’: Pearson correlation (continuous) - ‘pearson_bin’: Pearson correlation (binary) - ‘mean_col_corr’: Mean column-wise correlation - ‘singular’: Singular value distance

Return type:

AnnData or None