Downsample number of cells in Seurat object by specified factor

downsampleSeurat(
  object,
  subsample.factor = 1,
  subsample.n = NULL,
  sample.group = NULL,
  min.group.size = 500,
  seed = 1023,
  verbose = T
)

Arguments

object

Seurat Object

subsample.factor

Numeric [0,1]. Factor to downsample data by.

subsample.n

Numeric [1,ncol(object)]. Number of cells to subsample. If specified, overides subsample.factor.

sample.group

Character. Meta data grouping variable in which min.group.size will be enforced.

min.group.size

Numeric [1,ncol(object)]. Minimum number of cells to downsample to within sample.group. If there are insufficient cells to achieve the target min.group.size, only the available cells are retained.

seed

seed for sampling. Default is 1023.

verbose

Print progress. Default is TRUE.

Value

Seurat Object

Author

Nicholas Mikolajewicz