subsample_scExp: Subsample scExp

View source: R/preprocessing_filtering_reduction.R

subsample_scExpR Documentation

Subsample scExp

Description

Randomly sample x cells from each sample in a SingleCellExperiment to return a subsampled SingleCellExperiment with all samples having maximum n cells. If n is higher than the number of cell in a sample, this sample will not be subsampled.

Usage

subsample_scExp(scExp, n_cell_per_sample = 500, n_cell_total = NULL)

Arguments

scExp

A SingleCellExperiment

n_cell_per_sample

An integer number of cells to subsample for each sample. Exclusive with n_cells_total. (500)

n_cell_total

An integer number of cells to subsample in total. Exclusive with n_cell_per_sample (NULL).

Value

A subsampled SingleCellExperiment

Examples

raw <- create_scDataset_raw()
scExp = create_scExp(raw$mat, raw$annot)
scExp_sub = subsample_scExp(scExp,50)
## Not run: num_cell_scExp(scExp_sub)


vallotlab/ChromSCape documentation built on Oct. 15, 2023, 1:47 p.m.