Plotting#
Publication plots under cf.pl. Tissue coordinates use embedding(..., basis="spatial");
there is no separate spatial plotting module.
Marsilea-based dotplot / grid_dotplot need pip install cellfish[plot].
Style and fonts#
|
Load fonts if present and set publication rcParams (PDF fonttype 42). |
|
Save |
|
Return |
|
Validate and load custom fonts from |
|
Write current matplotlib rcParams that differ from defaults. |
Palettes#
Project-specific colors stay in the analysis repo. Pass them with palette= or group_color_dict=.
|
Get a predefined color palette by name. |
|
Create a color mapping for a list of cell types. |
|
Return |
|
Reorder a group column in adata.obs and set its corresponding palette. |
|
Intelligently visualizes a color input. |
|
Display a palette with optional labels. |
List all available predefined palettes dynamically. |
Embedding#
|
Scatter plot for user specified embedding basis (e.g. umap, pca, etc). |
|
A derived version of |
|
Plot UMAP embedding. |
|
Plot t-SNE embedding. |
|
Plot PCA embedding. |
|
Plot MDE embedding. |
|
Plot embedding with celltype color by omicverse. |
|
Get locations of cluster median and adjust text labels accordingly. |
|
|
|
Plot the ConvexHull for a cluster in embedding. |
|
Add arrow and label to the axis :type ax: matplotlib.axes.Axes :param ax: The axis to add the arrow and label to. |
Composition#
|
Return percent composition (0–100) with samples as index and clusters as columns. |
|
Stacked bar chart of |
|
Plot cell proportion of each cell type in each visual cluster. |
|
Plot the cell type percentage in each groupby category |
|
Temporal / grouped composition plot with smooth alluvial ribbons. |
Categorical / statistical plots#
|
|
|
adata (AnnData object): The data object containing the information for plotting. |
|
Grouped boxplot visualization. |
|
|
|
|
|
|
|
Ridge / overlapping KDE of |
Contours and obs scatter#
|
Add density contour to plot. |
|
Add density contour to plot. |
|
Scatter plot from AnnData.obs with optional cluster highlighting. |
|
Scatter plot from AnnData.obs with optional cluster highlighting. |
plot1cell#
|
Circular UMAP with metadata tracks. |
|
Draw an atlas-style plot1cell figure with original plot1cell-like inner metadata rings. |
|
Generate a simulated atlas-like AnnData object for testing the plotting function. |
Dotplots (marsilea)#
These attributes are loaded lazily. Install cellfish[plot] first.
|
Make a dot plot of the expression values of |
|
Grouped dotplot with Marsilea, supporting 2D category splits and colored labels. |
|
Draw colored dots with text labels beside them (Marsilea RenderPlan). |
|
Create a dot plot from rank_genes_groups results. |