ehrapy.plot.ranking

ehrapy.plot.ranking(adata, attr, keys, dictionary=None, indices=None, labels=None, color='black', n_points=30, log=False, include_lowest=False, show=None)[source]

Plot rankings.

See, for example, how this is used in pl.pca_loadings.

Parameters:
  • adata (AnnData) – AnnData object object containing all observations.

  • attr (Literal['var', 'obs', 'uns', 'varm', 'obsm']) – The attribute of AnnData that contains the score.

  • keys (str | Sequence[str]) – The scores to look up an array from the attribute of adata.

  • dictionary – Optional key dictionary.

  • indices – Optional dictionary indices.

  • labels – Optional labels.

  • color – Optional primary color (default: black).

  • n_points – Number of points (default: 30)..

  • log – Whether logarithmic scale should be used.

  • include_lowest – Whether to include the lowest points.

  • show – Whether to show the plot.

Returns:

Returns matplotlib gridspec with access to the axes.

Example

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.pp.pca(adata)
TODO: ep.pl.ranking(adata)