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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vima_spatial-0.2.7.tar.gz (63.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vima_spatial-0.2.7-py3-none-any.whl (72.6 kB view details)

Uploaded Python 3

File details

Details for the file vima_spatial-0.2.7.tar.gz.

File metadata

  • Download URL: vima_spatial-0.2.7.tar.gz
  • Upload date:
  • Size: 63.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for vima_spatial-0.2.7.tar.gz
Algorithm Hash digest
SHA256 77713f4cf2482b90307e145d5ab2cd50d80ce15e86eace9f6ce0df51f80cb137
MD5 41262916e6a6d759bd7e5225184db010
BLAKE2b-256 099c16f4b479f06b88d3c04dd16999769c2b245fa00de26c01d5488e6734cfe8

See more details on using hashes here.

File details

Details for the file vima_spatial-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: vima_spatial-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 72.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for vima_spatial-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d4aa66ba22c741aae1a0a2bd0da41b250a33ae603d71b3054a8e3df548c98d08
MD5 597e90c242fbab2abba8b030900510d8
BLAKE2b-256 2eac330b096a8f99f6af8ec60260f889dba6569442025dc7f439d28b34f9d392

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.9

2 files

0.2.8

2 files

This release

0.2.7 This release

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.6

2 files

0.1.5.2

2 files

0.1.5.1

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1.6

2 files

0.1.1.5

2 files

0.1.1.4

2 files

0.1.1.3

2 files

0.1.1.2

2 files

0.1.1.1

2 files

0.1.1

2 files

0.1.0

2 files

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