SpatialQuery.spatial_query.de_genes
- spatial_query.de_genes(ind_group1, ind_group2, genes=None, min_fraction=0.05, method='fisher', alpha=None)[source]
Identify differential genes between two groups of cells.
- Parameters:
ind_group1 (List[int]) – List of indices of cells in group 1.
ind_group2 (List[int]) – List of indices of cells in group 2.
genes (str or List[str], optional) – List of gene names to query. If None, all genes will be used.
min_fraction (float, default=0.05) – The minimum fraction of cells that express a gene for it to be considered differentially expressed.
method ({'fisher', 't-test', 'wilcoxon'}, default='fisher') – The method to use for DE analysis. If build_gene_index=True, only Fisher’s exact test is supported.
alpha (float, optional) – Significance threshold for adjusted p-values. If None, defaults to 0.1 when using Fisher’s exact test and 0.05 otherwise.
- Return type:
pd.DataFrame containing the differentially expressed genes between the two groups.