BBKNN

Batch balanced KNN algorithm for single-cell RNA-seq data integration and batch correction

What it is

BBKNN is a computational biology tool designed for single-cell RNA sequencing data analysis. It implements a batch balanced K-nearest neighbors algorithm that identifies each cell's top neighbors within each batch separately rather than across the entire cell pool. This approach addresses batch effects that commonly confound single-cell studies by preserving biological variation while removing technical artifacts.

The package provides three main functions: the core BBKNN algorithm for batch balanced neighbor finding, a ridge regression module for scaled expression data that accepts both technical and biological categorical variables, and a Scanpy-independent variant that operates directly on PCA matrices with per-cell batch assignments. These tools integrate with the popular Scanpy ecosystem for single-cell analysis in Python.

Researchers and bioinformaticians working with single-cell transcriptomics data use BBKNN to merge datasets from different experimental batches, donors, or sequencing runs. The method is particularly valuable for large-scale atlas projects where data comes from multiple sources. Installation is available via pip or conda, and the documentation includes a tutorial notebook demonstrating typical workflows.

BBKNN stands out from other batch correction methods by modifying the KNN graph construction itself rather than correcting the expression matrix. This graph-based approach maintains computational efficiency and scales well to large datasets. The algorithm has been cited in numerous high-impact single-cell studies and is maintained by researchers with expertise in computational biology.

The documentation site hosted on Read the Docs provides complete API reference, installation guides, and usage examples. Users can access the project home page and tutorial notebook directly from the documentation for hands-on learning.

This description was generated by AI from the site's public content and may contain errors.

What you can do there

  • Batch balanced KNN algorithm for single-cell data integration
  • Ridge regression module for scaled expression data
  • Scanpy-independent matrix-based BBKNN variant
  • Complete API documentation with function docstrings
  • Tutorial notebook for hands-on learning

Who it's for

Computational biologists, bioinformaticians, and researchers analyzing single-cell RNA-seq data

Frequently asked questions about bbknn.readthedocs.io

›What is BBKNN used for?

BBKNN is used for batch correction in single-cell RNA sequencing data by constructing a batch balanced K-nearest neighbor graph that identifies neighbors within each batch separately.

›How does BBKNN differ from other batch correction methods?

BBKNN modifies the KNN graph construction process rather than correcting the expression matrix directly, preserving biological variation while removing batch effects through graph-based integration.

›Does BBKNN require Scanpy to run?

The main BBKNN function integrates with Scanpy, but a Scanpy-independent variant bbknn.matrix.bbknn runs on PCA matrices and batch assignments without requiring an AnnData object.

›What input data does BBKNN need?

BBKNN requires a preprocessed single-cell dataset with batch annotations, typically provided as an AnnData object with a batch key indicating the batch assignment for each cell.

›Is BBKNN suitable for large datasets?

Yes, BBKNN is designed for computational efficiency and scales well to large single-cell datasets commonly encountered in atlas-scale projects.

›Where can I find tutorials for BBKNN?

The documentation includes a tutorial notebook linked from the project home page that demonstrates typical workflows for batch correction and data integration.

›Who developed BBKNN?

BBKNN was developed by Krzysztof Polanski and Jongeun Park, with copyright spanning 2018 to 2021.