c2v.pl.predictors_comparison#
- c2v.pl.predictors_comparison(shapdata, group1, group2, varm_key=None, n_genes=10, cmap='RdBu_r', title=None, show=True, figsize=None, ax=None, return_fig=False, **kwargs)#
Draws barplot of SHAP values for two groups.
- Parameters:
- shapdata sc.AnnData
Annotated data matrix with SHAP values in varm.
- group1 str
Name of the first group.
- group2 str
Name of the second group.
- varm_key str | None, optional
Key in varm to SHAP values. Default is None.
- n_genes int, optional
Number of top and bottom genes to plot. Default is 10.
- cmap str, optional
Colormap to use. Default is “RdBu_r”.
- title str | None, optional
Title for the plot. Default is None.
- show bool, optional
Whether to show the plot. Default is True.
- figsize tuple[float, float] | None, optional
Figure size. Default is None.
- ax plt.Axes | None, optional
Axes object to draw on. Default is None.
- return_fig bool, optional
Whether to return the figure object. Default is False.
- **kwargs
Additional keyword arguments for ax.bar().
- Return type:
Figure|Axes|None- Returns:
fig : plt.Figure | plt.Axes | None Figure object if return_fig is True, Axes if show is False, otherwise None.