You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**scplotkit** is a publication-ready plotting toolkit for single-cell atlas
9
-
analysis, built on top of [scanpy](https://scanpy.readthedocs.io) and
10
-
[AnnData](https://anndata.readthedocs.io). It focuses on the figures that
11
-
don't ship out of the box with scanpy: masked/highlighted embeddings,
12
-
multi-view compositional bar plots and heatmaps, dataset overview panels, and
13
-
Sankey diagrams over annotation hierarchies — all styled consistently and
14
-
saved to disk with one call.
15
-
16
-
-**scanpy-native** — works directly on `AnnData` objects, no intermediate data wrangling.
17
-
-**Consistent styling** — a single `PlotConfig` controls fonts, DPI, and color palettes across every plot.
18
-
-**No hidden assumptions** — column names, palettes, and grouping variables are always explicit arguments; sensible colors are auto-generated when you don't supply a palette.
19
-
-**Two APIs** — a functional, scanpy-style API (`scplotkit.composition.stacked_barplots(...)`) and a stateful convenience class (`scplotkit.ScPlotter`) for when you're producing many figures against the same config/output directory.
8
+
This is just a pile of plotting functions I kept rewriting from scratch for
9
+
every single-cell project, finally bundled up so I stop copy-pasting them
10
+
between notebooks. Built on top of [scanpy](https://scanpy.readthedocs.io) and
composition bar plots and heatmaps, pseudobulk boxplots, marker gene panels,
13
+
Sankeys/sunbursts/treemaps over annotation hierarchies, that kind of thing.
14
+
Nothing statistical happening here, no new analysis — it's purely "make the
15
+
plot I already know I want, and make it look the same every time."
16
+
17
+
Not trying to be *the* single-cell plotting library, it's just what's in my
18
+
toolbox. If you've got a plot you always reach for that isn't in here, please
19
+
open a PR — genuinely happy to have other people's favorite ways of looking at
20
+
single-cell (and maybe eventually spatial) data in here too. See
21
+
[Contributing](#contributing) below.
22
+
23
+
-**scanpy-native** — works directly on `AnnData` objects, no wrangling in between.
24
+
-**One config, every plot** — a single `PlotConfig` controls fonts, DPI, and color palettes, so figures don't end up looking like they came from six different notebooks.
25
+
-**Explicit over magic** — column names, palettes, and grouping variables are always arguments you pass in; if you don't give a palette, a colorblind-friendly one gets generated for you.
26
+
-**Two ways to call it** — plain functions (`scplotkit.composition.stacked_barplots(...)`) if you like the scanpy-style API, or `scplotkit.ScPlotter` if you're making a bunch of figures and don't want to pass `config`/`output_dir` every single time.
|`scplotkit.overview`| Samples/cells-per-category bar plots (incl. broken-axis), cells-per-patient boxplot, cell abundance bar plots, dataset-vs-dataset comparison (bars and paired boxplots) |
85
-
|`scplotkit.markers`|Rank-genes-groups dot/matrix plots, custom marker-set matrix and stacked-violin plots, gene-panel expression heatmap with optional z-scoring and dendrograms|
86
-
|`scplotkit.pseudobulk`| Per-sample pseudobulk boxplot for one gene, min-max-scaled multi-gene boxplot|
87
-
|`scplotkit.ridgeline`| Ridgeline (joy) plots of a continuous value across groups, with optional per-condition overlay |
88
-
|`scplotkit.enrichment`| Dot plot overview of over-representation analysis (ORA) results, e.g. from Enrichr/gseapy |
89
-
|`scplotkit.sankey`|Sankey diagrams across 1-3 nested annotation levels |
89
+
|`scplotkit.embeddings`| Masked UMAP, masked-and-highlighted UMAP overlay, gene expression on an embedding, two-gene co-expression color blend, per-group embedding density|
90
+
|`scplotkit.composition`| Stacked composition bar plots (plain / clustered / clustered-within-group), a multi-metadata variant with color strips, a clustered composition heatmap, a cell-count bubble grid|
91
+
|`scplotkit.overview`| Samples/cells-per-category bar plots (incl. broken-axis), cells-per-patient boxplot, cell abundance bar plots, dataset-vs-dataset comparisons (bars and paired boxplots) |
92
+
|`scplotkit.markers`|`rank_genes_groups` dot/matrix plots, plus matrix and stacked-violin plots for your own marker gene sets|
93
+
|`scplotkit.pseudobulk`| Per-sample pseudobulk boxplot for one gene, or several at once (optionally min-max scaled)|
94
+
|`scplotkit.ridgeline`| Ridgeline (joy) plots of a continuous value across groups, with an optional per-condition overlay |
95
+
|`scplotkit.enrichment`| Dot plot for over-representation analysis (ORA) results, e.g. from Enrichr/gseapy |
96
+
|`scplotkit.sankey`|Sankeys, sunbursts, and treemaps over 1-3 nested annotation levels |
90
97
91
98
## Configuration
92
99
@@ -112,16 +119,23 @@ value up front.
112
119
113
120
## Documentation & tutorial
114
121
115
-
Full API reference and a runnable tutorial (built on scanpy's public pbmc3k
116
-
dataset) are in [`docs/`](docs/) and published at
117
-
https://scplotkit.readthedocs.io. To build the docs locally:
122
+
Full API reference and a runnable tutorial (on a real published atlas) live
123
+
in [`docs/`](docs/) and are published athttps://scplotkit.readthedocs.io. To
124
+
build the docs locally:
118
125
119
126
```bash
120
127
pip install -e ".[docs]"
121
128
sphinx-build -b html docs docs/_build/html
122
129
```
123
130
124
-
## Development
131
+
## Contributing
132
+
133
+
Got a plot you always end up making for single-cell (or spatial) data? Open a
134
+
PR. No formal process here — just try to match the existing style (one
135
+
function per plot, `config`/`output_dir` as the last two args, save via
136
+
`save_figure` so it lands in the same place as everything else) and add it to
137
+
`__all__` and the table above. Bug reports and "this default looks bad"
0 commit comments