Factor Disentanglement Variational Inference for single-cell batch integration
Project description
FADVI: Factor Disentanglement Variational Inference
FADVI is a deep learning method for single-cell RNA sequencing analysis that disentangles batch-related variation, label-related variation, and residual variation using adversarial training and cross-correlation penalties.
Features
- Factor Disentanglement: Separates batch effects, cell type effects, and residual variation in single-cell data
- Integration with scvi-tools: Built on top of the scvi-tools framework for scalable analysis
- Batch Correction: Removes unwanted batch effects while preserving biological signal
- Cell Type Classification: Performs supervised learning for cell type prediction
Installation
Install from source (development)
# Clone the repository
git clone https://github.com/liuwd15/fadvi.git
cd fadvi
# Install in development mode
pip install -e .
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 spaces:
- z_b: Batch-related latent factors
- z_l: Label-related latent factors
- z_r: Residual latent factors
The model uses adversarial training to ensure proper disentanglement between these factor spaces.
Citation
If you use FADVI in your research, please cite:
@article{fadvi2025,
title={FADVI: disentangled representation learning for robust integration of single-cell and spatial omics data},
author={Wendao Liu},
journal={bioRxiv},
year={2025}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fadvi-0.1.0.tar.gz.
File metadata
- Download URL: fadvi-0.1.0.tar.gz
- Upload date:
- Size: 4.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ba5219dd47d3f461b155c8f85b372b244eb6ebe1f80c0c6c3b0ee47e840b644
|
|
| MD5 |
74d77ff25a48e77f8548e0f36aa51cce
|
|
| BLAKE2b-256 |
e2b997e272a27a6659cc08db328fa329a6366574554c65c5aba9aa015d88b305
|
File details
Details for the file fadvi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fadvi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cdd8bd2bc1dee857f876f2087fc1dc45040c9b7244744c70b7454ec63ea4176
|
|
| MD5 |
a66724efa772660487d95260f944d771
|
|
| BLAKE2b-256 |
aa17243752f07fbd03846876db58348da056ce766bdf2de0f5c2cfe1e8bc9429
|