downsampleSeurat: Downsample single cell data

View source: R/utility_functions.R

downsampleSeuratR Documentation

Downsample single cell data

Description

Downsample number of cells in Seurat object by specified factor

Usage

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(s)

Nicholas Mikolajewicz


NMikolajewicz/scMiko documentation built on June 28, 2023, 1:41 p.m.