centroidAlign | R Documentation |
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 class 'liger'
centroidAlign(
object,
lambda = 1,
useDims = NULL,
scaleEmb = TRUE,
centerEmb = TRUE,
scaleCluster = FALSE,
centerCluster = FALSE,
shift = FALSE,
diagnosis = FALSE,
...
)
## S3 method for class 'Seurat'
centroidAlign(
object,
reduction = "inmf",
lambda = 1,
useDims = NULL,
scaleEmb = TRUE,
centerEmb = TRUE,
scaleCluster = FALSE,
centerCluster = FALSE,
shift = FALSE,
diagnosis = FALSE,
...
)
object |
A liger or Seurat object with valid factorization
result available (i.e. |
... |
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 |
useDims |
Indices of factors to use considered for the alignment.
Default |
scaleEmb |
Logical, whether to scale the factor loading being considered
as the embedding. Default |
centerEmb |
Logical, whether to center the factor loading being
considered as the embedding before scaling it. Default |
scaleCluster |
Logical, whether to scale the factor loading being
considered as the cluster assignment probability. Default |
centerCluster |
Logical, whether to center the factor loading being
considered as the cluster assignment probability before scaling it. Default
|
shift |
Logical, whether to shift the factor loading being considered as
the cluster assignment probability after centered scaling. Default
|
diagnosis |
Logical, whether to return cell metadata variables with
diagnostic information. See Details. Default |
reduction |
Name of the reduction where LIGER integration result is
stored. Default |
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.
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
.
pbmc <- centroidAlign(pbmcPlot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.