downsampleSCE: Down-sampling an SCE object

View source: R/downsampleSCE.R

downsampleSCER Documentation

Down-sampling an SCE object

Description

downsampleSCE down-samples an SCE object based on the grouping variables provided. For example, when grouped by a batch variable, the function takes maxN cells per batch. Additionally, when indiv_by is provided (e.g., file_name), the function takes equal numbers of cells per individual, collecting maxN cells in total per batch.

Usage

downsampleSCE(
  sce,
  maxN = 10000,
  group_by = c("batch", "group"),
  indiv_by = NULL,
  seed = 12345
)

Arguments

sce

A SingleCellExperiment object.

maxN

Numeric. Specifies the maximum number of unique cells per group.

group_by

A character vector. Specifies the colData columns for grouping.

indiv_by

A character string. Specifies the colData column for individual sample identifiers.

seed

Numeric. Sets a random seed.

Value

A SingleCellExperiment-class object.


casanova-lab/iMUBAC documentation built on Sept. 13, 2022, 6:36 p.m.