උණුසුම් පුවත්

CellBender: A Complete Guide to Removing Ambient RNA From Single-Cell Data

CellBender: A Complete Guide to Removing Ambient RNA From Single-Cell Data

Introduction

Single-cell RNA sequencing has transformed how researchers study tissues and tumours, but the data it produces is rarely clean. When cells break open during sample preparation, some of their RNA leaks into the surrounding solution. That free-floating material, known as ambient RNA, is captured inside droplets that contain real cells and inside droplets that contain nothing at all, quietly distorting the counts that downstream analysis depends on.

CellBender was built to solve exactly this problem. It is an open-source Python tool that removes ambient RNA contamination and identifies empty droplets in droplet-based single-cell RNA sequencing data, using a deep generative model that learns what the background noise looks like and subtracts it. This guide explains what CellBender does, how it works, how to run it, and where it fits in a modern bioinformatics workflow.

What Is CellBender?

CellBender is a command-line software package developed at the Broad Institute and published in Nature Methods in 2023. It takes the raw, unfiltered output of a droplet-based single-cell experiment, typically the raw feature-barcode matrix produced by 10x Genomics Cell Ranger, and returns a cleaned count matrix. Unlike simple thresholding, which keeps or discards droplets based on a fixed cut-off of total counts, CellBender assigns every droplet a probability of containing a real cell and estimates how much of each droplet’s signal is genuine and how much is background.

Because the method is unsupervised, it needs no list of expected marker genes, prior clustering, or manual annotation. It learns the ambient profile directly from the data, which makes it useful across tissues, species and designs, including frozen tissue, where cell damage makes contamination especially severe.

Why Ambient RNA Is a Problem

Ambient RNA is not distributed evenly across genes. Highly expressed genes from abundant or fragile cell types dominate the background soup, so their transcripts appear at low levels in almost every droplet. Left in place, this contamination makes cell types look more similar than they are, marker genes lose their specificity, and empty droplets may be mistaken for a rare cell population.

Empty droplets create a second problem. A raw matrix typically contains hundreds of thousands of barcodes, most of which captured no cell at all. A crude count threshold either admits noisy empty droplets or discards genuine low-RNA cells. CellBender addresses both problems in one probabilistic framework.

How CellBender Works

A Deep Generative Model

At its core, CellBender is a Bayesian model implemented with neural networks in PyTorch. It assumes the counts in each droplet come from a mixture: some molecules from a real cell with its own expression profile, and some from the shared ambient pool. Variational inference learns the model’s parameters, including the ambient profile and a latent representation of each cell’s true state.

Learning From Empty Droplets

The empty droplets in the raw data are not wasted; they are the key to the whole approach. Because they contain only ambient RNA, they give the model a direct view of the background distribution. By comparing droplets that clearly contain cells with droplets that clearly do not, the network learns to estimate, for every barcode, the posterior probability that it contains a cell and the fraction of its counts explained by contamination.

The Cleaned Output

When training finishes, CellBender writes out a new count matrix in HDF5 format with the estimated ambient counts removed. Droplets judged to be empty are excluded, and the remaining cells carry counts that more closely reflect their real expression. The output also includes the learned ambient profile and per-barcode posterior probabilities, so the cleaning step stays transparent and auditable.

Key Features

CellBender’s main features include fully unsupervised background removal, probabilistic cell calling that replaces hard count thresholds, direct support for Cell Ranger raw HDF5 files and plain count matrices, GPU acceleration for large datasets, configurable false positive rate settings, and checkpointing so long runs can be resumed. It is maintained as a standard Python package with a test suite and detailed documentation.

Getting Started

Installation

CellBender is installed from PyPI with pip, ideally inside a clean virtual environment, and it depends on PyTorch. For realistic dataset sizes a CUDA-capable GPU is strongly recommended, because model training on CPU alone can take many hours. The documentation and examples at cellbender.com cover installation for different environments, including common cluster setups.

Running Your First Job

A typical run uses the remove-background command, pointing the tool at the raw HDF5 file and an output path, with a rough estimate of the expected number of cells and total droplets. These estimates need not be exact; they guide the model’s priors. The cleaned output can then be loaded directly into Scanpy or Seurat for quality control, clustering and the rest of the standard workflow.

Use Cases in Bioinformatics

Common use cases include cleaning tumour microenvironment samples where dying cells release large amounts of RNA, rescuing low-RNA cell types that threshold-based calling would discard, improving marker gene detection before annotation, preparing datasets for integration across samples with different background levels, and processing single-nucleus data from frozen tissue, where contamination is usually heavy.

Frequently Asked Questions

What input does CellBender need?

It needs the raw, unfiltered count data, for Cell Ranger users the raw_feature_bc_matrix.h5 file. Filtered matrices have already discarded the empty droplets the model learns from, so they cannot be used as a substitute.

Do I need a GPU?

A GPU is not strictly required, but it is strongly recommended. Training the model on hundreds of thousands of droplets is computationally intensive, and a CUDA GPU typically reduces runtimes from many hours to well under one hour.

How is CellBender different from SoupX?

SoupX estimates contamination using known marker genes and an existing clustering, then adjusts counts. CellBender instead learns the ambient profile and cell probabilities from the raw data with a generative model, so it needs no prior biological assumptions, and it performs cell calling at the same time.

Should I run CellBender on each sample separately?

Yes. The ambient profile depends on the specific sample and library preparation, so each sample should be processed in its own run before the cleaned matrices are merged for joint analysis.

Conclusion

Ambient RNA and empty droplets are unavoidable by-products of droplet-based single-cell sequencing, but they do not have to compromise an analysis. By learning the background directly from the data with a deep generative model, CellBender produces cleaner counts and more reliable cell calls, strengthening everything built on top, from clustering to differential expression. For any pipeline that starts with raw single-cell matrices, it is one of the most effective first steps available.

Related Articles

ප්‍රතිචාරයක් ලබාදෙන්න

ඔබගේ ඊමේල් ලිපිනය ප්‍රසිද්ධ කරන්නේ නැත. අත්‍යාවශ්‍යයය ක්ෂේත්‍ර සලකුණු කොට ඇත *

Back to top button

Important Note: Contributors submit content under paid authorship. Daily review of all submissions is not possible. The owner does not promote or endorse illegal services such as betting, gambling, casinos, or CBD.

Close Welcome Bar