This function scales normalized gene expression data after variable genes have been selected. We do not mean-center the data before scaling in order to address the non-negativity constraint of NMF. Computation applied to each normalized dataset matrix can form the following equation:
$$S_{i,j}=\frac{N_{i,j}}{\sqrt{\sum_{p}^{n}\frac{N_{i,p}^2}{n-1}}}$$
Where \(N\) denotes the normalized matrix for an individual dataset, \(S\) is the output scaled matrix for this dataset, and \(n\) is the number of cells in this dataset. \(i, j\) denotes the specific gene and cell index, and \(p\) is the cell iterator.
Please see detailed section below for explanation on methylation dataset.
scaleNotCenter(object, ...)# S3 method for dgCMatrix
scaleNotCenter(object, ...)
# S3 method for ligerDataset
scaleNotCenter(
object,
features = NULL,
chunk = 1000,
verbose = getOption("ligerVerbose", TRUE),
...
)
# S3 method for ligerMethDataset
scaleNotCenter(
object,
features = NULL,
verbose = getOption("ligerVerbose", TRUE),
...
)
# S3 method for liger
scaleNotCenter(
object,
useDatasets = NULL,
features = varFeatures(object),
verbose = getOption("ligerVerbose", TRUE),
remove.missing = NULL,
...
)
# S3 method for Seurat
scaleNotCenter(
object,
assay = NULL,
layer = "ligerNormData",
save = "ligerScaleData",
datasetVar = "orig.ident",
features = NULL,
...
)
Updated object
dgCMatrix method - Returns scaled dgCMatrix object
ligerDataset method - Updates the scaleData
and
scaledUnsharedData
(if unshared variable feature available) slot
of the object
liger method - Updates the scaleData
and
scaledUnsharedData
(if unshared variable feature available) slot
of chosen datasets
Seurat method - Adds a named layer in chosen assay (V5), or update the
scale.data
slot of the chosen assay (<=V4)
liger object, ligerDataset object, dgCMatrix, or a Seurat object.
Arguments passed to other methods. The order goes by: "liger" method calls "ligerDataset" method", which then calls "dgCMatrix" method. "Seurat" method directly calls "dgCMatrix" method.
Character, numeric or logical index that choose the variable
feature to be scaled. "liger" method by default uses
varFeatures(object)
. "ligerDataset" method by default uses all
features. "Seurat" method by default uses
Seurat::VariableFeatures(object)
.
Integer. Number of maximum number of cells in each chunk, when
scaling is applied to any HDF5 based dataset. Default 1000
.
Logical. Whether to show information of the progress. Default
getOption("ligerVerbose")
or TRUE
if users have not set.
A character vector of the names, a numeric or logical
vector of the index of the datasets to be scaled but not centered. Default
NULL
applies to all datasets.
Deprecated. The functionality of this is covered through other parts of the whole workflow and is no long needed. Will be ignored if specified.
Name of assay to use. Default NULL
uses current active
assay.
For Seurat>=4.9.9, the name of layer to retrieve normalized
data. Default "ligerNormData"
. For older Seurat, always retrieve from
data
slot.
For Seurat>=4.9.9, the name of layer to store normalized data.
Default "ligerScaleData"
. For older Seurat, stored to
scale.data
slot.
Metadata variable name that stores the dataset source
annotation. Default "orig.ident"
.
Because gene body mCH proportions are negatively correlated with gene
expression level in neurons, we need to reverse the direction of the
methylation data before performing the integration. We do this by simply
subtracting all values from the maximum methylation value. The resulting
values are positively correlated with gene expression. This will only be
applied to variable genes detected in prior. Please make sure that argument
modal
is set accordingly when running createLiger
. In
this way, this function can automatically detect it and take proper action.
If it is not set, users can still manually have the equivalent processing
done by doing scaleNotCenter(lig, useDataset = c("other", "datasets"))
,
and then reverseMethData(lig, useDataset = c("meth", "datasets"))
.
pbmc <- normalize(pbmc)
pbmc <- selectGenes(pbmc)
pbmc <- scaleNotCenter(pbmc)
Run the code above in your browser using DataLab