Skip to main content

vima

Variational inference-based microniche analysis is a method for conducting case-control analysis on multi-sample spatial molecular datasets. vima can be applied to any spatially resolved molecular technology, is well powered even at the modest sample sizes typical of research cohorts, and avoids traditional, parameter-intensive preprocessing steps such as cell segmentation or clustering of cells into discrete cell types. It works by treating each spatial sample as an image and using a variational autoencoder to extract numerical "fingerprints" from small tissue patches that capture their biological content. It uses these fingerprints to define a large number of "microniches" – small, potentially overlapping groups of tissue patches with highly similar biology that span multiple samples. It then uses rigorous permutation testing to identify microniches whose abundance correlates significantly with case-control status after accounting for multiple testing.

installation

vima can be installed via pip as follows:

pip install vima-spatial

Note that vima requires pytorch and harmonypy. These should install automatically through pip, but if you have trouble, try installing them first, verifying that they work, and then installing vima.

demo

To get started with an example analysis on a toy spatial transcriptomics dataset, take a look at our brief demo. You can see a completed read-only version or run an interactive version yourself on a Google Colab GPU (though this requires Colab Pro due to insufficient memory provided on the free tier.)

To see how to apply vima to a stain-based modality like CODEX, immunohistochemistry, or immunofluorescence, look at our immunofluorescence demo.

citation

If you use vima, please cite:

Y. Reshef, et al. Powerful and accurate case-control analysis of spatial molecular data. bioRxiv (In press at Nature Methods). https://doi.org/10.1101/2025.02.07.637149v1.

Metadata

Release files for vima-spatial 0.2.13

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

Source distribution (sdist)

Source distribution for vima-spatial 0.2.13
File Size Uploaded Provenance Actions
vima_spatial-0.2.13.tar.gz 75.7 kB Without provenance Details for vima_spatial-0.2.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vima-spatial 0.2.13
File Interpreter ABI Platform Actions
vima_spatial-0.2.13-py3-none-any.whl Python 3 none any Details for vima_spatial-0.2.13-py3-none-any.whl

Total release size: 154.5 kB

Release files / vima_spatial-0.2.13.tar.gz

Download URL vima_spatial-0.2.13.tar.gz
Size 75.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b5671c6cf744c9ca04efefe73dfef729c49fbd6dbff2d5fbbd4dbc1199f8ce9a
BLAKE2b-256 checksum
How to use checksums
552c1b96870747226efa76505cbe59b8c2c95b305172706ef181fabdabcb6b35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / vima_spatial-0.2.13-py3-none-any.whl

Download URL vima_spatial-0.2.13-py3-none-any.whl
Size 78.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4862fcc79768e9e4aaeccc825a8c874e07e5708d76db88e84019ac8dea1b1c3e
BLAKE2b-256 checksum
How to use checksums
318e8a04faed0419e9f72750265faf8350ab0e7d966cdc395e781cf269594402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for vima-spatial 0.2.13

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.

Release history Release notifications | RSS feed

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