Generate complicated differentially expressed gene (DEG) pattern to simulate varied degree of heterogeneity.
make_DEG_pattern(
n.genes,
n.samples,
fold.change = 2,
gene.rate = 0.3,
sample.rate = 1,
active.rate = 1,
up.rate = 0.5
)
The total number of genes in the simulated data.
The total number of samples in the simulated data.
The fold change level of DEGs.
The proportion of DEGs to all genes.
The proportion of abnormal samples to all samples.
The probability that a DEG is truely differentially expressed in an abnormal sample.
The proportion of up-regulated DEGs to all DEGs.
This function will return a list with the following components:
The matrix of simulated fold changes. Each row represents a gene and each column represents a sample.
The vector of gene status: 1 for up-regulated, -1 for down-regulated, and 0 for normal genes.
The vector of sample status: 1 for abnormal, and 0 for normal samples.
The heterogeneity of gene expression pattern is mainly controlled by
two parameters: sample.rate
and active.rate
. If both
parameters are equal to 1, the gene expression pattern will be homogeneous,
otherwise heterogeneous.