muvi

A multi-view latent variable model with domain-informed structured sparsity for integrating noisy feature sets.

https://github.com/mlo-lab/muvi

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.4%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

A multi-view latent variable model with domain-informed structured sparsity for integrating noisy feature sets.

Basic Info
  • Host: GitHub
  • Owner: MLO-lab
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 89.9 MB
Statistics
  • Stars: 31
  • Watchers: 3
  • Forks: 2
  • Open Issues: 0
  • Releases: 5
Created over 4 years ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.md

MuVI

A multi-view latent variable model with domain-informed structured sparsity, that integrates noisy domain expertise in terms of feature sets.

Examples | Paper | BibTeX

Build Coverage

Basic usage

The MuVI class is the main entry point for loading the data and performing the inference:

```py import numpy as np import pandas as pd import anndata as ad import mudata as md import muvi

Load processed input data (missing values are allowed)

Matrix of dimensions nsamples x nrna_features

rnadf = pd.readcsv(...)

Matrix of dimensions nsamples x nprot_features

protdf = pd.readcsv(...)

Load prior feature sets, e.g. gene sets

genesets = muvi.fs.fromgmt(...)

Binary matrix of dimensions ngenesets x nrnafeatures

genesetsmask = genesets.tomask(rna_df.columns)

Create a MuVI object by passing both input data and prior information

model = muvi.MuVI( observations={"rna": rnadf, "prot": protdf}, priormasks={"rna": genesets_mask}, ... device=device, )

Alternatively, create a MuVI model from AnnData (single-view)

rnaadata = ad.AnnData(rnadf, dtype=np.float32) rnaadata.varm['genesetsmask'] = genesetsmask.T model = muvi.tl.fromadata( adata, priormaskkey="genesetsmask", ..., device=device )

Alternatively, create a MuVI model from MuData (multi-view)

mdata = md.MuData({"rna": rnaadata, "prot": protadata}) model = muvi.tl.mdata( mdata, priormaskkey="genesetsmask", ..., device=device )

Fit the model for a given number of training epochs

model.fit(batchsize, nepochs, ...)

Continue with the downstream analysis (see below)

```

Submodules

The package consists of three additional submodules for analysing the results post-training:

  • muvi.tl provides tools for downstream analysis, e.g.,
    • compute muvi.tl.variance_explained across all factors and views
    • muvi.tl.test the significance between the prior feature sets and the inferred factors
    • apply clustering on the latent space such as muvi.tl.leiden
    • muvi.tl.save the model in order to muvi.tl.load it at a later point in time
  • muvi.pl works in tandem with muvi.tl by providing visualization methods such as
    • muvi.pl.variance_explained (see above)
    • plotting the latent space via muvi.pl.tsne, muvi.pl.scatter or muvi.pl.stripplot
    • investigating factors in terms of their inferred loadings with muvi.pl.inspect_factor
  • muvi.fs serves the data structure and methods for loading, processing and storing the prior information from feature sets

Tutorials

Check out our basic tutorial to get familiar with MuVI, or jump straight to a single-cell multiome analysis!

R users can readily export a trained MuVI model into R with a single line of code and resume the analysis with the MOFA2 package.

py muvi.ext.save_as_hdf5(model, "muvi.hdf5", save_metadata=True)

See this vignette for more details!

Installation

We suggest using conda to manage your environments, and pip to install muvi as a python package. Follow these steps to get muvi up and running!

  1. Create a python environment in conda:

bash conda create -n muvi python=3.10

  1. Activate freshly created environment:

bash source activate muvi

  1. Install muvi with pip:

bash python3 -m pip install muvi

  1. Alternatively, install the latest version with pip:

bash python3 -m pip install git+https://github.com/MLO-lab/MuVI.git

Make sure to install a GPU version of PyTorch to significantly speed up the inference.

Citation

If you use MuVI in your work, please use this BibTeX entry:

Encoding Domain Knowledge in Multi-view Latent Variable Models: A Bayesian Approach with Structured Sparsity

Arber Qoku and Florian Buettner

International Conference on Artificial Intelligence and Statistics (AISTATS) 2023

https://proceedings.mlr.press/v206/qoku23a.html

Owner

  • Name: MLO Lab
  • Login: MLO-lab
  • Kind: organization

Machine Learning in Oncology

Citation (citation.bib)

@InProceedings{pmlr-v206-qoku23a,
  title = 	 {Encoding Domain Knowledge in Multi-view Latent Variable Models: A Bayesian Approach with Structured Sparsity},
  author =       {Qoku, Arber and Buettner, Florian},
  booktitle = 	 {Proceedings of The 26th International Conference on Artificial Intelligence and Statistics},
  pages = 	 {11545--11562},
  year = 	 {2023},
  editor = 	 {Ruiz, Francisco and Dy, Jennifer and van de Meent, Jan-Willem},
  volume = 	 {206},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {25--27 Apr},
  publisher =    {PMLR},
  pdf = 	 {https://proceedings.mlr.press/v206/qoku23a/qoku23a.pdf},
  url = 	 {https://proceedings.mlr.press/v206/qoku23a.html}
}

GitHub Events

Total
  • Create event: 5
  • Issues event: 2
  • Release event: 1
  • Watch event: 3
  • Delete event: 3
  • Issue comment event: 3
  • Push event: 9
  • Pull request review event: 2
  • Pull request event: 6
  • Fork event: 1
Last Year
  • Create event: 5
  • Issues event: 2
  • Release event: 1
  • Watch event: 3
  • Delete event: 3
  • Issue comment event: 3
  • Push event: 9
  • Pull request review event: 2
  • Pull request event: 6
  • Fork event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 3
  • Average time to close issues: 2 months
  • Average time to close pull requests: about 4 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 1
  • Pull requests: 3
  • Average time to close issues: 2 months
  • Average time to close pull requests: about 4 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
  • jpintar (1)
Pull Request Authors
  • dependabot[bot] (3)
  • arberqoku (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (3) python (3)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 47 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 17
  • Total maintainers: 1
proxy.golang.org: github.com/MLO-lab/MuVI
  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
proxy.golang.org: github.com/mlo-lab/muvi
  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
pypi.org: muvi

MuVI: A multi-view latent variable model with domain-informed structured sparsity for integrating noisy feature sets.

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 47 Last month
Rankings
Dependent packages count: 9.3%
Stargazers count: 14.9%
Forks count: 22.7%
Average: 28.8%
Dependent repos count: 68.2%
Maintainers (1)
Last synced: 6 months ago

Dependencies

poetry.lock pypi
  • 149 dependencies
pyproject.toml pypi
  • black >=22.6.0
  • flake8 >=3.9.2
  • gsea-api ^0.3.4
  • ipython >=7.25
  • isort >=5.9
  • jupyter >=1.0
  • leidenalg ^0.8.9
  • lifelines ^0.27.0
  • muon ^0.1.2
  • numpy >=1.20
  • openpyxl ^3.0.9
  • pandas >=1.0
  • pre-commit ^2.17.0
  • pyro-ppl >=1.8.0
  • pytest ^6.2.5
  • python >=3.8,<3.11
  • scikit-learn ^1.0.2
  • scipy ^1.8.0
  • seaborn >=0.11
  • statsmodels ^0.13.2
  • torch >=1.9.0
  • tqdm >=4.61.1
.github/workflows/build.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v3 composite
  • snok/install-poetry v1 composite