Skip to main content

License Documentation Status PyPI Downloads Stars

CellBender Logo

CellBender is a software package for eliminating technical artifacts from high-throughput single-cell RNA sequencing (scRNA-seq) data.

The current release contains the following modules. More modules will be added in the future:

  • remove-background:

    This module removes counts due to ambient RNA molecules and random barcode swapping from (raw) UMI-based scRNA-seq count matrices. Also works for snRNA-seq and CITE-seq.

Please refer to the documentation for a quick start tutorial.

WARNING:

The release tagged v0.3.1 included a bug which caused output count matrices to be incorrect. The bug, introduced in #303, compromised output denoised count matrices (due to an integer overflow) and would often show up as negative entries in the output count matrices. The bug also existed on the master branch until #347.

We recommend using v0.3.2 or higher. The codebase has been revitalized and updated in v0.4.0, and we recommend using that or higher for all new analyses. The algorithm remains the same as in the paper for versions v0.3.0, v0.3.2, and v0.4.0. Completely identical, just codebase updates. Version v0.5.0 will use a very slight tweak in MKCP estimation to improve compute efficiency and reduce memory usage, but again the algorithm is the same.

Installation and Usage

As of CellBender v0.4.0, CellBender is compatible with python 3.10+, and can be installed via

$ pip install cellbender

(and we recommend installing in its own conda environment to prevent conflicts with other software).

CellBender is run as a command-line tool, as in

(cellbender) $ cellbender remove-background \
      --cuda \
      --input my_raw_count_matrix_file.h5 \
      --output my_cellbender_output_file.h5

See the usage documentation for details.

Using The Official Docker Image

A GPU-enabled docker image is available from the Google Container Registry (GCR) as:

us.gcr.io/broad-dsde-methods/cellbender:latest

Available image tags track release tags in GitHub, and include latest, 0.3.0, 0.3.2, and 0.4.0.

WDL Users

A workflow written in the workflow description language (WDL) is available for CellBender remove-background.

For Terra users, a workflow called cellbender/remove-background is available from the Broad Methods repository.

There is also a version available on Dockstore.

Advanced installation

From source for development

Create a conda environment and activate it:

$ conda create -n cellbender python=3.12
$ conda activate cellbender

Clone this repository to your local machine.

(cellbender) $ git clone https://github.com/broadinstitute/CellBender.git

From the repo root, run

(cellbender) $ make install

Ensure that your installation is appropriate for your hardware (i.e. that the relevant CUDA drivers get installed and that torch.cuda.is_available() returns True if you have a GPU available.

This installs CellBender with dev dependencies (in editable -e mode):

From a specific commit

This can be achieved via

(cellbender) $ pip install --no-cache-dir -U git+https://github.com/broadinstitute/CellBender.git@<SHA>

where <SHA> must be replaced by any reference to a particular git commit, such as a tag, a branch name, or a commit sha.

Citing CellBender

If you use CellBender in your research (and we hope you will), please consider citing our paper in Nature Methods:

Stephen J Fleming, Mark D Chaffin, Alessandro Arduini, Amer-Denis Akkad, Eric Banks, John C Marioni, Anthony A Phillipakis, Patrick T Ellinor, and Mehrtash Babadi. Unsupervised removal of systematic background noise from droplet-based single-cell experiments using CellBender. Nature Methods, 2023. https://doi.org/10.1038/s41592-023-01943-7

If you’re unable to access that, see also our preprint on bioRxiv.

Metadata

Release files for cellbender 0.4.0

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

Source distribution (sdist)

Source distribution for cellbender 0.4.0
File Size Uploaded
cellbender-0.4.0.tar.gz 152.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cellbender 0.4.0
File Interpreter ABI Platform
cellbender-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 293.4 kB

Release files / cellbender-0.4.0.tar.gz

Download URL cellbender-0.4.0.tar.gz
Size 152.4 kB
Tags Source
SHA-256 checksum
How to use checksums
91a6449d66c4dcff4368a52153d3d093a44c724abe69bc16dc4519bbfcafeaed
BLAKE2b-256 checksum
How to use checksums
2584d30df8fa7663edcc4e426fedab165871866905e921b7a1b794ba3b2d127c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 15, 2026.

Transparency log

Release files / cellbender-0.4.0-py3-none-any.whl

Download URL cellbender-0.4.0-py3-none-any.whl
Size 140.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8cfb9426b29357ce3d24033febece0867bf2c25160212924a34ea216b4f0128
BLAKE2b-256 checksum
How to use checksums
d3a3d912c4619e58702ef1d6713cea376629af20fb63eaf35ac2c2d819e40820
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

4 release files

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