BASiCS_Sim: Generates synthetic data according to the model implemented...

Description Usage Arguments Value Author(s) References Examples

View source: R/BASiCS_Sim.R

Description

BASiCS_Sim creates a simulated dataset from the model implemented in BASiCS.

Usage

1
BASiCS_Sim(Mu, Mu_spikes = NULL, Delta, Phi = NULL, S, Theta, BatchInfo = NULL)

Arguments

Mu

Gene-specific mean expression parameters μ_i for all biological genes (vector of length q.bio, all elements must be positive numbers)

Mu_spikes

μ_i for all technical genes defined as true input molecules (vector of length q-q.bio, all elements must be positive numbers). If Mu_spikes = NULL, the generated data will not contain spike-ins. If Phi = NULL, Mu_spikes will be ignored. Default: Mu_spikes = NULL.

Delta

Gene-specific biological over-dispersion parameters δ_i, biological genes only (vector of length q.bio, all elements must be positive numbers)

Phi

Cell-specific mRNA content normalising parameters φ_j (vector of length n, all elements must be positive numbers and the sum of its elements must be equal to n). Phi must be set equal to NULL when generating data without spike-ins. If Mu_spikes = NULL, Phi will be ignored. Default: Phi = NULL

S

Cell-specific technical normalising parameters s_j (vector of length n, all elements must be positive numbers)

Theta

Technical variability parameter θ (must be positive). Theta can be a scalar (single batch of samples), or a vector (multiple batches of samples). If a value for BatchInfo is provided, the length of Theta must match the number of unique values in BatchInfo.

BatchInfo

Vector detailing which batch each cell should be simulated from. If spike-ins are not in use, the number of unique values contained in BatchInfo must be larger than 1 (i.e. multiple batches are present).

Value

An object of class SingleCellExperiment, including synthetic data generated by the model implemented in BASiCS.

Author(s)

Catalina A. Vallejos cnvallej@uc.cl, Nils Eling

References

Vallejos, Marioni and Richardson (2015). PLoS Computational Biology.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Simulated parameter values for 10 genes
# (7 biogical and 3 spike-in) measured in 5 cells
Mu <- c(8.36, 10.65, 4.88, 6.29, 21.72, 12.93, 30.19)
Mu_spikes <-  c(1010.72, 7.90, 31.59)
Delta <- c(1.29, 0.88, 1.51, 1.49, 0.54, 0.40, 0.85)
Phi <- c(1.00, 1.06, 1.09, 1.05, 0.80)
S <- c(0.38, 0.40, 0.38, 0.39, 0.34)
Theta <- 0.39

# Data with spike-ins, single batch
Data <- BASiCS_Sim(Mu, Mu_spikes, Delta, Phi, S, Theta)
head(SingleCellExperiment::counts(Data))
dim(SingleCellExperiment::counts(Data))
altExp(Data)
rowData(altExp(Data))

# Data with spike-ins, multiple batches
BatchInfo <- c(1,1,1,2,2)
Theta2 <- rep(Theta, times = 2)
Data <- BASiCS_Sim(Mu, Mu_spikes, Delta, Phi, S, Theta2, BatchInfo)

# Data without spike-ins, multiple batches
Data <- BASiCS_Sim(Mu, Mu_spikes = NULL, Delta, 
                   Phi = NULL, S, Theta2, BatchInfo)

BASiCS documentation built on April 16, 2021, 6 p.m.