Skip to main content

Calibrated Variational Inference for single-cell omics.

Project description

VIVS

PyPI version Tests passing

VIVS (Variational Inference for Variable Selection) is a Python package to identify molecular dependencies in omics data. Please refer to the preprint and to the project repository here for more details.

Installation

Currently, VIVS is only available on GitHub. To install the package, on Python >= 3.9, you can do the following:

  1. install jax with GPU support (see here for instructions)
  2. install the package using pip:
pip install vivs

Alternatively, you can clone the repository and install the package in editable mode:

pip install -e .

Basic usage

Data format

To use VIVS in your project, import the data of intest in a scanpy AnnData object. Right now, VIVS only supports assays where $X$ corresponds to gene expression counts. In particular, make sure than the anndata contains raw counts and not normalized data.

The response(s) $Y$ of interest are expected to be stored in the obsm attribute of the anndata object, either as an array or as a dataframe.

VIVS may not scale to many thousands of genes. In such a case, it is recommended to filter the genes before running VIVS, which can be done in the following way:

from vivs import select_genes

adata = select_genes(adata, n_top_genes=2000)

Model fitting and inference

VI-VS can be initialized and trained as follows:

from vivs import VIVS

model = VIVS(
    adata,
    feature_obsm_key="my_obsm_key",
    xy_linear=False,
    xy_model_kwargs={"n_hidden": 8}
)
model.train_all()

Once the model is trained, feature significance can be computed as follows:

res = model.get_hier_importance(n_clusters_list=[100, 200])

Here, n_clusters_list is a list of the number of clusters to consider for the hierarchical clustering of the features.

These results can be visualized using plot_hier_importance:

model.plot_hier_importance(res, theme_kwargs=dict(figure_size=(15, 2))

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

vivs-0.1.1.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

vivs-0.1.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file vivs-0.1.1.tar.gz.

File metadata

  • Download URL: vivs-0.1.1.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for vivs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a80e7a8c413166bdc21994d40912c95c0d118e67fcb810167ee152b9bacf0032
MD5 965399d11e809ff3ee6998df699119ae
BLAKE2b-256 492bd70a57e5c72871d034422dea0650af0067a7800370bde0bf158e86aefdbe

See more details on using hashes here.

File details

Details for the file vivs-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vivs-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for vivs-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a3f545035bf28677641a4c92d677a14d46bafc4c383518e8ef4755691ad7fd5
MD5 05c5c3932568cba0e150fb2a0ef93754
BLAKE2b-256 f121c29ae4dcc92aac593d760639ed82db7cf5a887edcf2d3bf53a2f7ea85721

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