sample_cells: Downsample cells from each cluster

View source: R/util.R

sample_cellsR Documentation

Downsample cells from each cluster

Description

Downsample cells from each cluster

Usage

sample_cells(cl, sample.size, weights = NULL, seed = NULL)

Arguments

cl

A cluster factor object

sample.size

A maximum number of cells to take from each cluster, or a named numeric object with the number of cells to be sampled and names matching cluster levels

weights

A named numeric vector with weights for each cell, passed to the prob parameter of the sample() function. Default is NULL.

seed

A seed value for random sampling. If NULL (default), will be randomized.

Value

A cluster factor object containing sampled cells


AllenInstitute/scrattch.hicat documentation built on Oct. 20, 2023, 6:55 a.m.