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#
Scatter plot along observations or variables axes. |
|
Heatmap of the feature values. |
|
Makes a dot plot of the count values of var_names. |
|
Plots a filled line plot. |
|
Violin plot. |
|
Stacked violin plots. |
|
Creates a heatmap of the mean count per group of each var_names. |
|
Hierarchically-clustered heatmap. |
|
Plot rankings. |
|
Plots a dendrogram of the categories defined in groupby. |
|
Plot categorical data. |
|
Plot time series from a 3D EHRData object. |
|
Create a Sankey diagram of relationships across the flat observation table. |
|
Create a Sankey diagram showing patient state transitions over time. |
|
Plot the stratified "Table 1" baseline comparison stored by |
|
Plot variable correlations as heatmap. |
|
Plot correlation dependencies as a chord diagram. |
Quality Control and missing values#
A matrix visualization of the nullity of the given data object. |
|
A bar chart visualization of the nullity of the given data object. |
|
Presents a seaborn heatmap visualization of nullity correlation in the given data object. |
|
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.
Scatter plot in PCA coordinates. |
|
Rank features according to contributions to PCs. |
|
Plot the variance ratio. |
|
Plot PCA results. |
Embeddings#
Scatter plot in tSNE basis. |
|
Scatter plot in UMAP basis. |
|
Scatter plot in Diffusion Map basis. |
|
Scatter plot in graph-drawing basis. |
|
Scatter plot for user specified embedding basis (e.g. umap, pca, etc). |
|
Plot the density of observations in an embedding (per condition). |
Branching trajectories and pseudotime#
Plot groups and pseudotime. |
|
Heatmap of pseudotime series. |
|
Plot the PAGA graph through thresholding low-connectivity edges. |
|
Feature changes along paths in the abstracted graph. |
|
Scatter and PAGA graph side-by-side. |
Feature Ranking#
Plot ranking of features. |
|
Plot ranking of features for all tested comparisons as violin plots. |
|
Plot ranking of genes using stacked_violin plot. |
|
Plot ranking of genes using heatmap plot (see |
|
Plot ranking of genes using dotplot plot (see |
|
Plot ranking of genes using matrixplot plot (see |
|
Plot ranking of genes using tracksplot plot (see |
|
Plot features with greatest absolute importances as a barplot. |
Survival Analysis#
Plots an Ordinary Least Squares (OLS) Model result, scatter plot, and line plot. |
|
Plots a pretty figure of the Fitted KaplanMeierFitter model. |
|
Generates a forest plot to visualize the coefficients and confidence intervals of a Cox Proportional Hazards model. |
|
Survival curve plot to visualize CoxPH-adjusted survival probabilities stratified by a grouping variable. |
Normalized Complexity Profile#
Plot the factors from a Non-negative CP decomposition. |
|
Plot mean variable trajectories per cluster, guided by NCP loadings. |
Causal Inference#
Plot a "love plot" of standardised mean differences before and after weighting. |
|
Plot overlapping propensity score histograms for treated and untreated groups. |
|
Plot a single causal estimate, or a comparison across estimators, as a forest-style plot. |