fastMNN identifies mutual nearest neighbors (MNNs) between datasets in a shared low-dimensional space and uses them to estimate and remove batch effects. SeuratWrappers provides two functions:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/satijalab/seurat-wrappers/llms.txt
Use this file to discover all available pages before exploring further.
RunFastMNN() for Seurat v4 workflows (operating on a list of Seurat objects), and FastMNNIntegration() for Seurat v5 workflows (used via IntegrateLayers()).
Citation
If you use fastMNN in your work, please cite:Batch effects in single-cell RNA-sequencing data are corrected by matching mutual nearest neighbors Laleh Haghverdi, Aaron T L Lun, Michael D Morgan & John C Marioni Nature Biotechnology, 2018 doi: 10.1038/nbt.4091 Bioconductor: https://bioconductor.org/packages/release/bioc/html/batchelor.html
Installation
Seurat v4: RunFastMNN
RunFastMNN() takes a list of Seurat objects and returns a single merged Seurat object with a corrected MNN embedding.
Workflow
Run fastMNN on split objects
Split the merged object by batch variable and pass the list to
RunFastMNN(). The function selects integration features, converts to SingleCellExperiment internally, and returns the merged object with an mnn reduction.Examples
Interferon-stimulated and control PBMC
Eight human pancreatic islet datasets
Parameters
A list of two or more Seurat objects to integrate. Each must have variable features computed.
Assay to use. Defaults to the default assay of the first object in the list.
Either a numeric value specifying how many variable features to select across all datasets, or an explicit character vector of feature names to use for batch correction.
Name under which the corrected MNN embedding is stored in the returned Seurat object.
Key prefix for the MNN reduction dimensions.
Name of the assay containing the low-rank reconstructed expression matrix. Variable features of this assay are set to the integration features.
Whether to print progress messages during feature selection.
Seurat v5: FastMNNIntegration
FastMNNIntegration() is designed for the Seurat v5 IntegrateLayers() framework. It operates on a merged Seurat object with split layers rather than a list of separate objects.
Workflow
Integrate layers with FastMNNIntegration
Pass
FastMNNIntegration as the method argument. The corrected reduction is stored under new.reduction.Parameters
A merged Seurat object with split layers (Seurat v5 format).
A one-column data frame with grouping information identifying which batch each cell belongs to.
Layer names to integrate. Defaults to all
data layers found in the object.Number of variable features to select, or an explicit feature list.
Name under which the corrected embedding is stored.
Key prefix for the MNN reduction dimensions.
Name of the assay containing the reconstructed expression matrix.
Whether to print progress messages.
The
FastMNNIntegration function has attr(x = FastMNNIntegration, which = 'Seurat.method') <- 'integration' set, which registers it as a valid integration method for IntegrateLayers().