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.
Usage
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,
...
)
Arguments
- object
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.
- lambda
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
.- useDims
Indices of factors to use considered for the alignment. Default
NULL
uses all factors.- scaleEmb
Logical, whether to scale the factor loading being considered as the embedding. Default
TRUE
.- centerEmb
Logical, whether to center the factor loading being considered as the embedding before scaling it. Default
TRUE
.- scaleCluster
Logical, whether to scale the factor loading being considered as the cluster assignment probability. Default
FALSE
.- centerCluster
Logical, whether to center the factor loading being considered as the cluster assignment probability before scaling it. Default
FALSE
.- shift
Logical, whether to shift the factor loading being considered as the cluster assignment probability after centered scaling. Default
FALSE
.- diagnosis
Logical, whether to return cell metadata variables with diagnostic information. See Details. Default
FALSE
.- reduction
Name of the reduction where LIGER integration result is stored. Default
"inmf"
.
Value
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 ifdiagnosis = TRUE
.
Seurat method
Update the
reductions
slot with a newDimReduc
object containing the aligned cell factor loading.Update the metadata with diagnostic information if
diagnosis = TRUE
.
Details
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.