| FastMNNIntegration | R Documentation |
Run fastMNN in Seurat 5
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,
...
)
object |
A merged seurat object |
assay |
Assay to use, defaults to the default assay of the first object |
groups |
A one-column data frame with grouping information |
layers |
Layers to use |
features |
Either a list of features to use when calculating batch correction, or a number (2000 by default) of variable features to select. |
reduction.key |
Key for resulting DimReduc |
reconstructed.assay |
Name for the assay containing the low-rank reconstruction of the expression matrix. |
verbose |
Print messages |
... |
Extra parameters passed to |
reduction.name |
Name to store resulting DimReduc object as |
A Seurat object merged from the objects in object.list and a
new DimReduc of name reduction.name (key set to reduction.key)
with corrected embeddings matrix as well as the rotation matrix used for the
PCA stored in the feature loadings slot. Also returns an expression matrix
reconstructed from the low-rank approximation in the
reconstructed.assay assay; all other metadata info
fastMNN is stored in the tool slot,
accessible with Tool
This function requires the batchelor package to be installed
fastMNN Tool
## Not run:
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)
# After preprocessing, we integrate layers:
obj <- IntegrateLayers(object = obj, method = FastMNNIntegration,
new.reduction = 'integrated.mnn', verbose = FALSE)
# We can also add parameters specific to FastMNN.
# Here we set `k` to specify the number of nearest neighbors to use when identifying MNNs:
obj <- IntegrateLayers(object = obj, method = FastMNNIntegration,
new.reduction = 'integrated.mnn', k = 15, verbose = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.