CytePool
Test which genes, cell types and pathways change between conditions in single-cell and bulk RNA-seq.
Cells from one donor are not independent replicates. CytePool pools each sample and cell type into a cube of pseudobulk profiles, and runs limma, edgeR, DESeq2, dream, variancePartition, propeller, fgsea, GSVA, decoupler, metafor and SumRank in Python on numpy arrays.
Install
Requires Python 3.13 or newer:
pip install cytepool
For AnnData, MuData and plotting, install pip install "cytepool[mudata,plot]". See Installation.
Example
Pool cells into a cube, then test a stimulation across cell types with limma-voom, pairing samples by donor:
from cytepool import Design, camera, from_cells, limma_voom, read_gmt
cube = from_cells(
counts, # cells x genes, e.g. adata.X
sample_labels=cell_sample, # e.g. adata.obs["sample"]
group_labels=cell_type, # e.g. adata.obs["cell_type"]
samples=samples, # sample_id, donor, condition
features=genes, # feature_id and symbol, or adata.var
)
design = Design(
cube.samples,
"~ donor + condition",
levels={"condition": ["ctrl", "stim"]},
contrasts={"stim_vs_ctrl": "conditionstim"},
)
result = limma_voom(cube, design)
table = result.table("Monocytes", "stim_vs_ctrl") # topTable columns
# Test pathway response in monocytes from a GMT file.
hallmark = read_gmt("h.all.v2026.2.Hs.symbols.gmt")
pathways = camera(result, hallmark, group="Monocytes", id_column="symbol")
If you already pooled profiles in scanpy, decoupler or LIANA, import them with from_anndata or from_mudata. See the Quick start and Gene sets and pathways.
What CytePool answers
| Question | Start with | Other CytePool functions | R and Python equivalents |
|---|---|---|---|
| Pool cells or import profiles | from_cells, from_bulk |
from_anndata, from_mudata, write_cube, read_cube |
scanpy get.aggregate, decoupler pp.pseudobulk, LIANA adata_to_views |
| Which genes change in each cell type? | limma_voom |
limma_trend, filter_by_expression, tmm_factors |
limma voom, lmFit, eBayes, topTable; edgeR filterByExpr, calcNormFactors |
| Which genes change in bulk RNA-seq? | limma_voom on from_bulk |
fit_quasi_likelihood, quasi_likelihood_f_test, fit_deseq2, deseq2_wald_test, deseq2_likelihood_ratio_test, treat |
edgeR glmQLFit, glmQLFTest; DESeq2 DESeq, results; limma treat |
| Which genes change, with several samples of each donor? | dream_voom |
fit_mixed_model, fixed_effect_tests, fixed_effect_f_test |
variancePartition dream, voomWithDreamWeights; lme4 lmer, lmerTest, pbkrtest |
| What drives the variation between samples? | variance_partitioning |
principal_components, plot_mds, plot_pca |
variancePartition fitExtractVarPartModel; DESeq2 plotPCA; limma plotMDS |
| Which cell types expand or contract? | propeller |
plot_composition |
speckle propeller |
| Do the genes of a pathway respond to a contrast? | camera |
fry, roast, mroast, romer, over_representation |
limma camera, fry, roast, mroast, romer, kegga |
| Do the genes of a pathway gather along a ranking? | gsea |
plot_enrichment, plot_gsea_table |
fgsea fgseaMultilevel, plotEnrichment, plotGseaTable |
| How active is a pathway in each sample? | gsva |
ssgsea, combined_z_scores, plage, limma |
GSVA gsva, ssgseaParam, zscoreParam, plageParam |
| Which regulators and pathways are active? | ulm |
mlm, weighted_aggregate, collectri, progeny, limma |
decoupler mt.ulm, mt.mlm, mt.waggr; CollecTRI, PROGENy |
| What do several studies say together? | meta_analysis |
CubeCollection, analyse_each_study, combine_p_values |
metafor rma.uni; metap |
| Which changes replicate across studies? | sumrank |
replication, partial_conjunction, proportion_of_true_nulls, held_out_prediction |
SumRank; qvalue pi0est |
Choosing a method compares the alternatives for each question, and Validation benchmarks CytePool against the reference packages.
Documentation
The documentation is at https://docs.nygen.io/CytePool/.
Development
uv sync --extra test --group dev --group docs
uv run pytest
uv run ruff check cytepool tests validation docs
uv run ruff format --check cytepool tests validation docs
uv run mypy cytepool
make -C docs api
License
BSD 3-Clause. See LICENSE and THIRD_PARTY_NOTICES.md.
Metadata
Release files for cytepool 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cytepool-0.1.0.tar.gz | 746.0 kB | With provenance | Details for cytepool-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cytepool-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cytepool-0.1.0-py3-none-any.whl |
Total release size: 1.5 MB
Release files / cytepool-0.1.0.tar.gz
| Download URL | cytepool-0.1.0.tar.gz |
|---|---|
| Size | 746.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a823ee8315df4e2ad8eb89a68147a7f8f1a2ea1aa310df3ea4d2b2b4d1f24f3
|
|
BLAKE2b-256 checksum How to use checksums |
9718c49c62d497cdb5819983febe987bdb0bf290811c2aef7657a6b5b4c5d0d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / cytepool-0.1.0-py3-none-any.whl
| Download URL | cytepool-0.1.0-py3-none-any.whl |
|---|---|
| Size | 792.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91adfea6162020e6bdd7b1f94ac9a326c8c6e9551b01d1a9bdf9cae6b37c9a3a
|
|
BLAKE2b-256 checksum How to use checksums |
fbaa7683d1136b147ff4fb1940af83811682760b2e0448da525ee1fa6cf7335c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for cytepool 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cytepool-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA 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.