Subsample cells in seurat object to be balanced (sample-size-wise) across conditions.

balanceSamples(object, group, balance.size = NA)

Arguments

object

Seurat Object

group

Character specifying group (i.e., metadata field) to sub-sample within.

balance.size

Numeric. Target sub sample size for each condition. If target exceeds number of available cells, only available cells are included. If unspecified, smallest-sized group is set as target (Default).

Value

Seurat object

Author

Nicholas Mikolajewicz

Examples


so.query <- balanceSamples(object = so.query, group = "Barcode")
#> Error in stopifnot(class(object) == "Seurat"): object 'so.query' not found