.sample_correlation_matrix
- proteopy.pl.sample_correlation_matrix(adata, method='pearson', zero_to_na=False, layer=None, fill_na=None, margin_color=None, color_scheme=None, cmap='coolwarm', linkage_method='average', xticklabels=False, yticklabels=False, figsize=(9.0, 7.0), show=True, ax=False, save=None)[source]
Plot a clustered correlation heatmap across samples (obs).
- Parameters:
adata (AnnData) –
AnnDatawith proteomics annotations.method (str) – Correlation estimator passed to
pandas.DataFrame.corr().zero_to_na (bool) – Replace zeros with missing values before computing correlations.
layer (str | None) – Optional
adata.layerskey to draw quantification values from. WhenNonethe primary matrixadata.Xis used.fill_na (float | None) – Constant used to replace remaining
NaNvalues prior to correlation. WhenNone(default), aValueErroris raised if missing values are detected (suggestingfill_na=0).margin_color (str | None) – Optional column in
adata.obsused to color dendrogram labels.color_scheme (Any) – Color palette specification understood by
proteopy.utils.matplotlib._resolve_color_scheme().cmap (str) – Continuous colormap for the heatmap body.
linkage_method (str) – Linkage criterion handed to
scipy.cluster.hierarchy.linkage().xticklabels (bool) – Whether to show x- and y-axis tick labels.
yticklabels (bool) – Whether to show x- and y-axis tick labels.
figsize (tuple[float, float]) – Matplotlib figure size in inches.
show (bool) – Display the figure with
matplotlib.pyplot.show().ax (bool) – Return the heatmap
matplotlib.axes.AxeswhenTrue.save (str | Path | None) – File path for saving the Seaborn cluster map. When
Nonenothing is written.
- Returns:
Heatmap axes when
axisTrue; otherwiseNone.- Return type:
Axes or None
- Raises:
ValueError – If the selected matrix still contains missing values after optional zero replacement and
fill_naisNone.