scHopfield.plotting.plot_grn_subset

scHopfield.plotting.plot_grn_subset(adata: AnnData, cluster: str, selected_genes: List[str], cluster_key: str = 'cell_type', score_size: str | None = None, node_positions: Dict[str, tuple] | None = None, prune_threshold: float = 0, selected_edges: List[tuple] | None = None, node_color: str = 'white', label_offset: float = 0.11, label_size: int = 12, variable_width: bool = False, figsize: tuple = (10, 10), ax: Axes | None = None) Axes[source]

Plot a Gene Regulatory Network (GRN) for a user-defined subset of genes.

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

  • cluster (str) – Cluster name

  • selected_genes (list) – List of genes to include in the graph

  • 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

  • node_positions (dict, optional) – Dictionary with custom node positions {gene: (x, y)}

  • prune_threshold (float, optional (default: 0)) – Edges below this threshold (absolute value) will be removed

  • selected_edges (list of tuples, optional) – List of user-defined edges (tuples) to plot

  • node_color (str, optional (default: 'white')) – Color of nodes

  • label_offset (float, optional (default: 0.11)) – Distance of labels from nodes

  • label_size (int, optional (default: 12)) – Font size for labels

  • variable_width (bool, optional (default: False)) – Whether to use variable edge widths based on weight

  • 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