ruvSimulate: Simulate a simple matrix or SingleCellExperiment to test...

Description Usage Arguments Value Examples

View source: R/ruvSimulate.R

Description

This function is designed to generate Poisson-random-variable data matrix to test on the internal algorithms of scMerge. It does not represent real biological situations and it is not intended to be used by end-users.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ruvSimulate(
  m = 100,
  n = 5000,
  nc = floor(n/2),
  nCelltypes = 3,
  nBatch = 2,
  k = 20,
  lambda = 0.1,
  sce = FALSE
)

Arguments

m

Number of observations

n

Number of features

nc

Number of negative controls

nCelltypes

Number of cell-types

nBatch

Number of batches

k

Number of unwanted factors in simulation

lambda

Rate parameter for random Poisson generation

sce

If TRUE, returns a SingleCellExperiment object

Value

If sce is FALSE, then the output is a list consists of

if sce is TRUE, a SingleCellExperiment wrapper will be applied on all above simulated objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
set.seed(1)
L = ruvSimulate(m = 200, n = 1000, nc = 200, 
nCelltypes = 3, nBatch = 2, lambda = 0.1, k = 10, sce = TRUE)
print(L)
example <- scMerge(sce_combine = L,
                      ctl = paste0('gene', 1:500),
                      cell_type = L$cellTypes,
                      ruvK = 10,
                      assay_name = 'scMerge')
L = scater::runPCA(L, exprs_values = "logcounts")                      
scater::plotPCA(L, colour_by = 'cellTypes', shape = 'batch')

example = scater::runPCA(example, exprs_values = 'scMerge')                                       
scater::plotPCA(example, colour_by = 'cellTypes', shape = 'batch')

scMerge documentation built on Nov. 8, 2020, 7:04 p.m.