Sim2: Second type of simulation scheme designed in 'superdelta2'...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/SimuFunctions.R

Description

This function is developed based on R's rnbinom() function. mus = list(mu1, mu2, mu3) are the vectors of mean log-counts in the three groups. ns = c(n1, n2, n3) are the sample sizes in the three groups. kappa and a are two shape parameters in the NBP model. l and u are the lower and upper bounds (uniform distribution) of simulated sample specific noise.

Usage

1
  Sim2(mus, ns, kappa, a, l, u)

Arguments

mus

mus = list(mu1, mu2, mu3) are the log-mean parameter vectors of the three groups respectively.

ns

ns = c(n1, n2, n3) are the sample sizes of the three groups respectively.

kappa

The first shape parameter.

a

The second shape parameter.

l

Lower bound of uniform distribution of simulated sample specific noise alpha_j.

u

Upper bound of uniform distribution of simulated sample specific noise alpha_j.

Details

An NBP distribution is an integer-valued distribution with three parameters, the location parameter mu, and two shape parameters kappa and a. The mean and variance of X ~ NBP(mu, kappa, a) are: E(X) = mu Var(X) = mu + mu*kappa^a Note that the NBP distribution describes a nonlinear relationship between the mean and variance of genes. Other technical details of the NBP distribution, such as the probability density function and its relationship with the negative binomial (NB) distribution are not covered here.

Value

This function returns a list with the following objects:

counts

A count matrix simulated by the scheme discussed above.

alphas

Simulated sample specific noise alpha_j added to each sample/library.

Author(s)

Yuhang Liu, Xing Qiu, Jinfeng Zhang, and Zihan Cui

See Also

SIM1, SIM2, SIM3

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  ## The code block below generates sample data \code{SIM2}.
  ngenes <- 5000; n1 <- n2 <- n3 <- 50; ns <- c(n1,n2,n3)
  mu1 <- mu2 <- mu3 <- rep(log2(100), ngenes)
  mu2[1:600] <- log2(150); mu3[401:1000] <- log2(75)
  mus <- list(mu1, mu2, mu3)
  set.seed(2020)
  mod2 <- Sim2(mus, ns, kappa = 0.06, a = 2.2, l = 12, u = 30)
  SIM2 <- mod2$counts; alphas <- mod2$alphas
  
  ## The code block below generates sample data \code{SIM3}.
  ngenes <- 5000; n1 <- n2 <- n3 <- 50; ns <- c(n1,n2,n3)
  mu1 <- mu2 <- mu3 <- rep(log2(100), ngenes)
  mu2[1:600] <- log2(150); mu3[401:1000] <- log2(50)
  mus <- list(mu1, mu2, mu3)
  set.seed(2020)
  mod3 <- Sim2(mus, ns, kappa = 0.6, a = 2, l = 10, u = 20)
  SIM3 <- mod3$counts; alphas <- mod3$alphas

fhlsjs/superdelta2 documentation built on Sept. 15, 2020, 12:03 a.m.