spapros.se.select_DE_genes
- spapros.se.select_DE_genes(adata, n, per_group=False, obs_key='celltype', penalty_keys=[], groups='all', reference='rest', rankby_abs=False, inplace=True, progress=None, verbosity=2, level=2, task='Select DE genes...')
Select genes based on wilxocon rank genes test.
- Parameters:
adata (AnnData) – Data with log normalised counts in adata.X.
n (int) – int Number of genes to selected (in total if not
per_group
else per group).per_group (bool) – Select
n
genes per group of adata.obs[obs_key] (default: False). Note that the same gene can be selected for multiple groups.obs_key (str) – Column name of adata.obs for which marker scores are calculated.
penalty_keys (list) – Penalty factor for gene selection.
groups (Union[Literal['all'], ~typing.Iterable[str]]) – See sc.tl.rank_genes_groups().
reference (str) – See sc.tl.rank_genes_groups() but extended to lists of reference groups. Note that in case of providing such a list you need to include all elements of groups in reference.
rankby_abs (bool) – See
sc.tl.rank_genes_groups()
.inplace (bool) – Save results in
adata.var
or return dataframe.progress (Optional[Progress]) –
rich.Progress
object if progress bars should be shown.verbosity (int) – Verbosity level.
level (int) – Progress bar level.
task (str) – Description of progress task.
- Returns:
Index are genes as in adata.var.index. It contains a bool column named ‘selection’.
- Return type:
pd.DataFrame