Plotting#

The plotting module ehrapy.pl.\* largely parallels the tl.\* and a few of the pp.\* functions. For most tools and for some preprocessing functions, you will find a plotting function with the same name.

Generic#

plot.scatter

Scatter plot along observations or variables axes.

plot.heatmap

Heatmap of the feature values.

plot.dotplot

Makes a dot plot of the count values of var_names.

plot.tracksplot

Plots a filled line plot.

plot.violin

Violin plot.

plot.stacked_violin

Stacked violin plots.

plot.matrixplot

Creates a heatmap of the mean count per group of each var_names.

plot.clustermap

Hierarchically-clustered heatmap.

plot.ranking

Plot rankings.

plot.dendrogram

Plots a dendrogram of the categories defined in groupby.

plot.catplot

Plot categorical data.

Quality Control and missing values#

plot.missing_values_matrix

A matrix visualization of the nullity of the given AnnData object.

plot.missing_values_barplot

A bar chart visualization of the nullity of the given AnnData object.

plot.missing_values_heatmap

Presents a seaborn heatmap visualization of nullity correlation in the given AnnData object.

plot.missing_values_dendrogram

Fits a scipy hierarchical clustering algorithm and visualizes the results as a scipy dendrogram.

Classes#

Please refer to Scanpy’s plotting classes documentation.

Tools#

Methods that extract and visualize tool-specific annotation in an AnnData object. For any method in module tl, there is a method with the same name in pl.

plot.pca

Scatter plot in PCA coordinates.

plot.pca_loadings

Rank features according to contributions to PCs.

plot.pca_variance_ratio

Plot the variance ratio.

plot.pca_overview

Plot PCA results.

Embeddings#

plot.tsne

Scatter plot in tSNE basis.

plot.umap

Scatter plot in UMAP basis.

plot.diffmap

Scatter plot in Diffusion Map basis.

plot.draw_graph

Scatter plot in graph-drawing basis.

plot.embedding

Scatter plot for user specified embedding basis (e.g. umap, pca, etc).

plot.embedding_density

Plot the density of observations in an embedding (per condition).

Branching trajectories and pseudotime#

plot.dpt_groups_pseudotime

Plot groups and pseudotime.

plot.dpt_timeseries

Heatmap of pseudotime series.

plot.paga

Plot the PAGA graph through thresholding low-connectivity edges.

plot.paga_path

Feature changes along paths in the abstracted graph.

plot.paga_compare

Scatter and PAGA graph side-by-side.

Feature Ranking#

plot.rank_features_groups

Plot ranking of features.

plot.rank_features_groups_violin

Plot ranking of features for all tested comparisons as violin plots.

plot.rank_features_groups_stacked_violin

Plot ranking of genes using stacked_violin plot.

plot.rank_features_groups_heatmap

Plot ranking of genes using heatmap plot (see heatmap()).

plot.rank_features_groups_dotplot

Plot ranking of genes using dotplot plot (see dotplot()).

plot.rank_features_groups_matrixplot

Plot ranking of genes using matrixplot plot (see matrixplot()).

plot.rank_features_groups_tracksplot

Plot ranking of genes using tracksplot plot (see tracksplot()).

plot.rank_features_supervised

Plot features with greatest absolute importances as a barplot.

Survival Analysis#

plot.ols

Plots an Ordinary Least Squares (OLS) Model result, scatter plot, and line plot.

plot.kaplan_meier

Plots a pretty figure of the Fitted KaplanMeierFitter model.

plot.cox_ph_forestplot

Generates a forest plot to visualize the coefficients and confidence intervals of a Cox Proportional Hazards model.

Causal Inference#

plot.causal_effect

Plot the causal effect estimate.