scSemiProfiler.utils.enrichment_comparison

scSemiProfiler.utils.enrichment_comparison(name, gtdata, semisdata, celltype_key, selectedtype, save=None)[source]

Compare the enrichment analysis results using the real-profiled and semi-profiled datasets.

Parameters
  • name (str) – Project name

  • gtdata (anndata._core.anndata.AnnData) – Real-profiled (ground truth) data

  • semisdata (anndata._core.anndata.AnnData) – Semi-profiled dataset

  • celltype_key (str) – The key in anndata.AnnData.obs for storing the cell type information

  • selectedtype (str) – The selected cell type to analyze

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

Return type

typing.Tuple[numpy.array, numpy.array, numpy.array, numpy.array]

Returns

  • CommonDEGs – The number of overlapping DEGs between real and semi-profiled data

  • HypergeometricP – P-value of hypergeometric test examining the overlap between two versions of DEGs

  • PearsonR – Pearson correlation between bar lengths in real-profiled and semi-profiled bar plots

  • PearsonP – P-value of the Pearson correlation test

Example

>>> _ = enrichment_comparison(name, gtdata, semisdata, celltype_key = 'celltypes', selectedtype = 'CD4')