Skip to content
PointillViz
PointillViz

© 2026 PointillViz

Cell-Type Co-occurrence

by PointillViz reference tools

Which cell types are found near each other more often than expected by chance.

Verifiedv1.2.0
  • cell types
  • enrichment
  • matrix
  • table
  • summary
Cell-type co-occurrence matrix: a hot self-association diagonal, warm lymphoid and myeloid blocks, and blue avoidance between immune cells and stroma
Cell-type co-occurrence matrix: a hot self-association diagonal, warm lymphoid and myeloid blocks, and blue avoidance between immune cells and stromaArtwork from the tool’s bundle

Readme

Answers the question: Which cell types are found near each other more often than expected by chance?

Both axes list all groups in the selected annotation, so each square represents one group pair. Its color shows the co-occurrence score within the selected radius: orange to light yellow indicates more neighboring pairs than expected under random mixing, while blue indicates fewer pairs than expected. The matrix is symmetrical, and its diagonal shows whether cells from the same group cluster together.

More specifically, the score is the log2-transformed ratio between the observed and expected numbers of neighboring cell pairs:

The observed value is the number of pairs from groups i and j found within the selected radius. The expected value represents random mixing and is calculated as:

Here, Npairs is the total number of neighboring pairs, while pi and pj are the overall proportions of the two groups. Thus, a score of 0 means that there are as many observed pairs as expected, while scores of +1 and +2 indicate approximately 2× and 4× the expected number, respectively.

Sweeping the radius

The radius can be swept: the tool’s panel offers Sweep from … to … in … steps under the Radius control. Run sweep runs the tool once per radius, all in one process, and a slider then moves between the results — the matrix and the table at each radius, every one the tool’s own answer at that radius, with nothing re-run while you drag. Seeing every radius, not only the one that looked best, is the point: a pair that is enriched at one radius and not at its neighbours is a pair to distrust.

Parameters

ParameterTypeDefaultWhat it does
Radiusradius sweep float, 5–1,000 60 Sets the maximum distance at which two cells count as neighbours, using the dataset’s own coordinate units. Check the scale bar and start with about two or three cell diameters.
Grouping columnfield categorical_field optional Selects the annotation used to define the groups being compared. Defaults to the cell-type column.

Outputs

  • matrixreturns a heatmap
  • tablereturns a table
  • summarywrites a summary

Tool check

The nine gates this version passed when it was published.

Verified

Passed 9 of 9 gates

  1. bundle pass
  2. manifest pass
  3. entry pass
  4. imports pass, advisory
  5. fixture pass
  6. result pass
  7. determinism pass
  8. edge pass
  9. no_mutation pass
  1. bundle pass

    4 files, 6.0 kB packed and 18.5 kB unpacked, plugin.json at the root.

  2. manifest pass

    celltype-cooccurrence 1.2.0 by PointillViz reference tools; entry tool.py, outputs matrix, table, summary, 180 s and 2048 MB budget.

  3. entry pass

    tool.py imported in 0.20 s and defines run(ds, params).

  4. imports advisory pass

    1 Python file, importing backend, numpy; no network, subprocess, filesystem-write, dynamic-exec or environment use found.

  5. fixture pass

    ran on the 600-cell fixture in 0.29 s of its 180 s budget, returning summary, table, matrix. A 3-step sweep over radius (5.0 to 1000.0) returned every step in 0.30 s.

  6. result pass

    returned the declared outputs: summary, table, matrix.

  7. determinism pass

    two runs with identical parameters produced byte-identical results (2.2 kB of JSON).

  8. edge pass

    ran at the minimum corner (radius=5.0) in 0.28 s; ran at the maximum corner (radius=1000.0) in 0.29 s.

  9. no_mutation pass

    the fixture dataset's 4 files are byte-identical after every run (plugin_cache/, where ds.knn caches, is excluded by design).

Passed every required gate when this version was published. That is a statement about the gates, not about whether the code is safe to run.

Versions

  1. v1.2.0 latest
  2. v1.1.0
  3. v1.0.0

More tools