simulateY: Simulate various type of data

Description Usage Arguments Details Value Examples

View source: R/simulateData.R

Description

simulateY

Usage

1
2
3
4
5
6
7
8
9
simulateY(
  nclust = 4,
  n_byClust = 20,
  J,
  prop = 0.01,
  noise = 0.1,
  flavor = c("normal", "beta", "binary"),
  params = list(c(mean = 1, sd = 1))
)

Arguments

nclust

A numeric value specifying the number of cluster (integer)

n_byClust

A list or numeric value specifying the number of patients by cluster (if only one value is specify groups contain the same number of patients)

J

A numeric value specifying the number of total biomarkers

prop

A numeric value specifying the proportion of informative biomarkers for each cluster

noise

A numeric value specifying the noise for back ground distribution

flavor

A character value specifying the distribution of simulations Defaults to "normal". See Details

params

A list of the parameters for flavor (See Details)

Details

The observations are simulated as follows according to the value of argument 'flavor':

If flavor=="normal" (the default), the observations follow a normal distribution (specify in params the mean and the standard deviance for each cluster. params is a list of vector list(c(mean, sd)). If the length is one we consider that parameters are the same for all groups, else the length of the list needs to be of length nclust

If flavor=="beta", the observations follow a beta distribution (methylation data).

If flavor=="binary", the observations follow a bernoulli (0 or 1) distribution (specify in params the proportion of 1). For example to simulate mutations params is a list of vector list(c(p)). If the length is one we consider that parameters are the same for all groups, else the length of the list needs to be of length nclust

Value

A list with two components:

data

A nclust*n_byclust x J matrix

,

positive

the features that drives clusters

Examples

1
2
3
4
5
6
7
8
c <- simulateY(J=100, prop=0.1)
heatmap(c$data, scale="none")
c_bin <- simulateY(J=100, flavor="binary",
params=list(c(p=0.7)), prop=0.1, noise=0.1)
heatmap(c_bin$data, scale="none")
c_beta <- simulateY(J=400, flavor="beta",
params=list(c(mean1=-3,mean2=3, sd1=0.1, sd2=0.2) ), prop=0.3, noise=1)
heatmap(c_beta$data[,unlist(c_beta$positive)], scale="none")

CNRGH/crimmix documentation built on Dec. 11, 2019, 5:27 a.m.