build_example {DArand}R Documentation

Simulation of gene expressions using independant negative binomials

Description

Simulation of gene expressions using independant negative binomials

Usage

build_example(
  m = 500,
  m1,
  n1 = 6,
  n2 = n1,
  fold = 100,
  mu0 = 100,
  use.scales = FALSE,
  nb.size = Inf
)

Arguments

m

number of genes

m1

number of differentially expressed genes. In the expression matrix, m1 first columns contain differentially expressed genes.

n1

number of samples under the first condition. The first n1 rows in the expression matrix.

n2

number of samples under the second condition (default n2=n1)

fold

maximal fold change added to the first m1 genes. The fold decreases proportionally to 1/sqrt(1:m1).

mu0

mean relative expression

use.scales

if TRUE random scales are used, otherwise all scales are set to 1.

nb.size

number of successful trials in the negative binomial distribution. If nb.size is set to Inf (default), the Poisson model is used.

Details

The function generates a list, of which the first element X is a matrix of n1+n2 and m dimension with simulated expressions under Poisson or Negative Binomial distribution. Lines 1:n1 correspond to the first condition (or sub-group) and lines (n1+1):(n1+n2) to the second one. Columns 1:m1 contain counts imitating differential expressions.

In the ideal situation there is no microscopical variability between samples and all scales (so-called scaling factors) would be the same. To simulate examples corresponding to this perfect situation, use argument use.scales=FALSE which will set all scales to 1. When use.scales=TRUE, scales are simulated under uniform distribution Unif(0.25,4).

The fold is maximal for the first expression and decreases proportionally to 1/sqrt(1:m1). The smallest fold fold/sqrt(m1) is set to the m1-th expression.

Value

A list with components

X

a two-dimensional array containing the expression table of n individuals in rows and m gene expressions in columns.

m1

number of differentially expressed genes (as in arguments).

n1

number of samples under the first condition (as in arguments).

n2

number of samples under the second condition (as in arguments).

fold

maximal fold change between the differentally expressed genes and invariant genes (as in arguments).

scales

vector of simulated scales.

mu0

mean relative expression (as in arguments).

Examples


L = build_example(m=500,m1=25,n1=6,fold=20,mu0=100,use.scales=FALSE,nb.size=Inf)

[Package DArand version 0.0.1.2 Index]