scHopfield.plotting.plot_correlations_grid
- scHopfield.plotting.plot_correlations_grid(adata: AnnData, cluster_key: str = 'cell_type', energy: str = 'total', order: List[str] | None = None, colors: List | Dict | None = None, x_low: float = -0.5, x_high: float = 0.5, y_low: float = -0.5, y_high: float = 0.5, **kwargs) Figure[source]
Plot grid of correlation scatter plots between all pairs of clusters.
Creates a matrix where the diagonal shows cluster names and the off-diagonal plots show gene correlation scatter plots between clusters.
- Parameters:
adata (AnnData) – Annotated data object with computed correlations
cluster_key (str, optional (default: 'cell_type')) – Key in adata.obs for cluster labels
energy (str, optional (default: 'total')) – Energy type: ‘total’, ‘interaction’, ‘degradation’, or ‘bias’
order (list, optional) – Order of clusters to display. If None, uses all unique clusters
colors (list or dict, optional) – Colors for each cluster. If dict, maps cluster names to colors. If list, colors in order matching order parameter. Colors should be RGBA tuples or RGB tuples.
x_low (float, optional (default: -0.5)) – Lower x threshold for highlighting divergent genes
x_high (float, optional (default: 0.5)) – Upper x threshold for highlighting divergent genes
y_low (float, optional (default: -0.5)) – Lower y threshold for highlighting divergent genes
y_high (float, optional (default: 0.5)) – Upper y threshold for highlighting divergent genes
**kwargs – Additional arguments: - figsize : tuple (default: (15, 15)) - tight_layout : bool (default: True)
- Returns:
Figure with correlation grid
- Return type:
plt.Figure