Beeswarm Plot
How marker genes are expressed across cell types or niches, one swarm of cells per group.
In PointillViz: Tools → Store → Install, or Install from file with the download. How to install and run a tool
This runs as you: a tool is arbitrary code, with your privileges. Safety note

Readme
Which genes set each cell type or niche apart, and how is their expression spread across its cells?
The plot has one row per group of an annotation, such as cell types or niches, and one column per gene. Each glyph is the swarm of the group’s cells along the gene’s expression, log1p(CP10K), drawn as a smooth outline.
Plot. Within a glyph, expression increases from left to right, from the threshold to the 99.5th percentile of the cells above it, on a separate scale for each gene. The glyph’s height at each level follows how many of the group’s cells have that expression. Its size follows the square root of the share of the group’s cells above the threshold, as in the Marker Dot Plot, so a gene that few cells of a group detect draws a small glyph. Its color shows the group’s mean expression as a z-score across the groups, from −2.5 to 2.5:
Here, is the mean expression of gene over all cells of group , and the mean and standard deviation (sd) are taken across the groups. Cells at or below the threshold are left out of the glyphs, but the colors always count every cell, so the threshold changes what is drawn, never what a color means. A second, coarse annotation adds an outer color strip and orders the rows: each group is placed with the coarse group that most of its cells belong to.
Table. Each row represents one group and one gene. Cells gives the group’s size, Mean log1p(CP10K) its mean expression, z-score the value that sets the color, and % above the share of its cells above the threshold.
Parameters
| Parameter | Default | What it does |
|---|---|---|
Groups field |
optionala categorical column | Selects the annotation whose groups form the rows: cell types, niches or any other categorical column. Defaults to the dataset’s cell-type column. |
Genes genes |
optionalgenes | Selects the genes that form the columns. Opens on the 20 genes detected in the most cells, the Marker Dot Plot’s Top markers. Search to add genes, or remove them; left empty, the plot uses those 20. |
Coarse groups coarse |
optionala categorical column | Adds a second, broader annotation as an outer colour strip and orders the rows by it; each group takes the coarse group most of its cells belong to. The same column as Groups draws no outer strip. |
Expression threshold threshold |
Default: 0Range 0 to 5. | Leaves cells at or below this log1p(CP10K) out of the swarms; 0 keeps every cell that detects the gene. The colours always count every cell of a group. |
Colormap cmap |
Default: Magma | Colours the mean expression z-score with the colormaps the viewer offers for gene expression. Or: Viridis, Plasma, Inferno, Cividis |
Outputs
imagesReturns figurestableReturns a tablesummaryWrites a summaryfilesReturns files to download
More tools
-

Expression Hotspots (Getis-Ord Gi*)
Where one gene forms clusters of high or low expression.
-

Ridge Map
How a gene, or the density of cells, rises and falls across a section, drawn as a relief of ridges.
-

Vector Field
Which way a quantity increases across the tissue, as arrows over the section. Gene, cell type or any annotation column — with every arrow that could be noise removed.
-

BANKSY niches
Which niches the tissue divides into, judged by what each cell and its neighbours express.