scHopfield.plotting.plot_grn_network

scHopfield.plotting.plot_grn_network(adata: AnnData, cluster: str, genes: List[str] | None = None, cluster_key: str = 'cell_type', score_size: str | None = None, size_threshold: float = 0, cmap: str = 'RdBu_r', topn: int | None = None, w_quantile: float = 0.99, figsize: tuple = (10, 10), ax: Axes | None = None) Axes[source]

Generate a Gene Regulatory Network (GRN) graph for a cluster.

Parameters:
  • adata (AnnData) – Annotated data object with interaction matrices

  • cluster (str) – Cluster name

  • genes (list, optional) – List of gene names to include. If None, uses all genes

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

  • score_size (str, optional) – Column in adata.var (with cluster suffix) to use for node sizes. Example: ‘degree_centrality_out’ will use ‘degree_centrality_out_{cluster}’

  • size_threshold (float, optional (default: 0)) – Threshold for displaying node labels (as fraction of max size)

  • cmap (str or Colormap, optional (default: 'RdBu_r')) – Colormap for edge coloring

  • topn (int, optional) – Number of top genes to retain based on size

  • w_quantile (float, optional (default: 0.99)) – Quantile threshold for filtering weak edges

  • figsize (tuple, optional (default: (10, 10))) – Figure size

  • ax (plt.Axes, optional) – Axes to plot on

Returns:

Axes with network plot

Return type:

plt.Axes