This process treats the factor loading of each dataset as the low dimensional embedding as well as the cluster assignment probability, i.e. the soft clustering result. Then the method aligns the embedding by linearly moving the centroids of the same cluster but within each dataset towards each other.
ATTENTION: This method is still under development while has shown encouraging results in benchmarking tests. The arguments and their default values reflect the best scored parameters in the tests and some of them may be subject to change in the future.
centroidAlign(object, ...)# S3 method for liger
centroidAlign(
object,
lambda = 1,
useDims = NULL,
scaleEmb = TRUE,
centerEmb = TRUE,
scaleCluster = FALSE,
centerCluster = FALSE,
shift = FALSE,
diagnosis = FALSE,
...
)
# S3 method for Seurat
centroidAlign(
object,
reduction = "inmf",
lambda = 1,
useDims = NULL,
scaleEmb = TRUE,
centerEmb = TRUE,
scaleCluster = FALSE,
centerCluster = FALSE,
shift = FALSE,
diagnosis = FALSE,
...
)
Returns the updated input object
liger method
Update the H.norm
slot for the aligned cell factor
loading, ready for running graph based community detection clustering
or dimensionality reduction for visualization.
Update the cellMata
slot with diagnostic information if
diagnosis = TRUE
.
Seurat method
Update the reductions
slot with a new DimReduc
object containing the aligned cell factor loading.
Update the metadata with diagnostic information if
diagnosis = TRUE
.
A liger or Seurat object with valid factorization
result available (i.e. runIntegration
performed in advance).
Arguments passed to other S3 methods of this function.
Ridge regression penalty applied to each dataset. Can be one
number that applies to all datasets, or a numeric vector with length equal to
the number of datasets. Default 1
.
Indices of factors to use considered for the alignment.
Default NULL
uses all factors.
Logical, whether to scale the factor loading being considered
as the embedding. Default TRUE
.
Logical, whether to center the factor loading being
considered as the embedding before scaling it. Default TRUE
.
Logical, whether to scale the factor loading being
considered as the cluster assignment probability. Default FALSE
.
Logical, whether to center the factor loading being
considered as the cluster assignment probability before scaling it. Default
FALSE
.
Logical, whether to shift the factor loading being considered as
the cluster assignment probability after centered scaling. Default
FALSE
.
Logical, whether to return cell metadata variables with
diagnostic information. See Details. Default FALSE
.
Name of the reduction where LIGER integration result is
stored. Default "inmf"
.
Diagnostic information include:
object$raw_which.max: The index of the factor with the maximum value in the raw factor loading.
object$R_which.max: The index of the factor with the maximum value in the soft clustering probability matrix used for correction.
object$Z_which.max: The index of the factor with the maximum value in the aligned factor loading.
pbmc <- centroidAlign(pbmcPlot)
Run the code above in your browser using DataLab