generate: Generate data from regularized models.

Description Usage Arguments Value Examples

View source: R/generate.R

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

1
2
3
4
5
6
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

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

sctransform documentation built on Jan. 13, 2021, 10:48 p.m.