scHopfield.tools.energy_gene_correlation

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

Correlate energies with gene expression.

Computes Pearson correlation between energy values and each gene’s expression for each cluster.

Adapted from Landscape.energy_genes_correlation.

Parameters:
  • adata (AnnData) – Annotated data object with computed energies

  • spliced_key (str, optional (default: 'Ms')) – Key in adata.layers for expression data

  • 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.var for each cluster and energy type: - ‘correlation_total_{cluster}’ - ‘correlation_interaction_{cluster}’ - ‘correlation_degradation_{cluster}’ - ‘correlation_bias_{cluster}’

Return type:

AnnData or None