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 plottinglevels (
Union[str,List[str]]) – Level or levels of the classifier to plot important features of “all” creates plots for whole hierarchyhierarchy – 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 datadata_key (
Union[str,list,None] (default:utils.DATA_KEY)) – Key in .obsm where feature data existsholdout_only (
bool(default:False)) – Whether to only include data that was not trained onbatch_key (
str(default:None)) – Column within the adata.obs that delineates batcheskey_added (
str(default:'lin')) – Key in .obsm, where results from high-confidence thresholding and predicted probabilities are storedsave (
str(default:None)) – Filepath to pdf where the plots will be savedshow (
bool(default:True)) – Whether to show the saved feature plotstitle_addition (
str(default:None)) – Phrase to add to the title of the feature plots