mmc.plot_important_features()

mmochi.plotting.plot_important_features(adata, levels, hierarchy, reference='hc -> class', data_key=utils.DATA_KEY, holdout_only=False, batch_key=None, key_added='lin', save=None, show=True, title_addition=None)

Creates violin plots for the 25 most important genes or proteins for each specified level in levels.

Parameters:
  • adata (AnnData) – AnnData object to use for plotting

  • levels (Union[str, List[str]]) – Level or levels of the classifier to plot important features of “all” creates plots for whole hierarchy

  • hierarchy – Hierarchy object with classification level information

  • reference (str (default: 'hc -> class')) – Key in the .obs used to group the violin plots. If ‘hc -> class’, will also add column to obsm containing high-confidence -> level tags to the data

  • data_key (Union[str, list, None] (default: utils.DATA_KEY)) – Key in .obsm where feature data exists

  • holdout_only (bool (default: False)) – Whether to only include data that was not trained on

  • batch_key (str (default: None)) – Column within the adata.obs that delineates batches

  • key_added (str (default: 'lin')) – Key in .obsm, where results from high-confidence thresholding and predicted probabilities are stored

  • save (str (default: None)) – Filepath to pdf where the plots will be saved

  • show (bool (default: True)) – Whether to show the saved feature plots

  • title_addition (str (default: None)) – Phrase to add to the title of the feature plots