Skip to main content

Factor Disentanglement Variational Inference for single-cell batch integration with interpretability analysis

Project description

FADVI Logo

FADVI: Factor Disentanglement Variational Inference

Documentation Status PyPI version

FADVI is a deep learning method for single-cell omics and spatial transcriptomics analysis that disentangles batch-related variation, label-related variation, and residual variation using adversarial training and cross-correlation penalties.

Read the documentation for usage and demo.

Features

  • Factor Disentanglement: Separates batch effects, cell type effects, and residual variation in single-cell and spatial data
  • Integration with scvi-tools: Built on top of the scvi-tools framework for scalable analysis
  • Batch Correction: Removes unwanted batch effects (including diverse spatial transcriptomics technologies) while preserving biological signal
  • Cell Type Classification: Performs supervised learning for cell type prediction
  • Outstanding integration performance: FADVI consistently outperforms state-of-the-art integration methods in benchmarking

Installation

Install from PyPI

pip install fadvi

Quick Start

import scanpy as sc
import scvi
from fadvi import FADVI

# Load your single-cell data
adata = sc.read_h5ad("your_data.h5ad")

# Setup the model
FADVI.setup_anndata(
    adata,
    batch_key="batch",
    labels_key="cell_type",
    unlabeled_category="Unknown",
    layer="counts"
)

# Create and train the model
model = FADVI(adata)
model.train(max_epochs=30)

# Get latent representations
latent_l = model.get_latent_representation(representation="label")
latent_b = model.get_latent_representation(representation="batch")

# Get label predictions
prediction_label = model.predict(prediction_mode="label")

Model Architecture

FADVI uses a variational autoencoder architecture with three latent subspaces:

  • z_b: Batch-related latent factors
  • z_l: Label-related latent factors
  • z_r: Residual latent factors

The model uses adversarial training and cross-covariance penalty to ensure proper disentanglement between these factor subspaces.

Citation

If you use FADVI in your research, please cite our preprint

@article{fadvi2025,
  title={FADVI: disentangled representation learning for robust integration of single-cell and spatial omics data},
  author={Wendao Liu, Gang Qu, Lukas M. Simon, Fabian J. Theis, Zhongming Zhao},
  journal={bioRxiv},
  year={2025}
}

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

fadvi-0.2.0.tar.gz (5.5 MB view details)

Uploaded Source

Built Distribution

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

fadvi-0.2.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file fadvi-0.2.0.tar.gz.

File metadata

  • Download URL: fadvi-0.2.0.tar.gz
  • Upload date:
  • Size: 5.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for fadvi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b3abaef7b91929971d43550a63697770c0c14cbf67d7674e931f1b0eac984fd
MD5 db458edeafd47926fb87cfb457b03eca
BLAKE2b-256 123d0119f8efb8440a4d055c2337b1eed7961fbe943259e59a0d9e6a387f6fb3

See more details on using hashes here.

File details

Details for the file fadvi-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fadvi-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for fadvi-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9fd0bf1cf6f1093579e5d8dc46383f4b91707940f932d4729753f11429dd6c8
MD5 a9eb1d383ff698828fbbd4260002da8d
BLAKE2b-256 29db2c24db1b06d016b73017a2380517da795ccc301b59b606ad520eadc3eb62

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