ktplotspy.plot.plot_cpdb_heatmap
- ktplotspy.plot.plot_cpdb_heatmap(pvals, cell_types=None, degs_analysis=False, log1p_transform=False, alpha=0.05, linewidths=0.5, row_cluster=True, col_cluster=True, low_col='#104e8b', mid_col='#ffdab9', high_col='#8b0a50', cmap=None, title='', return_tables=False, symmetrical=True, default_sep='|', **kwargs)[source]
Plot cellphonedb results as total counts of interactions.
- Parameters:
adata (AnnData) – AnnData object with the .obs storing the celltype_key. The .obs_names must match the first column of the input meta.txt used for cellphonedb.
cell_types (Optional[List[str]], optional) – List of cell types to include in the heatmap. If None, all cell types are included.
pvals (pd.DataFrame) – Dataframe corresponding to pvalues.txt or relevant_interactions.txt from cellphonedb.
degs_analysis (bool, optional) – Whether cellphonedb was run in deg_analysis mode.
log1p_transform (bool, optional) – Whether to log1p transform the output.
alpha (float, optional) – P value threshold value for significance.
linewidths (float, optional) – Width of lines between each cell.
row_cluster (bool, optional) – Whether to cluster rows.
col_cluster (bool, optional) – Whether to cluster columns.
low_col (str, optional) – Low colour in gradient.
mid_col (str, optional) – Middle colour in gradient.
high_col (str, optional) – High colour in gradient.
cmap (Optional[Union[ListedColormap, str]], optional) – Built-in matplotlib colormap names or custom ListedColormap
title (str, optional) – Plot title.
return_tables (bool, optional) – Whether to return the dataframes storing the interaction network.
symmetrical (bool, optional) – Whether to return the sum of interactions as symmetrical heatmap.
default_sep (str, optional) – The default separator used when CellPhoneDB was run.
**kwargs – Passed to seaborn.clustermap.
- Returns:
Either heatmap of cellphonedb interactions or dataframe containing the interaction network.
- Return type:
Union[sns.matrix.ClusterGrid, Dict]