, key=None, groupby=None, use_raw=None, key_added='rank_genes_groups_filtered', min_in_group_fraction=0.25, min_fold_change=1, max_out_group_fraction=0.5, compare_abs=False)

Filters out genes based on log fold change and fraction of genes expressing the gene within and outside the groupby categories.

See rank_genes_groups().

Results are stored in adata.uns[key_added] (default: ‘rank_genes_groups_filtered’).

To preserve the original structure of adata.uns[‘rank_genes_groups’], filtered genes are set to NaN.

adata : AnnData

key : default: None

groupby : default: None

use_raw : default: None

key_added : default: 'rank_genes_groups_filtered'

min_in_group_fraction : default: 0.25

min_fold_change : default: 1

max_out_group_fraction : default: 0.5

compare_abs : default: False

If True, compare absolute values of log fold change with min_fold_change.


Same output as but with filtered genes names set to nan

Return type



>>> import scanpy as sc
>>> adata = sc.datasets.pbmc68k_reduced()
>>>, 'bulk_labels', method='wilcoxon')
>>>, min_fold_change=3)
>>> # visualize results
>>>, key='rank_genes_groups_filtered')
>>> # visualize results using dotplot
>>>, key='rank_genes_groups_filtered')