██████╗ ██╗ ██╗ ██████╗ ███████╗ ██████╗ ██████╗ ███╗ ██╗ ██╗ ██╗
██╔══██╗ ╚██╗ ██╔╝ ██╔══██╗ ██╔════╝ ██╔════╝ ██╔═══██╗ ████╗ ██║ ██║ ██║
██████╔╝ ╚████╔╝ ██║ ██║ █████╗ ██║ ██║ ██║ ██╔██╗ ██║ ██║ ██║
██╔═══╝ ╚██╔╝ ██║ ██║ ██╔══╝ ██║ ██║ ██║ ██║╚██╗██║ ╚██╗ ██╔╝
██║ ██║ ██████╔╝ ███████╗ ╚██████╗ ╚██████╔╝ ██║ ╚████║ ╚████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═══╝
Python implementation of bulk RNAseq deconvolution algorithms
How to install
package
pip install "pydeconv"
dev
uv sync --all-groups
How to use: overview
from pydeconv import SignatureMatrix
from pydeconv.model import OLS, NNLS, DWLS, Tape, Scaden, MixupVI, NuSVR, RLR, WNNLS
from adata import AnnData
signature_matrix = SignatureMatrix.load("path/to/signature_matrix.csv") # index: gene names, column: cell types
solver = NNLS(signature_matrix)
adata = AnnData("path/to/adata.h5ad") # index: sample_id, columns: gene_names
adata.layers["raw_counts"] = ... # apply your preprocessing step or not
cell_prop = solver.transform(adata, layer="raw_counts", ratio=True)
How to use: detailed
1. Load an already registered signature matrix
from pydeconv.signature_matrix.registry import sig_matrix_laughney_lung_cancer
signature_matrix = sig_matrix_laughney_lung_cancer()
2. Load a custom signature matrix
from pydeconv import SignatureMatrix
signature_matrix = SignatureMatrix.load("path/to/signature_matrix.csv") #index: gene names, column: cell types
3. Predict
from pydeconv.model import Tape, Scaden
adata = AnnData("path/to/adata.h5ad") # index: sample_id, columns: gene_names
adata.layers["counts_sum"] = ...
solver = Scaden(weights_version="cti_2nd_level_granularity")
cell_prop = solver.transform(adata, layer="counts_sum", ratio=True)
4. Predict (signature based method)
from pydeconv.model import OLS, NNLS, DWLS
signature_matrix = ...
adata = AnnData("path/to/adata.h5ad")
adata.layers["relative_counts"] = ...
solver = DWLS(signature_matrix)
cell_prop = solver.transform(adata, layer="relative_counts", ratio=True)
Benchmark
We benchmarked the performance of several deconvolution algorithms on the CTI dataset, including our developed method MixUpVI. This repository and the proposed methods are part of the following paper: Joint probabilistic modeling of pseudobulk and single-cell transcriptomics enables accurate estimation of cell type composition, published in the Generative AI & Biology workshop of ICML, 2025.
The results are shown below.
To run the benchmark, you can use the following command:
python benchmark/run_benchmark.py
Results 1st granularity
Results 2nd granularity
Cite
If you found our work useful in your research, please consider citing it at:
@inproceedings{
grouard2025joint,
title={Joint Probabilistic Modeling of Pseudobulk and Single-Cell Transcriptomics Enables Accurate Estimation of Cell Composition},
author={Simon Grouard and Khalil Ouardini and Yann Rodriguez and Jean-Philippe Vert and Almudena Espin-Perez},
booktitle={ICML 2025 Generative AI and Biology (GenBio) Workshop},
year={2025},
url={https://openreview.net/forum?id=JhDJ0MGo2z}
}
Metadata
Release files for pydeconv 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydeconv-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for pydeconv-0.0.8-py3-none-any.whl |
Release files / pydeconv-0.0.8-py3-none-any.whl
| Download URL | pydeconv-0.0.8-py3-none-any.whl |
|---|---|
| Size | 39.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0dd6808539472a12d97e289e887566b4f14dd8558d66c0a6e2a3cf3142fc48a2
|
|
BLAKE2b-256 checksum How to use checksums |
6c56b6b96d327db4e7b996ba95a84d697a63d450944714288f95317aacdf713c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.0
|
Security for pydeconv 0.0.8
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.