Learn R Programming

Seurat (version 5.0.3)

SketchData: Sketch Data

Description

This function uses sketching methods to downsample high-dimensional single-cell RNA expression data, which can help with scalability for large datasets.

Usage

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,
  ...
)

Value

A Seurat object with the sketched data added as a new assay.

Arguments

object

A Seurat object.

assay

Assay name. Default is NULL, in which case the default assay of the object is used.

ncells

A positive integer indicating the number of cells to sample for the sketching. Default is 5000.

sketched.assay

Sketched assay name. A sketch assay is created or overwrite with the sketch data. Default is 'sketch'.

method

Sketching method to use. Can be 'LeverageScore' or 'Uniform'. Default is 'LeverageScore'.

var.name

A metadata column name to store the leverage scores. Default is 'leverage.score'.

over.write

whether to overwrite existing column in the metadata. Default is FALSE.

seed

A positive integer for the seed of the random number generator. Default is 123.

cast

The type to cast the resulting assay to. Default is 'dgCMatrix'.

verbose

Print progress and diagnostic messages

...

Arguments passed to other methods