Prepare an object list normalized with sctransform for integration.
Source:R/integration.R
PrepSCTIntegration.RdThis 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
SelectIntegrationFeaturesto 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
SCTransformis to only store the residuals for the features determined to be variable. Residuals are recomputed for missing features using the stored model parameters via theGetResidualfunction.Subsets the
scale.dataslot 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
Seuratobjects to prepare for integration- assay
The name of the
Assayto use for integration. This can be a single name if all the assays to be integrated have the same name, or a character vector containing the name of eachAssayin each object to be integrated. The specified assays must have been normalized usingSCTransform. If NULL (default), the current default assay for each object is used.- anchor.features
Can be either:
A numeric value. This will call
SelectIntegrationFeaturesto select the provided number of features to be used in anchor findingA vector of features to be used as input to the anchor finding process
- 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
if (FALSE) { # \dontrun{
# 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")
} # }