ehrapy.plot.rank_features_groups_tracksplot¶
- ehrapy.plot.rank_features_groups_tracksplot(adata, groups=None, n_features=None, groupby=None, var_names=None, feature_symbols=None, min_logfoldchange=None, key=None, show=None, save=None, **kwds)[source]¶
Plot ranking of genes using tracksplot plot (see
tracksplot()
)- Parameters:
adata (
AnnData
) – Annotated data matrix.n_features (
int
|None
) – Number of features to show. Is ignored if feature_names is passed.feature_symbols (
str
|None
) – Key for field in .var that stores feature symbols if you do not want to use .var_names displayed in the plot.var_names (
Sequence
[str
] |Mapping
[str
,Sequence
[str
]] |None
) – Feature names.min_logfoldchange (
float
|None
) – Minimum log fold change to consider.key (
str
|None
) – The key of the calculated feature group rankings (default: ‘rank_features_groups’).
Examples
>>> import ehrapy as ep >>> adata = ep.dt.mimic_2(encoded=True) >>> ep.pp.knn_impute(adata) >>> ep.pp.log_norm(adata, offset=1) >>> ep.pp.neighbors(adata) >>> ep.tl.leiden(adata, resolution=0.15, key_added="leiden_0_5") >>> ep.tl.rank_features_groups(adata, groupby="leiden_0_5") >>> ep.pl.rank_features_groups_tracksplot(adata, key="rank_features_groups")
- Preview: