Scanorama is a computational algorithm designed to integrate and correct for batch effects across multiple heterogeneous single-cell RNA sequencing datasets. It functions by identifying mutual nearest neighbors (MNNs) in a low-dimensional embedding space across all pairs of datasets simultaneously, rather than sequentially, and then uses these correspondences to stitch the datasets into a single, unified, and batch-corrected panorama.
Glossary
Scanorama

What is Scanorama?
Scanorama is an algorithm for integrating heterogeneous single-cell datasets that identifies mutual nearest neighbors across all pairs of datasets and stitches them together into a unified panorama, effectively correcting for batch effects.
Unlike methods that require a reference dataset or process batches in a specific order, Scanorama's panoramic stitching approach is robust to dataset composition and order. It effectively removes technical variation while preserving true biological heterogeneity, making it a critical tool for large-scale atlasing efforts where combining dozens of independently generated single-cell experiments is required.
Key Features of Scanorama
Scanorama constructs a unified cellular landscape by identifying mutual nearest neighbors across all pairs of datasets and stitching them together, effectively correcting for batch effects without assuming a shared cell type structure.
Panorama Stitching Algorithm
Scanorama's core innovation is its panorama stitching approach, analogous to creating a panoramic photo from overlapping images. It identifies mutual nearest neighbors (MNNs) across all pairs of datasets in a hierarchical manner, finding cells that are each other's best match in their respective batches. These MNN pairs serve as anchor points to compute a non-linear correction vector, merging datasets into a single, coherent embedding without requiring a reference dataset or assuming shared cell types across all batches.
Hierarchical Dataset Merging
Unlike methods that correct all batches simultaneously, Scanorama processes datasets in a greedy, hierarchical order based on similarity. It first identifies the most similar pair of datasets, merges them, and then iteratively integrates the next most similar dataset into the growing panorama. This strategy:
- Reduces computational complexity for large-scale integrations
- Prevents error propagation from dissimilar datasets
- Allows integration of dozens of datasets with minimal memory overhead
Non-Linear Correction via Gaussian Weighting
Scanorama applies a locally weighted correction vector to each cell using a Gaussian kernel. For each cell, the correction is computed as a weighted average of the displacement vectors from its nearest MNN pairs, where weights decay with distance. This produces a smooth, non-linear warp field that:
- Preserves local cellular topology
- Corrects complex, non-linear batch effects
- Avoids overcorrection by limiting influence to local neighborhoods
No Shared Cell Type Assumption
A key advantage of Scanorama is that it does not require overlapping cell types across all batches. The algorithm only requires that each pair of datasets being merged shares at least some cell populations, which is biologically realistic for most experimental designs. This makes Scanorama robust for integrating datasets from:
- Different tissues or conditions
- Time-series experiments with shifting populations
- Cross-species comparisons where cell type homology is partial
Scalable Low-Dimensional Processing
Scanorama operates on a low-dimensional PCA embedding rather than the full gene expression matrix, dramatically reducing computational demands. The algorithm:
- Computes MNNs in reduced dimensional space for speed
- Stores correction vectors compactly
- Can integrate hundreds of thousands of cells on standard hardware
- Scales linearly with the number of datasets rather than quadratically
Integration Quality Assessment
Scanorama's output can be evaluated using standard batch correction metrics. Successful integration is characterized by:
- High entropy of batch mixing in local neighborhoods
- Low batch Average Silhouette Width (ASW) indicating batch label dispersion
- High cell-type ASW confirming biological signal preservation
- Visual inspection of UMAP or t-SNE embeddings showing well-mixed batches while maintaining distinct cell-type clusters
Frequently Asked Questions
Clear, technical answers to the most common questions about the Scanorama algorithm for single-cell data integration and batch effect correction.
Scanorama is a computational algorithm designed to integrate and correct batch effects across multiple heterogeneous single-cell RNA sequencing datasets. It functions by identifying mutual nearest neighbors (MNNs) across all pairs of datasets in a high-dimensional expression space. The core mechanism involves finding cells from different batches that are each other's nearest neighbors, establishing a correspondence that represents shared biological states. Scanorama then computes a non-linear correction vector for each cell based on these anchors, effectively 'stitching' the datasets together into a unified, batch-corrected panorama. Unlike methods that require a reference dataset, Scanorama processes all datasets simultaneously, making it robust for integrating many diverse samples without imposing a hierarchical structure. The algorithm is implemented in Python and leverages efficient nearest-neighbor search and matrix factorization to scale to large collections of single-cell data.
Scanorama vs. Other Batch Correction Methods
A feature-level comparison of Scanorama against widely used single-cell batch correction algorithms for multi-dataset integration scenarios.
| Feature | Scanorama | Harmony | Seurat CCA |
|---|---|---|---|
Core Algorithm | Panoramic stitching via mutual nearest neighbors across all dataset pairs | Iterative soft clustering in a shared low-dimensional embedding | Canonical correlation analysis to identify cross-dataset anchors |
Input Data Type | Any high-dimensional data (scRNA-seq, scATAC-seq, CyTOF) | PCA-reduced embeddings | Log-normalized gene expression matrices |
Scalability (100k+ cells) | |||
Handles >10 Datasets | |||
Preserves Dataset-Specific Cell Types | |||
Requires Pre-Computed Dimensionality Reduction | |||
Output Format | Corrected expression matrix in original feature space | Harmonized low-dimensional embedding | Integrated expression matrix and corrected embeddings |
Runtime for 50k Cells (Approx.) | 5-15 min | 2-5 min | 10-30 min |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Scanorama operates within a broader landscape of batch effect correction algorithms. Understanding these related methods is essential for selecting the right tool for multi-study single-cell integration.
Mutual Nearest Neighbors (MNN)
The foundational concept that Scanorama generalizes. MNN identifies pairs of cells from different batches that are mutual nearest neighbors in high-dimensional space. These pairs define a correction vector used to align the batches. Scanorama extends this by finding MNNs across all dataset pairs simultaneously, not just sequentially, enabling a globally consistent panorama rather than a chain of pairwise corrections.
ComBat
An empirical Bayes framework originally developed for microarray gene expression. ComBat estimates location and scale adjustments using a hierarchical model that pools information across genes. It is a parametric method that assumes batch effects follow a systematic additive and multiplicative pattern. Scanorama is non-parametric and designed specifically for the zero-inflated, high-dimensional nature of single-cell data, making no distributional assumptions.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us