Code for simulating gene expression data set, D, with N genes by M subjects with co-expression based on a scale-free or other degree distribution (additional details for step 2 in Figure
). The input adjacency matrix A specifies the gene-gene correlation structure (from step 1 of Figure 1), and the variable “noise” determines the strength of the correlation. The data set is initially random Gaussian, and then a loop sets a gene’s expression proportional to another gene if they are connected according to the adjacency matrix and if the gene has not been already modified. In a subsequent step (step 3 in Figure 1), differential co-expression is added between cases and controls.