scHopfield.dynamics.get_top_affected_genes
- scHopfield.dynamics.get_top_affected_genes(adata: AnnData, n_genes: int = 20, cluster: str | None = None, cluster_key: str = 'cell_type', exclude_perturbed: bool = True) DataFrame[source]
Get the top genes most affected by the perturbation.
- Parameters:
adata (AnnData) – Annotated data object with simulation results
n_genes (int, optional (default: 20)) – Number of top genes to return
cluster (str, optional) – If specified, analyze only cells in this cluster
cluster_key (str, optional (default: 'cell_type')) – Key in adata.obs for cluster labels
exclude_perturbed (bool, optional (default: True)) – If True, exclude the perturbed genes from the results
- Returns:
DataFrame with top affected genes and their mean delta_X values
- Return type:
pd.DataFrame