Skip to main content

PyPI version Python 3.8+ Downloads Github Actions Zenodo Preprint

DECONVersation leverages embedding representations from large-scale, LLM-based foundation models to perform deconvolution of bulk RNA-seq data. This takes advantage of the strengths of scFMs in faithfully representing transcriptomes, learning meaningful biological networks, and minimizing batch effect and noise. Currently, cell embeddings from Geneformer, Cell2Sentence, CellHermes, and scGPT are supported (+PCA and scVI for comparison).

DECONVersation enables end-to-end deconvolution through a set of easy-to-use functions. Embeddings can be extracted from both bulk and single-cell datasets, with single-cell embeddings used to construct robust signature matrices from .h5ad references. Cell type proportions are then estimated via NNLS directly in embedding space. Built-in benchmarking tools evaluate predictions against ground truth using RMSE and Pearson correlation, complemented by visualization utilities for assessing method performance. DECONVersation also supports testing and validation with in-built pseudobulk functions, model fine-tuning and attention extraction.

Please see manuscript for more details.


Benchmarking

DECONVersation was benchmarked across 6 real bulk RNA-seq datasets with ground truths and 2 pseudobulk datasets, spanning diverse tissue types and experimental conditions, to evaluate deconvolution performance and generalizability.

Summary
Across 6 benchmarked real bulk and 2 pseudobulk datasets, we calculate overall RMSE and correlation coefficient alongside mean RMSE and correlation averaged across cell types. Fine-tuned Cell2Sentence (C2S) and Geneformer-based embeddings both demonstrate consistent deconvolution performance across all datasets, with fine-tuned models outperforming their zero-shot counterparts in each case. Though zero-shot performance is already comparable to some common tools in the field, this highlights the benefit of fine-tuning (training models to predict cell type annotations from a single-cell reference). Among the tested tools, only DWLS R package achieves comparable performance to the fine-tuned embedding-based approaches available in DECONVersation.

# Dataset Source Ground Truth Cell Type #
1 PBMC (Hoek) PBMC FACS 5
2 PBMC (Finotello) PBMC FACS 5
3 PBMC (Morandini) PBMC FACS 5
4 Cell Line Mixture (Cobos) Cell Line Mixture Mixture Count 6
5 Pre-Frontal Cortex (Huuki-Myers) DLPFC RNAScope/IF 6
6 Retina (Guo) Retina snRNA 6
7 HECA (Marečková) Endometrium pseudobulk 9
8 Lung tumor (Guimarães) Lung pseudobulk 10

Installation

While DECONVersation itself is lightweight and easy to install with pip install DECONVersation, the various single cell foundation models themselves are not. In fact, due to dependency restrictions, they will never be compatible in the same Python environment. DECONVersation works around this by detecting and only loading the available model(s). For each scFM model and package, users should consult the corresponding official installation guides.

We also provide conda env yaml files in the envs directory that are reproducibly operational on our hardware (NVIDIA L40S), each corresponding to one of the scFMs + DECONVersation. They can be installed with e.g. conda env create -f deconv_gf.yml. Apptainer def files are also included. Alternatively, we provide prebuilt CUDA 12.9 singularity images for each scFM, with DECONVersation v0.1.0 installed, on Zenodo.

DECONVersation also supports Apple Silicon (MPS) acceleration, to speed up Geneformer, C2S, and CellHermes embedding extraction on corresponding machines (2x or more faster than CPU alone on M2 16GB), provided that torch and other dependencies are installed as native arm64 builds.


Supported scFMs

# Model Source Paper/Preprint
1 Geneformer HuggingFace Transfer learning enables predictions in network biology
2 Cell2Sentence 410M HuggingFace Cell2Sentence: Teaching Large Language Models the Language of Biology
3 Cell2Sentence 2B HuggingFace Cell2Sentence: Teaching Large Language Models the Language of Biology
4 scGPT GitHub scGPT: toward building a foundation model for single-cell multi-omics using generative AI
5 CellHermes GitHub Language may be all omics needs: Harmonizing multimodal data for omics understanding with CellHermes

Quick start

# python
import deconversation
res = deconversation.deconverse(
    bulk_df = "bulk_rna.csv",
    sig_df = "signature_matrix.csv", # or adata = "reference.h5ad", needs one or the other
    model = "path_to/Geneformer-V2-316M",
    temp_output_dir = "temp"
)

# command line
deconverse --help
deconverse --demo --model path_to_model
deconverse --bulk bulk_rna.csv --sig signature_matrix.csv --model path_to_model -o deconv_results.csv
deconverse --bulk bulk_rna.csv --adata reference.h5ad --cell_type_col celltype --model path_to_model

# with SIF mounting
singularity exec --nv \
  --bind path_to_input_dir:/data:ro \
  --bind path_to_output_dir:/results \
  --bind path_to_model:/model:ro \
  deconversation-geneformer.sif \
  deconverse \
    --bulk /data/bulk_rna.csv \
    --sig /data/signature_matrix.csv \
    --mode geneformer \
    --model /model \
    --temp-output-dir /results/temp \
    --output /results/proportions.csv

Tutorials


Suggested Reading

  • Geneformer Transfer learning enables predictions in network biology
  • Cell2Sentence Cell2Sentence: Teaching Large Language Models the Language of Biology
  • CellHermes Language may be all omics needs: Harmonizing multimodal data for omics understanding with CellHermes
  • scGPT scGPT: toward building a foundation model for single-cell multi-omics using generative AI

Citation

DECONVersation: Single Cell Foundation Model-Derived Embeddings for Robust Cell Type Deconvolution of Bulk RNA-seq
Ali Oku, Heather Geiger, Nicolas Robine, Rui Fu
bioRxiv 2026.10.02.756356; doi: https://doi.org/10.64898/2026.10.02.756356

Robot icons created by Hilmy Abiyyu A. - Flaticon

Metadata

Release files for DECONVersation 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DECONVersation 0.1.1
File Size Uploaded Provenance Actions
deconversation-0.1.1.tar.gz 488.1 kB Without provenance Details for deconversation-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for DECONVersation 0.1.1
File Interpreter ABI Platform Actions
deconversation-0.1.1-py3-none-any.whl Python 3 none any Details for deconversation-0.1.1-py3-none-any.whl

Total release size: 979.3 kB

Release files / deconversation-0.1.1.tar.gz

Download URL deconversation-0.1.1.tar.gz
Size 488.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f2055c16e1c3147cca712bd98b7ef9d136160fb4f592fa343b1e2824aff43e90
BLAKE2b-256 checksum
How to use checksums
a6da6882e1e29809cd1582420a8c3e1b9bc0b1f9914ff58b16734ae303bf1da8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.15

Release files / deconversation-0.1.1-py3-none-any.whl

Download URL deconversation-0.1.1-py3-none-any.whl
Size 491.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39fc1ea29ab6545ca1d19fdf5343d0f95f61d4c780ef9d28b4120af208a9e64b
BLAKE2b-256 checksum
How to use checksums
f687149c86a41e090b82b22f0a330c911818bc4469ddcad300438686b7167cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.15

Security for DECONVersation 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page