Skip to main content

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.

SeuratWrappers provides two fastMNN integration functions:
  • RunFastMNN() — For Seurat v4-style workflows using a list of Seurat objects
  • FastMNNIntegration() — For Seurat v5-style workflows using IntegrateLayers()

RunFastMNN()

Syntax

RunFastMNN(
  object.list,
  assay = NULL,
  features = 2000,
  reduction.name = "mnn",
  reduction.key = "mnn_",
  reconstructed.assay = "mnn.reconstructed",
  verbose = TRUE,
  ...
)

Parameters

object.list
list
required
A list of two or more Seurat objects to integrate.
assay
character
default:"NULL"
Assay to use for integration. Defaults to the active default assay of the first object.
features
integer or character vector
default:"2000"
If an integer, selects that many integration features via SelectIntegrationFeatures(). If a character vector, uses those specific features.
reduction.name
character
default:"mnn"
Name for the MNN-corrected embedding stored as a DimReduc object.
reduction.key
character
default:"mnn_"
Column name prefix for the MNN embedding dimensions.
reconstructed.assay
character
default:"mnn.reconstructed"
Name of the assay storing the batch-corrected gene expression matrix.
verbose
logical
default:"TRUE"
Print progress messages.
...
any
Additional parameters passed to batchelor::fastMNN() (e.g., k for number of nearest neighbors).

Returns

A merged Seurat object with:
  • A DimReduc under reduction.name containing MNN-corrected embeddings
  • A new assay under reconstructed.assay with batch-corrected expression values
  • Integration metadata stored in the Tool slot

FastMNNIntegration()

For use with Seurat v5’s IntegrateLayers() function.

Syntax

FastMNNIntegration(
  object,
  assay = NULL,
  orig = NULL,
  groups = NULL,
  layers = NULL,
  scale.layer = NULL,
  features = 2000,
  new.reduction = "integrated.mnn",
  reduction.key = "mnn_",
  reconstructed.assay = "mnn.reconstructed",
  verbose = TRUE,
  ...
)

Parameters

object
Seurat
required
A Seurat v5 object with split layers (one per batch).
features
integer or character vector
default:"2000"
Number of integration features or a character vector of specific features.
new.reduction
character
default:"integrated.mnn"
Name for the integrated reduction.
reduction.key
character
default:"mnn_"
Prefix for embedding dimension names.

Examples

library(SeuratWrappers)
BiocManager::install("batchelor")

# Seurat v4 style
object <- RunFastMNN(object.list = SplitObject(merged, split.by = "batch"))

# Seurat v5 style
object <- IntegrateLayers(
  object = merged,
  method = FastMNNIntegration,
  new.reduction = "integrated.mnn",
  verbose = FALSE
)

See Also

Build docs developers (and LLMs) love