Skip to content
PointillViz Build & publish a tool
PointillViz

© 2026 PointillViz

All tools

Cell-type contact network

No ratings yet by PointillViz reference tools

Which cell types touch which, from a Delaunay triangulation of the cells, as a network and a matrix corrected for abundance.

Download .pvtool · 35.5 kB

In PointillViz: Tools → Store → Install, or Install from file with the download. How to install and run a tool

  • This tool writes to the filesystem.

This runs as you: a tool is arbitrary code, with your privileges. Safety note

A network of coloured nodes, each inside a ring, joined by pairs of curved arrows from blue to red. An illustration, not a real tissue.
Download

Readme

Which cell types touch which, and which of those contacts are more common, or rarer, than the types’ abundance predicts?

The tool runs a Delaunay triangulation on each section’s cells, in 2D or 3D, and counts every edge as one contact between two neighbouring cells. Tallying each cell’s neighbours by type gives a count matrix C, whose rows are then normalised:

Wij is the fraction of type i‘s contacts that are with type j. It is not symmetric, because i → j and j → i are divided by different totals. The enrichment corrects for abundance, where pj is the fraction of all cells that are type j:

E > 0 means i touches j more than j‘s abundance predicts, and E < 0 less. With several sections, W is computed per section and each row is averaged across them, weighted by how many cells of type i each has.

Network. One node per cell type, its area growing with its number of cells. Its place comes from a layout of the whole dataset, so nodes stay put between sections. An arrow i → j appears where Wij reaches the cutoff, with its width growing as √W and its colour showing E, from blue (depleted) to red (enriched). The ring around a node is its self-contact: the further the ring stands from the node, the larger Wii.

Matrix. The same W and E with no cutoff. Colour shows E, the numbers are W in percent, and grey means no contact. Types with similar contacts sit together.

Table and downloads. Every contact between the types shown, the two figures as SVG, and the numbers for all types as CSV.

Delaunay edges are geometric neighbours, not measured contact, and E has no p-value, so read it together with the contact count C in the table. Cells across a gap are joined unless Longest contact is set.

Parameters

ParameterDefaultWhat it does
Cell-type column field optionala categorical column Selects the annotation whose groups are the network’s nodes. Cell types, unless the dataset has none or you choose another column.
Longest contact (microns) max_distance Default: 0Range 0 to 500. Drops contacts longer than this, so that cells across a gap do not count as touching. 0 keeps every contact. In the dataset’s own coordinates when it records no physical size.
Arrow cutoff (%) cutoff Default: 4Range 0.5 to 50. Draws an arrow from one type to another only when at least this share of the first type’s contacts are with the second. The matrix has no cutoff.
Cell types shown max_types Default: 30Range 5 to 60. Shows only this many of the most abundant types, in the network and in the matrix. The others still count in every share, and the download holds them all.

Outputs

  • summaryWrites a summary
  • imagesReturns figures
  • tableReturns a table
  • filesReturns files to download

Tool test summary

8 of 9 gates passed when this version was released. They ran in this order:

  1. bundlepass

    6 files, 35.5 kB packed and 126.7 kB unpacked, plugin.json at the root.

  2. manifestpass

    celltype-contact-network 1.0.1 by PointillViz reference tools; Python entry tool.py, outputs summary, images, table, files.

  3. environmentpass

    pixi.lock matches pixi.toml, which declares python, numpy, scipy for linux-64, osx-64, osx-arm64, win-64; environments: default.

  4. entrypass

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

  5. imports advisoryflagged

    this tool uses filesystem_write — os.makedirs() at tool.py:473; numpy.savez() at tool.py:474; os.replace() at tool.py:475 (+1 more). None of it is blocked: a tool is arbitrary code run with the privileges of whoever started PointillViz, so this is disclosure for a human to weigh, not a sandbox.

  6. fixturepass

    ran on the 600-cell fixture in 0.30 s, returning summary, table, files, images.

  7. resultpass

    returned the declared outputs: summary, table, files, images.

  8. edgepass

    ran at the minimum corner (cutoff=0.5, max_types=5) in 0.22 s; ran at the maximum corner (cutoff=50.0, max_distance=500.0, max_types=60) in 0.22 s.

  9. no_mutationpass

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

Passing the gates is a statement about the gates, not about whether the code is safe to run.

What each gate checks