simGen: Generate Simulated Data of Two-Condition Gaussian

Description Usage Arguments Value Author(s) Examples

View source: R/simGen.R

Description

This function generates multivariate Gaussian distributed data under case/control conditions. The basic assumption is that for each type, the mean has a shift while the variance keeps the same cross conditions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
simGen(
  n,
  n.feature,
  n.group,
  type.prop,
  con.prop = 0.5,
  mu.mat,
  sigma.mat,
  delta.mat
)

Arguments

n

The sample size of simulated data (cells)

n.feature

Number of features (genes)

n.group

Number of underlying groups (cell types)

type.prop

A vector of same length as n.group. The proportion of each group.

con.prop

Proportion of condition 1. Default is 0.5.

mu.mat

A matrix which is n.feature by n.group. Define the mean parameter of multivariate Gaussian in condition 1.

sigma.mat

A matrix which is n.feature by n.group. Define the standard deviation parameter of multivariate Gaussian.

delta.mat

A matrix which is n.feature by n.group. Define the shift of mean of multivariate Gaussian.

Value

A list which contains the data, the group type and the condition. ## y The feature of each data point ## z The group type of each data point ## g The condtion (condition1 / condition 2) of each data point

Author(s)

Dongyuan Song

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
mu1 <- c(5, 7, 9)
theta1 <- c(1, 2, 0)
sigma1 <- c(1, 2, 3)
mu2 <- c(10, 15, 4)
theta2 <- c(1, 2, 6)
sigma2 <- c(0.4, 0.2, 0.4)
mu.mat <- cbind(mu1, mu2)
delta.mat <- cbind(theta1, theta2)
sigma.mat <- cbind(sigma1, sigma2)
dat <- simGen(n = 100, n.feature = 2, n.group = 3, type.prop = c(0.2, 0.3, 0.5),
mu.mat = mu.mat, sigma.mat = sigma.mat, delta.mat = delta.mat)

SONGDONGYUAN1994/tcgmm documentation built on July 31, 2020, 9:18 p.m.