Learn R Programming

cellGeometry (version 0.5.7)

generate_samples: Generate random cell number samples

Description

Used for simulating pseudo-bulk RNA-Seq from a 'cellMarkers' object. Cell counts are randomly sampled from the uniform distribution, using the original subclass contingency table as a limit on the maximum number of cells in each subclass.

Usage

generate_samples(
  object,
  n,
  equal_sample = TRUE,
  method = c("unif", "dirichlet"),
  alpha = 1.5
)

Value

An integer matrix with n rows, with columns for each cell subclasses in object, representing cell counts for each cell subclass. Designed to be passed to simulate_bulk().

Arguments

object

A 'cellMarkers' class object

n

Integer value for the number of samples to generate

equal_sample

Logical whether to sample subclasses equally or generate samples with proportions of cells in keeping with the original subtotal of cells in the main scRNA-Seq data.

method

Either "unif" or "dirichlet" to specify whether cell numbers are drawn from uniform distribution or dirichlet distribution.

alpha

Shape parameter for gtools::rdirichlet(). Automatically expanded to be a vector whose length is the number of subclasses.

Details

Leaving equal_sample = TRUE is better for tuning deconvolution parameters.

See Also

simulate_bulk()