nichecompass.utils.generate_enriched_gp_info_plots
- nichecompass.utils.generate_enriched_gp_info_plots(plot_label, model, sample_key, differential_gp_test_results_key, cat_key, cat_palette, n_top_enriched_gp_start_idx=0, n_top_enriched_gp_end_idx=10, feature_spaces=['latent'], n_top_genes_per_gp=3, n_top_peaks_per_gp=0, scale_omics_ft=False, save_figs=False, figure_folder_path='', file_format='png', spot_size=30.0)
Generate info plots of enriched gene programs. These show the enriched category, the gp activities, as well as the counts (or log normalized counts) of the top genes and/or peaks in a specified feature space.
- Parameters:
plot_label (
str) – Main label of the plots.model (
NicheCompass) – A trained NicheCompass model.sample_key (
str) – Key in ´adata.obs´ where the samples are stored.differential_gp_test_results_key (
str) – Key in ´adata.uns´ where the results of the differential gene program testing are stored.cat_key (
str) – Key in ´adata.obs´ where the categories that are used as colors for the enriched category plot are stored.cat_palette (
dict) – Dictionary of colors that are used to highlight the categories, where the category is the key of the dictionary and the color is the value.n_top_enriched_gp_start_idx (
int(default:0)) – Number of top enriched gene program from which to start the creation of plots.n_top_enriched_gp_end_idx (
int(default:10)) – Number of top enriched gene program at which to stop the creation of plots.feature_spaces (
list(default:['latent'])) – List of feature spaces used for the info plots. Can be ´latent´ to use the latent embeddings for the plots, or it can be any of the samples stored in ´adata.obs[sample_key]´ to use the respective physical feature space for the plots.n_top_genes_per_gp (
int(default:3)) – Number of top genes per gp to be considered in the info plots.n_top_peaks_per_gp (
int(default:0)) – Number of top peaks per gp to be considered in the info plots. If ´>0´, requires the model to be trained inlcuding ATAC modality.scale_omics_ft (
bool(default:False)) – If ´True´, scale genes and peaks before plotting.save_figs (
bool(default:False)) – If ´True´, save the figures.figure_folder_path (
str(default:'')) – Folder path where the figures will be saved.file_format (
str(default:'png')) – Format with which the figures will be saved.spot_size (
float(default:30.0)) – Spot size used for the spatial plots.