scanpy.get.rank_genes_groups_df

scanpy.get.rank_genes_groups_df#

scanpy.get.rank_genes_groups_df(adata, group, *, key='rank_genes_groups', pval_cutoff=None, log2fc_min=None, log2fc_max=None, gene_symbols=None)[source]#

scanpy.tl.rank_genes_groups() results in the form of a DataFrame.

Parameters:
adata AnnData

Object to get results from.

group str | Iterable[str] | None

Which group (as in scanpy.tl.rank_genes_groups()’s groupby argument) to return results from. Can be a list. All groups are returned if groups is None.

key str (default: 'rank_genes_groups')

Key differential expression groups were stored under.

pval_cutoff float | None (default: None)

Return only adjusted p-values below the cutoff.

log2fc_min float | None (default: None)

Minimum logfc to return.

log2fc_max float | None (default: None)

Maximum logfc to return.

gene_symbols str | None (default: None)

Column name in .var DataFrame that stores gene symbols. Specifying this will add that column to the returned dataframe.

Return type:

DataFrame

Example

>>> import scanpy as sc
>>> pbmc = sc.datasets.pbmc68k_reduced()
>>> sc.tl.rank_genes_groups(pbmc, groupby="louvain", use_raw=True)
>>> dedf = sc.get.rank_genes_groups_df(pbmc, group="0")