scHopfield.plotting.plot_centrality_comparison
- scHopfield.plotting.plot_centrality_comparison(adata: AnnData, cluster1: str, cluster2: str, metric: str = 'degree_centrality_all', cluster_key: str = 'cell_type', percentile: float = 99, annotate: bool = True, ignore_genes: List[str] | None = None, ax: Axes | None = None) Axes[source]
Compare network centrality scores between two clusters.
- Parameters:
adata (AnnData) – Annotated data object with computed centrality metrics
cluster1 (str) – First cluster name (x-axis)
cluster2 (str) – Second cluster name (y-axis)
metric (str, optional (default: 'degree_centrality_all')) – Centrality metric to compare. Available: ‘degree_all’, ‘degree_centrality_all’, ‘degree_in’, ‘degree_centrality_in’, ‘degree_out’, ‘degree_centrality_out’, ‘betweenness_centrality’, ‘eigenvector_centrality’
cluster_key (str, optional (default: 'cell_type')) – Key in adata.obs for cluster labels
percentile (float, optional (default: 99)) – Percentile threshold for highlighting genes
annotate (bool, optional (default: True)) – Whether to annotate high-scoring genes
ignore_genes (list, optional) – List of genes to exclude from plotting
ax (plt.Axes, optional) – Axes to plot on
- Returns:
Axes with plot
- Return type:
plt.Axes