Skip to main content

tysserand

Fast and accurate spatial networks reconstruction.

tysserand is a Python library to reconstruct spatial networks from spatially resolved omics experiments. It is intended as a common tool where the bioinformatics community can add new methods to reconstruct networks, choose appropriate parameters, clean resulting networks and pipe data to other libraries.
You can find the article and supplementary information on Bioinformatics, and the freely available preprint (same text!) is on BioRxiv.
A tutorial is available here.
📖 Documentation: tysserand.readthedocs.io · 📝 Changelog

tysserand is fast: it is 50 to more than 120 times faster than PySAL.
tysserand is accurate: it implements the best performing methods, tested on simulated and real bioimages. tysserand is user friendly and interactive: it integrates tools to choose appropriate parameters and facilitates the use of napari-based interactive image visualization and network annotation. tysserand is modular and opened to contributions: if you have an idea on how to improve reconstruction methods, create a particular one for a specific case, or make them even faster, join us!

Installation

Simply do

pip install tysserand

If you want the latest features not published on PyPI run

pip install git+https://github.com/VeraPancaldiLab/tysserand.git

Optional dependencies are grouped in extras: napari (interactive visualization and annotation), interop (NetworkX, iGraph and AnnData bridges), notebooks (Jupyter tutorials and publication figures, including PySAL), or all:

pip install "tysserand[all]"

For development, the environment is managed with uv:

git clone https://github.com/VeraPancaldiLab/tysserand.git
cd tysserand
uv sync --extra all   # creates .venv with tysserand installed in editable mode
uv run pytest -q tests
# add the environment to jupyterlab
uv run python -m ipykernel install --user --name=spatial-networks

Implemented methods

Set of nodes

Delaunay triangulation

This method builds virtual cells centered arround each node and contacting each other to fully tile the space occupyied by the nodes. Edges are drawn between the nodes of contacting tiles. The node_adaptive_trimming option can infer a better distance threshold to discard edges for each individual node.

Edge lengths with Delaunay reconstruction
Trimmed network
Network overlay on original tissue image

k-nearest neighbors

Each node is linked with its k nearest neighbors. It is the most common method used in single cell publications, althought it produces artifacts well visible on simple 2D networks.

Edge lengths with k-nearest neighbors reconstruction

radial distance neighbors

Each node is linked to nodes closer than a threshold distance D, that is to say each node is linked to all nodes in a circle of radius D.

Edge lengths with radial distance neighbors reconstruction

Area contact

Nodes are the center of detected objects (like after cell segmentation) and they are linked if their respective areas are in contact or closer than a given distance threshold.
A parallelized version is implemented with joblib.

Contacting areas reconstruction

Area contact and k-nearest neighbors

Areas are linked if they are in contact or closer than a given distance. Then, the remaining non connected areas are connected with their nearest neighbors.

Metadata

Release files for tysserand 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tysserand 1.0.0
File Size Uploaded Provenance Actions
tysserand-1.0.0.tar.gz 48.4 kB Without provenance Details for tysserand-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tysserand 1.0.0
File Interpreter ABI Platform Actions
tysserand-1.0.0-py3-none-any.whl Python 3 none any Details for tysserand-1.0.0-py3-none-any.whl

Total release size: 94.3 kB

Release files / tysserand-1.0.0.tar.gz

Download URL tysserand-1.0.0.tar.gz
Size 48.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2cb8e5a892a9ce12f8a9e1bdb6d9fb99e33c553224c8f138f0389ba40bd5b815
BLAKE2b-256 checksum
How to use checksums
040f47e8961c991fb32bb0cb378f5a35bfe080f68f40ea8d4e0b997b5a262a18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tysserand-1.0.0-py3-none-any.whl

Download URL tysserand-1.0.0-py3-none-any.whl
Size 45.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de8204bab1ed0ed9bc49bc32a6115cd9147a8b5275cc30e828ea38711e4f8ddf
BLAKE2b-256 checksum
How to use checksums
2941b9505a20662124d1d3e2f0932cc59f6854ed351f9e9fdf6d04763118ee6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for tysserand 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page