This function is a wrapper to switch between alternative factor loading alignment methods that LIGER provides, which is a required step for producing the final integrated result. Two methods are provided (click on options for more details):
alignFactors(object, method = c("quantileNorm", "centroidAlign"), ...)# S3 method for liger
alignFactors(object, method = c("quantileNorm", "centroidAlign"), ...)
# S3 method for Seurat
alignFactors(object, method = c("quantileNorm", "centroidAlign"), ...)
A liger or Seurat object with valid factorization
result available (i.e. runIntegration
performed in advance).
Character, method to align factors. Default
"centroidAlign"
. Optionally "quantileNorm"
.
Additional arguments passed to selected methods.
For "quantileNorm"
:
quantiles
Number of quantiles to use for quantile
normalization. Default 50
.
reference
Character, numeric or logical selection of one
dataset, out of all available datasets in object
, to use as a
"reference" for quantile normalization. Default NULL
tries to find
an RNA dataset with the largest number of cells; if no RNA dataset
available, use the globally largest dataset.
minCells
Minimum number of cells to consider a cluster
shared across datasets. Default 20
.
nNeighbors
Number of nearest neighbors for within-dataset
knn graph. Default 20
.
useDims
Indices of factors to use for shared nearest factor
determination. Default NULL
uses all factors.
center
Whether to center the data when scaling factors.
Could be useful for less sparse modalities like methylation data.
Default FALSE
.
maxSample
Maximum number of cells used for quantile
normalization of each cluster and factor. Default 1000
.
eps
The error bound of the nearest neighbor search. Lower
values give more accurate nearest neighbor graphs but take much longer to
compute. Default 0.9
.
refineKNN
Whether to increase robustness of cluster
assignments using KNN graph. Default TRUE
.
clusterName
Variable name that will store the clustering
result in metadata of a liger object or a Seurat
object. Default "quantileNorm_cluster"
.
seed
Random seed to allow reproducible results. Default
1
.
verbose
Logical. Whether to show information of the
progress. Default getOption("ligerVerbose")
or TRUE
if
users have not set.
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. Default FALSE
.
quantileNorm
, centroidAlign