Plotting

class scarches.plotting.SCVI_EVAL(model: SCVI | SCANVI | TOTALVI, adata: AnnData, trainer: Trainer | None = None, cell_type_key: str = None, batch_key: str = None)[source]

Bases: object

Methods

plot_latent([show, save, dir_path, ...])

if save:

get_asw

get_classification_accuracy

get_ebm

get_f1_score

get_knn_purity

get_latent_score

get_model_arch

get_nmi

latent_as_anndata

plot_history

get_asw()[source]
get_classification_accuracy()[source]
get_ebm(n_neighbors=50, n_pools=50, n_samples_per_pool=100, verbose=True)[source]
get_f1_score()[source]
get_knn_purity(n_neighbors=50, verbose=True)[source]
get_latent_score()[source]
get_model_arch()[source]
get_nmi()[source]
latent_as_anndata()[source]
plot_history(show=True, save=False, dir_path=None)[source]
plot_latent(show=True, save=False, dir_path=None, n_neighbors=8, predictions=False, in_one=False, colors=None)[source]
if save:
if dir_path is None:

name = ‘scanvi_latent.png’

else:

name = f’{dir_path}.png’

else:

name = False

class scarches.plotting.TRVAE_EVAL(model: trVAE | TRVAE, adata: AnnData, trainer: trVAETrainer | None = None, condition_key: str | None = None, cell_type_key: str | None = None)[source]

Bases: object

Methods

get_asw

get_ebm

get_knn_purity

get_latent_score

get_model_arch

get_nmi

latent_as_anndata

plot_history

plot_latent

get_asw()[source]
get_ebm(n_neighbors=50, n_pools=50, n_samples_per_pool=100, verbose=True)[source]
get_knn_purity(n_neighbors=50, verbose=True)[source]
get_latent_score()[source]
get_model_arch()[source]
get_nmi()[source]
latent_as_anndata()[source]
plot_history(show=True, save=False, dir_path=None)[source]
plot_latent(show=True, save=False, dir_path=None, n_neighbors=8)[source]
scarches.plotting.plot_abs_bfs(adata, scores_key='bf_scores', terms: str | list = 'terms', keys=None, n_cols=3, **kwargs)[source]

Plot the absolute bayes scores rankings.

scarches.plotting.sankey_diagram(data, save_path=None, show=False, **kwargs)[source]

Draws Sankey diagram for the given data. :param data: array with 2 columns. One for predictions and another for true values. :type data: ndarray :param save_path: Path to save the drawn Sankey diagram. if None, the diagram will not be saved. :type save_path: str :param show: if True will show the diagram. :type show: bool :param kwargs: additional arguments for diagram configuration. See _alluvial.plot function.