Skip to content

Tight clusters

Tight clusters labels only the cells whose cluster survives re-clustering and leaves the rest unassigned. Use it on a population with continuous structure, such as progenitors spread along several differentiation paths, where Leiden draws boundaries that move with the resolution and the seed. The tight clusters are the groups you can name with some confidence; their markers are not diluted by the cells between them.

Where to find it

Analyze → Cells → Tight clusters

How it works

Leiden assigns every cell to a cluster. Where the data are a continuum, most of those boundaries fall where nothing separates the cells. Tight clusters measures that directly. It takes its name and its idea from tight clustering (Tseng & Wong 2005), which keeps only the points whose cluster survives resampling, and from the core and intermediate cells of the Allen Institute's cortical taxonomies (Tasic et al. 2016, 2018). Here the resampling is an ensemble of Leiden partitions of the kNN graph the dataset already has:

  1. Cluster the graph several times. Leiden (Traag et al. 2019) runs once per resolution over a range you set, each run with its own seed.
  2. Score each cell's stability. In each partition, a short random walk starts at the cell; the score is the probability that it ends in the cell's own cluster, averaged over the partitions. A cell deep inside a group that every partition keeps whole scores near 1. A cell near a boundary of any partition, or in a region the partitions cut differently, scores lower.
  3. Keep the stable cells and join them. Cells at or above the threshold are kept and connected along graph edges that at least half of the partitions do not cut. Each connected group with enough cells is a tight cluster.

Tight clusters are named C1, C2, … by decreasing size. Everything else is unassigned.

Method details and evidence

The walk is three steps long. On two simulations with known end states the stability score separated end-state from transitional cells with AUC 0.89 and 0.92; at threshold 0.9 the tight clusters were exactly the simulated end states (ARI 1.00 among kept end-state cells), with 45% and 57% of transitional cells left out. kNN density, the usual signal for "dense cores", did not separate them (AUC 0.60 and 0.50). On 9,186 E11.5 hindlimb mesenchyme cells the defaults gave 8 tight clusters holding 16% of the cells; the top 25 markers per tight cluster had a mean log2 fold change of 2.60, against 1.61 for Leiden with 8 clusters over all cells and 1.59 for that Leiden with cells dropped at random to the same coverage. Over five 80% subsamples the tight cluster labels agreed (ARI 0.98 among cells kept both times) while all-cell Leiden at resolution 1 agreed at 0.63. Conditions, the alternatives that were dropped and the limits of this evidence are in docs/measurements/2026-12-02-tight-clusters.md in the repository; backend/benchmarks/tight_clusters/run.py reproduces the numbers.

Run it

  1. Build a graph with Neighbors (PCA, neighbors, UMAP, Leiden). Any graph the dataset holds can be used, including a Combine Neighbors result or a subset's own graph.
  2. Open Analyze → Cells → Tight clusters and click Run. Progress shows each partition as it finishes.
  3. Read the result line. It gives the number of tight clusters and the share of cells assigned, the range of cluster counts across the partitions, and what every other threshold would have given, for example 0.75: 5 (48%), 0.8: 10 (36%), 0.85: 11 (25%), 0.9: 8 (16%).
  4. Color the embedding by the new column, or by <column>_stability to see the score itself.
  5. Adjust and run again if needed. The per-threshold line is there so the second run can be chosen from the first.

To compare the tight clusters, select the column in Compare Cells or run Find Marker Genes on it and leave unassigned out of the groups (Differential expression and markers).

With a cell mask active, the run asks for a subset name and writes tight_<name>, using that subset's own graph when it has one (Named subsets and the subset tree). For a sub-population this is usually what you want: recompute HVGs, PCA and Neighbors on the subset first, so the graph reflects the variation inside it.

Parameters

Parameter Default What it does
kNN graph the dataset default graph The cell-cell graph to cluster
Resolution from 0.5 Lowest Leiden resolution in the ensemble
Resolution to 1.0 Highest. This is the granularity dial: a higher value gives more, smaller tight clusters. Too high and Leiden splits homogeneous groups at random, so nothing is stable.
Stability threshold 0.9 A cell is kept at or above this score. Lower keeps more cells.
Min cells per tight cluster 30 Smaller connected groups are dropped and their cells left unassigned
Partitions 10 Leiden runs, evenly spaced over the resolution range
Column name tight Name of the label column; the score goes to <name>_stability

The defaults were set on the simulations and the limb dataset above. 1.0 is scanpy's default Leiden resolution; a range of 0.5 to 1.5 left two clean 250-cell test groups with no tight cluster at all, because the higher resolutions split each group differently every time.

What it writes

Where What
obs['tight'] C1, C2, … by decreasing size, and unassigned (categorical)
obs['tight_stability'] The stability score, 0 to 1; NaN for cells with no graph edge or outside the run
uns['tight_colors'] Colors for the tight clusters, gray for unassigned
uns['skopia_tight_clusters']['tight'] The run as a JSON string: parameters, graph, the per-cluster table (size, mean stability, the tight cluster it is most often grouped with and how often), the per-threshold table, the resolutions and each partition's cluster count

A run on a named subset writes tight_<name> and tight_<name>_stability, with unassigned and NaN outside the subset, and is recorded in the subset tree.

Tips and pitfalls

Differential expression between tight clusters is optimistic

The cells were kept because they separate. Fold changes and p-values between tight clusters are therefore inflated by the selection, on top of the usual problem of testing clusters on the data that defined them. Treat a tight cluster signature as a hypothesis and confirm it on cells that were not used to call the tight clusters, or on another dataset.

Few or no tight clusters

When fewer than 5% of cells are assigned, the result says so. Lower Resolution to first (the partitions may be splitting real groups at random), then the threshold. If the per-threshold line shows one tight cluster holding most cells until the threshold is high, the population has no separated groups at this graph's resolution, and that is a finding.

  • Stability is separation on the graph, not density. A thin, well separated string of cells can be a tight cluster. Check a tight cluster's size and where it sits before interpreting it.
  • The answer depends on the resolution range. Report the range with the result.
  • Unassigned does not mean low quality. In a continuum most cells are between states; 16% assigned on the limb mesenchyme is the expected order of magnitude at the default threshold.
  • Which cells are kept varies more than which tight cluster they join. On the limb data about a third of the kept set changed between the full data and an 80% subsample, while the labels of cells kept both times agreed.
  • The graph matters most. Tight clusters of a sub-population computed on the whole dataset's graph mostly reflect the differences between populations. Subset first.