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 investigategenes (
list) – The list of genes in the gene setcondition_key (
str) – The key in .obs specifying different sample conditions.celltype_key (
str) – The key in .obs specifying cell type informationtotaltypes (
typing.Union[numpy.array,list,None]) – Total cell type namesbaseline (
typing.Optional[str]) – Baseline conditionsave – 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')