generate: Generate data from regularized models.

View source: R/generate.R

generateR Documentation

Generate data from regularized models.

Description

Generate data from regularized models. This generates data from the background, i.e. no residuals are added to the simulated data. The cell attributes for the generated cells are sampled from the input with replacement.

Usage

generate(
  vst_out,
  genes = rownames(vst_out$model_pars_fit),
  cell_attr = vst_out$cell_attr,
  n_cells = nrow(cell_attr)
)

Arguments

vst_out

A list that provides model parameters and optionally meta data; use output of vst function

genes

The gene names for which to generate data; default is rownames(vst_out$model_pars_fit)

cell_attr

Provide cell meta data holding latent data info; default is vst_out$cell_attr

n_cells

Number of cells to generate; default is nrow(cell_attr)

Value

Generated data as dgCMatrix

Examples


vst_out <- vst(pbmc, return_cell_attr = TRUE)
generated_data <- generate(vst_out)



sctransform documentation built on Oct. 19, 2023, 9:08 a.m.