scanvi_explainer.plots.feature_plot

Contents

scanvi_explainer.plots.feature_plot#

scanvi_explainer.plots.feature_plot(explainer: SCANVIDeep, shap_values: ndarray, subset: bool = False, top_n: int = 10, gene_symbols: None | str = None, n_cols: int = 2, figsize: tuple[int, int] = (20, 20), return_fig: bool = False) Figure | None#

Prints feature contribution (absolute mean SHAP value) for each cell type (top 10).

Parameters:
  • explainerSCANVIDeep explainer

  • shap_valuesndarray Expected SHAP values

  • subset – When set to true, calculate contribution by subsetting for test cells which belong to that particual classifier. When set to false, be generic and return contributing features even when testing set has different cell types.

  • top_n (int) – Subset for top N number of features

  • gene_symbols (None | str = None) – Column name in var for gene symbols

  • n_cols (int) – Number of columns in Figure

  • figsize (tuple[int, int]) – Figure size, by default [20, 20]

  • return_fig (bool) – Flag to return figure object, by default False