scSemiProfiler.utils.geneset_pattern

scSemiProfiler.utils.geneset_pattern(adata, genes, condition_key, celltype_key, totaltypes=None, baseline=None, save=None)[source]

Generate heatmaps for visualizing gene set activation pattern in a dataset.

Parameters
  • adata (anndata._core.anndata.AnnData) – The dataset to investigate

  • genes (list) – The list of genes in the gene set

  • condition_key (str) – The key in .obs specifying different sample conditions.

  • celltype_key (str) – The key in .obs specifying cell type information

  • totaltypes (typing.Union[numpy.array, list, None]) – Total cell type names

  • baseline (typing.Optional[str]) – Baseline condition

  • save – Path within the ‘figures’ folder to save the plot

Return type

numpy.array

Returns

pattern – np.array

Example

>>> gtmtx = geneset_pattern(gtdata,IFN_genes,'states_collection_sum','celltypes')