Skip to main content

variational inference-based microniche analysis

Project description

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 statistics to identify microniches whose abundance correlates with case-control status.

installation

To use vima, you can either install it directly from the Python Package Index by running, e.g.,

pip install vima-spatial

or if you'd like to manipulate the source code you can clone this repository and add it to your PYTHONPATH.

Note that the package requires a working installation of pytorch, and it may be beneficial to first install pytorch, verify it works properly, and then install vima.

For data preprocessing the current version of the package also requires a working R environment with the harmony package and arrow package installed. You can create such an environment easily with conda by running

conda create -n Renv -c conda-forge r-base r-harmony r-arrow

To use vima you'll need the path to the Rscript executable in this R environment, which you can get by running which Rscript with the R environment active.

demo

Take a look at our demo to see how to get started with an example analysis. We plan to put up demos for other data modalities in the future.

citation

If you use vima, please cite:

Y. Reshef, et al. Powerful and accurate case-control analysis of spatial molecular data. bioRxiv. https://doi.org/10.1101/2025.02.07.637149v1.

Project details


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.1.5.2.tar.gz (28.1 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.1.5.2-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vima_spatial-0.1.5.2.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for vima_spatial-0.1.5.2.tar.gz
Algorithm Hash digest
SHA256 5008b30cbdce7d5d7c95329c93c11257e2ef6738d59d466e0c56303525a2add3
MD5 9c3bc0d6627758fed53f03233480c5db
BLAKE2b-256 29db20849ef7909554ada58c8d7fef4d17b78db6e3bc7fb39c825a007d258001

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vima_spatial-0.1.5.2-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for vima_spatial-0.1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebff8c8ea1f8014a3bf60882ae75e21f037191c45c581ace7c89b58daa24bbf9
MD5 8ad6134665003ad40273e731c8f6ddbb
BLAKE2b-256 8781c666e50041bd2e557574fc464b00a8eb71bdff67f7ee519ff5316db29cc5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page