scHopfield.tools.decompose_degradation_energy

scHopfield.tools.decompose_degradation_energy(adata: AnnData, cluster: str, spliced_key: str = 'Ms', degradation_key: str = 'gamma', cluster_key: str = 'cell_type', x: ndarray | None = None) ndarray[source]

Calculate gene-wise degradation energy decomposition.

Computes the degradation energy contribution for each gene separately, allowing analysis of which genes contribute most to the total degradation energy.

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

  • cluster (str) – Cluster name to use for parameters

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

  • degradation_key (str, optional (default: 'gamma')) – Key in adata.var for degradation rates

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

  • x (np.ndarray, optional) – Optional expression data. If None, uses stored sigmoid values

Returns:

Array of shape (n_cells, n_genes) with degradation energy per gene

Return type:

np.ndarray