PrepSCTIntegration {Seurat} | R Documentation |
Prepare an object list normalized with sctransform for integration.
Description
This function takes in a list of objects that have been normalized with the
SCTransform
method and performs the following steps:
If anchor.features is a numeric value, calls
SelectIntegrationFeatures
to determine the features to use in the downstream integration procedure.Ensures that the sctransform residuals for the features specified to anchor.features are present in each object in the list. This is necessary because the default behavior of
SCTransform
is to only store the residuals for the features determined to be variable. Residuals are recomputed for missing features using the stored model parameters via theGetResidual
function.Subsets the
scale.data
slot to only contain the residuals for anchor.features for efficiency in downstream processing.
Usage
PrepSCTIntegration(
object.list,
assay = NULL,
anchor.features = 2000,
sct.clip.range = NULL,
verbose = TRUE
)
Arguments
object.list |
A list of |
assay |
The name of the |
anchor.features |
Can be either:
|
sct.clip.range |
Numeric of length two specifying the min and max values the Pearson residual will be clipped to |
verbose |
Display output/messages |
Value
A list of Seurat
objects with the appropriate scale.data
slots
containing only the required anchor.features
.
Examples
## Not run:
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")
# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2 to integrate
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]
# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)
# select integration features and prep step
features <- SelectIntegrationFeatures(pancreas.list)
pancreas.list <- PrepSCTIntegration(
pancreas.list,
anchor.features = features
)
# downstream integration steps
anchors <- FindIntegrationAnchors(
pancreas.list,
normalization.method = "SCT",
anchor.features = features
)
pancreas.integrated <- IntegrateData(anchors, normalization.method = "SCT")
## End(Not run)