ehrapy.anndata.get_rank_features_df¶
- ehrapy.anndata.get_rank_features_df(adata, group, *, key='rank_features_groups', pval_cutoff=None, log2fc_min=None, log2fc_max=None, features=None)[source]¶
ehrapy.tl.rank_features_groups()
results in the form of aDataFrame
.- Parameters:
adata (
AnnData
) – AnnData object to get values from.group (
str
|Iterable
[str
]) – Which group (as inehrapy.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_features_groups'
) – Key differential 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.features (
str
|None
, default:None
) – Column name in .var DataFrame that stores gene symbols. Specifying this will add that column to the returned DataFrame.
- Returns:
A Pandas DataFrame of all rank genes groups results.
Examples
>>> import ehrapy as ep >>> adata = ep.dt.mimic_2(encoded=True) >>> ep.tl.rank_features_groups(adata, "service_unit") >>> df = ep.ad.get_rank_features_df(adata, group="FICU")