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 namegtdata (
anndata._core.anndata.AnnData) – Real-profiled (ground truth) datasemisdata (
anndata._core.anndata.AnnData) – Semi-profiled datasetcelltype_key (
str) – The key in anndata.AnnData.obs for storing the cell type informationselectedtype (
str) – The selected cell type to analyzesave – 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')