Metadata-Version: 2.1
Name: mrvi
Version: 0.1.1
Summary: Multi-resolution analysis of single-cell data.
Home-page: https://github.com/YosefLab/mrvi
License: BSD-3-Clause
Author: Pierre Boyeau
Author-email: pierreboyeau@berkeley.edu
Requires-Python: >=3.7.2,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Provides-Extra: dev
Provides-Extra: docs
Requires-Dist: anndata (>=0.7.5)
Requires-Dist: black (>=20.8b1); extra == "dev"
Requires-Dist: codecov (>=2.0.8); extra == "dev"
Requires-Dist: flake8 (>=3.7.7); extra == "dev"
Requires-Dist: importlib-metadata (>=1.0,<2.0); python_version < "3.8"
Requires-Dist: ipython (>=7.1.1); extra == "docs"
Requires-Dist: isort (>=5.7); extra == "dev"
Requires-Dist: jupyter (>=1.0); extra == "dev"
Requires-Dist: leidenalg
Requires-Dist: loompy (>=3.0.6); extra == "dev"
Requires-Dist: nbconvert (>=5.4.0); extra == "dev"
Requires-Dist: nbformat (>=4.4.0); extra == "dev"
Requires-Dist: nbsphinx-link; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: pre-commit (>=2.7.1); extra == "dev"
Requires-Dist: pydata-sphinx-theme (>=0.4.0); extra == "docs"
Requires-Dist: pytest (>=4.4); extra == "dev"
Requires-Dist: python-igraph
Requires-Dist: scanpy (>=1.6); extra == "dev"
Requires-Dist: scanpydoc (>=0.5); extra == "docs"
Requires-Dist: scikit-misc (>=0.1.3)
Requires-Dist: scvi-tools (>=0.17.0)
Requires-Dist: sphinx (>=4.1,<4.4); extra == "docs"
Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Requires-Dist: typing_extensions; (python_version < "3.8") and (extra == "docs")
Project-URL: Documentation, https://scvi-tools.org
Description-Content-Type: text/markdown

# Multi-resolution Variational Inference

Multi-resolution Variational Inference (MrVI) is a package for analysis of sample-level heterogeneity in multi-site, multi-sample single-cell omics data. Built with [scvi-tools](https://scvi-tools.org).

---

To install, run:

```
pip install mrvi
```

`mrvi.MrVI` follows the same API used in scvi-tools.

```python
import mrvi
import anndata

adata = anndata.read_h5ad("path/to/adata.h5ad")
# Sample (e.g. donors, perturbations, etc.) should go in sample_key
# Sites, plates, and other factors should go in categorical_nuisance_keys
mrvi.MrVI.setup_anndata(adata, sample_key="donor", categorical_nuisance_keys=["site"])
mrvi_model = mrvi.MrVI(adata)
mrvi_model.train()
# Get z representation
adata.obsm["X_mrvi_z"] = mrvi_model.get_latent_representation(give_z=True)
# Get u representation
adata.obsm["X_mrvi_u"] = mrvi_model.get_latent_representation(give_z=False)
# Cells by n_sample by n_latent
cell_sample_representations = mrvi_model.get_local_sample_representation()
# Cells by n_sample by n_sample
cell_sample_sample_distances = mrvi_model.get_local_sample_representation(return_distances=True)
```

## Citation

```
@article {Boyeau2022.10.04.510898,
	author = {Boyeau, Pierre and Hong, Justin and Gayoso, Adam and Jordan, Michael and Azizi, Elham and Yosef, Nir},
	title = {Deep generative modeling for quantifying sample-level heterogeneity in single-cell omics},
	elocation-id = {2022.10.04.510898},
	year = {2022},
	doi = {10.1101/2022.10.04.510898},
	publisher = {Cold Spring Harbor Laboratory},
	abstract = {Contemporary single-cell omics technologies have enabled complex experimental designs incorporating hundreds of samples accompanied by detailed information on sample-level conditions. Current approaches for analyzing condition-level heterogeneity in these experiments often rely on a simplification of the data such as an aggregation at the cell-type or cell-state-neighborhood level. Here we present MrVI, a deep generative model that provides sample-sample comparisons at a single-cell resolution, permitting the discovery of subtle sample-specific effects across cell populations. Additionally, the output of MrVI can be used to quantify the association between sample-level metadata and cell state variation. We benchmarked MrVI against conventional meta-analysis procedures on two synthetic datasets and one real dataset with a well-controlled experimental structure. This work introduces a novel approach to understanding sample-level heterogeneity while leveraging the full resolution of single-cell sequencing data.Competing Interest StatementN.Y. is an advisor and/or has equity in Cellarity, Celsius Therapeutics, and Rheos Medicine.},
	URL = {https://www.biorxiv.org/content/early/2022/10/06/2022.10.04.510898},
	eprint = {https://www.biorxiv.org/content/early/2022/10/06/2022.10.04.510898.full.pdf},
	journal = {bioRxiv}
}
```

