A software package for eliminating technical artifacts from high-throughput single-cell RNA sequencing (scRNA-seq) data
Project description
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.
For now, we recommend using either v0.3.0 or the master branch (after #347) until v0.3.2 is released, and then using v0.3.2.
Outputs generated with v0.3.1 (or the master branch between #303 and #347) can be salvaged by making use of the checkpoint file, which is not compromised. The following command will re-run the (inexpensive, CPU-only) estimation of the output count matrix using the saved posterior in the checkpoint file. Note the use of the new input argument --force-use-checkpoint which will allow use of a checkpoint file produced by a different CellBender version:
(cellbender) $ cellbender remove-background \ --input my_raw_count_matrix_file.h5 \ --output my_cellbender_output_file.h5 \ --checkpoint path/to/ckpt.tar.gz \ --force-use-checkpointwhere path/to/ckpt.tar.gz is the path to the checkpoint file generated by the original run. Ensure that you pair up the right --input with the right --checkpoint.
Installation and Usage
CellBender 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.1.0, 0.2.0, 0.2.1, 0.2.2, and 0.3.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.7
$ conda activate cellbender
Install the pytables module:
(cellbender) $ conda install -c anaconda pytables
Install pytorch via these instructions, for example:
(cellbender) $ pip install torch
and 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.
Clone this repository and install CellBender (in editable -e mode):
(cellbender) $ git clone https://github.com/broadinstitute/CellBender.git
(cellbender) $ pip install -e CellBender
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
See also our preprint on bioRxiv.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cellbender-0.3.2.tar.gz.
File metadata
- Download URL: cellbender-0.3.2.tar.gz
- Upload date:
- Size: 154.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49f6aef5d64494084b20a75b3516452af96b5df5de6282c0167e8f625bd936a2
|
|
| MD5 |
9640689928a1d0acc18bf70c604556bb
|
|
| BLAKE2b-256 |
62a253cfb3d65366e9470c88cdd367674943aa396fcfc732f2041f479f1eb206
|
File details
Details for the file cellbender-0.3.2-py3-none-any.whl.
File metadata
- Download URL: cellbender-0.3.2-py3-none-any.whl
- Upload date:
- Size: 173.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e625fbf68ce886356c39de2e4f7212b3a37000ae9aa3883d5f29e36883f1be51
|
|
| MD5 |
be6ec2adfaf8abb82354e04235f15e1e
|
|
| BLAKE2b-256 |
130ccf4e51fd07287aacc3008657e139868c75a638db5ee4958f74bf07c68c84
|