Learn R Programming

WGCNA (version 1.61)

simulateSmallLayer: Simulate small modules

Description

This function simulates a set of small modules. The primary purpose is to add a submodule structure to the main module structure simulated by simulateDatExpr.

Usage

simulateSmallLayer(
  order, 
  nSamples, 
  minCor = 0.3, maxCor = 0.5, corPower = 1, 
  averageModuleSize, 
  averageExpr, 
  moduleSpacing, 
  verbose = 4, indent = 0)

Arguments

order

a vector giving the simulation order for vectors. See details.

nSamples

integer giving the number of samples to be simulated.

minCor

a multiple of maxCor (see below) giving the minimum correlation of module genes with the corresponding eigengene. See details.

maxCor

maximum correlation of module genes with the corresponding eigengene. See details.

corPower

controls the dropoff of gene-eigengene correlation. See details.

averageModuleSize

average number of genes in a module. See details.

averageExpr

average strength of module expression vectors.

moduleSpacing

a number giving module spacing: this multiple of the module size will lie between the module and the next one.

verbose

integer level of verbosity. Zero means silent, higher values make the output progressively more and more verbose.

indent

indentation for diagnostic messages. Zero means no indentation, each unit adds two spaces.

Value

A matrix of simulated gene expressions, with dimension (nSamples, length(order)).

Details

Module eigenvectors are chosen randomly and independently. Module sizes are chosen randomly from an exponential distribution with mean equal averageModuleSize. Two thirds of genes in each module are simulated as proper module genes and one third as near-module genes (see simulateModule for details). Between each successive pairs of modules a number of genes given by moduleSpacing will be left unsimulated (zero expression). Module expression, that is the expected standard deviation of the module expression vectors, is chosen randomly from an exponential distribution with mean equal averageExpr. The expression profiles are chosen such that their correlations with the eigengene run from just below maxCor to minCor * maxCor (hence minCor must be between 0 and 1, not including the bounds). The parameter corPower can be chosen to control the behaviour of the simulated correlation with the gene index; values higher than 1 will result in the correlation approaching minCor * maxCor faster and lower than 1 slower.

The simulated genes will be returned in the order given in order.

See Also

simulateModule for simulation of individual modules;

simulateDatExpr for the main gene expression simulation function.