Skip to main content

Performing differential testing on pseudobulked single-cell data

Project description

scBulkDE

Tests Documentation Coverage PyPI

scBulkDE performs differential expression testing on pseudobulked single-cell data. It aggregates cells into pseudobulk samples, infers a full-rank design matrix and performs differential gene expression analysis while accounting for categorical and continuous covariates. Currently PyDeseq2 and ANOVA backends are supported for DE testing.

Key features

  • Pseudobulk aggregation with quality control
  • Covariate-aware design — categorical and continuous covariates with automated resolution of confounding factors
  • Multiple DE engines — ANOVA F-test and PyDESeq2
  • Fallback strategies — pseudoreplicate generation or single-cell testing when biological replicates are insufficient
  • Scanpy drop-intl.rank_genes_groups stores results in adata.uns for seamless integration with scanpy.

Installation

You need to have Python 3.11 or newer installed on your system.

Install from PyPI:

pip install scbulkde

Or install the latest development version:

pip install git+https://github.com/quadbio/scBulkDE.git@main

Quick start

import scbulkde as scb

# One-step: pseudobulk + DE
de_result = scb.tl.de(
    adata,
    group_key="cell_type",
    query="B cells",
    reference="rest",
    replicate_key="donor",
    engine="anova",
)

de_result.results.head()

Or separate pseudobulking from testing for more control:

# Step 1 — Pseudobulk
pb_result = scb.pp.pseudobulk(
    adata,
    group_key="cell_type",
    query="B cells",
    reference="rest",
    replicate_key="donor",
)

# Step 2 — DE
de_result = scb.tl.de(pb_result, engine="anova")

Scanpy drop-in replacement

import scanpy as sc
import scbulkde as scb

scb.tl.rank_genes_groups(
    adata,
    groupby="cell_type",
    de_kwargs=dict(replicate_key="donor", engine="anova"),
)

sc.pl.rank_genes_groups(adata, n_genes=20)

Documentation

Please refer to the documentation, in particular the API documentation.

Release notes

See the changelog.

Contact

For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.

Citation

t.b.a

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scbulkde-0.0.2.tar.gz (236.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scbulkde-0.0.2-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file scbulkde-0.0.2.tar.gz.

File metadata

  • Download URL: scbulkde-0.0.2.tar.gz
  • Upload date:
  • Size: 236.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scbulkde-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5b342c6acd4c3fbe189b94c1772f911d9e5b1c715a139f7ca5a4bf40562ab6bf
MD5 428bdef46ad12f72264846066d1d69af
BLAKE2b-256 20fe6153cdf7c5da6eccfcaa5e14edfe34df9266fe26ce8b105dd6d7220476d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for scbulkde-0.0.2.tar.gz:

Publisher: release.yaml on quadbio/scBulkDE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scbulkde-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: scbulkde-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scbulkde-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 592d36c59b592f1f85f01542050141e62e236352f9bbaa8e724fcbabf9db298c
MD5 b1a73fd2b807549eb99fdf7c560a1251
BLAKE2b-256 d2d89e7965c165e8f730108307fdc7611b0c7cd265bfe682f075982ccae5f055

See more details on using hashes here.

Provenance

The following attestation bundles were made for scbulkde-0.0.2-py3-none-any.whl:

Publisher: release.yaml on quadbio/scBulkDE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page