subsample_scExp: Subsample scExp

Description Usage Arguments Value Examples

View source: R/preprocessing_filtering_reduction.R

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

1
subsample_scExp(scExp, n_cells = 500)

Arguments

scExp

A SingleCellExperiment

n_cells

An integer number of cells to subsample for each sample (500)

Value

A subsampled SingleCellExperiment

Examples

1
2
3
scExp = create_scExp(create_scDataset_raw()$mat,create_scDataset_raw()$annot)
scExp_sub = subsample_scExp(scExp,50)
## Not run: num_cell_scExp(scExp_sub)

ChromSCape documentation built on Nov. 8, 2020, 6:57 p.m.