scHopfield.plotting.plot_centrality_scatter

scHopfield.plotting.plot_centrality_scatter(adata: AnnData, x_metric: str, y_metric: str, cluster_key: str = 'cell_type', order: List[str] | None = None, colors: Dict[str, str] | None = None, n_top_genes: int = 3, filter_threshold: tuple | None = None, figsize: tuple | None = None) Figure[source]

Plot scatter of two centrality metrics for all clusters.

Creates a grid showing relationship between two centrality metrics across all clusters, annotating top genes.

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

  • x_metric (str) – Centrality metric for x-axis

  • y_metric (str) – Centrality metric for y-axis

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

  • order (list, optional) – Order of clusters to display

  • colors (dict, optional) – Colors for each cluster

  • n_top_genes (int, optional (default: 3)) – Number of top genes to annotate per cluster

  • filter_threshold (tuple, optional) – (metric_name, operator, value) to filter genes before finding top. E.g., (‘degree_centrality’, ‘<’, 0.5) to find high betweenness genes with low degree

  • figsize (tuple, optional) – Figure size. If None, auto-calculated based on number of clusters

Returns:

Figure with subplots

Return type:

plt.Figure