This function uses sketching methods to downsample high-dimensional single-cell RNA expression data, which can help with scalability for large datasets.
SketchData(
object,
assay = NULL,
ncells = 5000L,
sketched.assay = "sketch",
method = c("LeverageScore", "Uniform"),
var.name = "leverage.score",
over.write = FALSE,
seed = 123L,
cast = "dgCMatrix",
verbose = TRUE,
features = NULL,
...
)
A Seurat object with the sketched data added as a new assay.
A Seurat object.
Assay name. Default is NULL, in which case the default assay of the object is used.
A positive integer or a named vector/list specifying the number of cells to sample per layer. If a single integer is provided, the same number of cells will be sampled from each layer. Default is 5000.
Sketched assay name. A sketch assay is created or overwrite with the sketch data. Default is 'sketch'.
Sketching method to use. Can be 'LeverageScore' or 'Uniform'. Default is 'LeverageScore'.
A metadata column name to store the leverage scores. Default is 'leverage.score'.
whether to overwrite existing column in the metadata. Default is FALSE.
A positive integer for the seed of the random number generator. Default is 123.
The type to cast the resulting assay to. Default is 'dgCMatrix'.
Print progress and diagnostic messages
A character vector of feature names to include in the sketched assay.
Arguments passed to other methods