Skip to content

Repository files navigation

PyPI version Python 3.8+ Downloads Github action

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 faithfullly 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.

---
config:
  theme: 'neutral'
---
flowchart
    subgraph ide1 [standard deconv]
    direction TB 
    A[scRNA: cell x gene] --> B(full profile: type x gene)
    A[scRNA: cell x gene] --> C(markers)
    D[bulkRNA: sample x gene]
    B --> F(signature: type x marker)
    C --> F
    F bb@==> E
    D db@==> E{{deconv res:
    sample x type%}}
    end
    subgraph ide2 [foundation model deconv]
    direction TB
    A1[scRNA: cell x gene] --> B1(full profile: type x gene)
    A1[scRNA: cell x gene] --> C1([fa:fa-robot fine-tuned model])
    B1 --> F1(type x embeddings)
    C1 --> F1
    D1[bulkRNA: sample x gene] --> G1(sample x embeddings)
    C1 --> G1
    F1 f1b@==> E1{{deconv res:
    sample x type%}}
    G1 g1b@==> E1
    end

bb@{ curve: linear }
db@{ curve: linear }
f1b@{ curve: linear }
g1b@{ curve: linear }
style A fill:green,color:#fff
style A1 fill:green,color:#fff
style D fill:blue,color:#fff
style D1 fill:blue,color:#fff
style C1 fill:red,color:#fff
style E stroke-width:4px
style E1 stroke-width:4px
Loading

Benchmarking

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

Summary
Across 6 benchmarked datasets, we calculate overall RMSE and correlation coefficient alongside mean RMSE and correlation averaged across cell types. Fine-tuned Cell2Sentence and Geneformer-based embeddings both demonstrate consistent deconvolution performance across all 6 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 pacakge achieves comparable performance to the fine-tuned embedding-based approaches available in DECONVersation.

# Dataset Source Ground Truth Cell Type #
1 PMBC (Hoek) PBMC FACS 5
2 PMBC (Finotello) PBMC FACS 5
3 PMBC (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

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 correpsonding 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.


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

About

DECONVersation uses LLM-derived embeddings to deconvolve bulk RNA-seq data into robust cell type proportions, mitigating batch effects inherent to single-cell reference matrices.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages