The function simulate two vectors of pvalues using the procedure described in Hwang et al. for independent experiments
1 2  simulation.indep(n, GammaA = 2, GammaB = 2, epsilonM = 0,
epsilonSD = 1, r1, r2, DEfirst, DEsecond)

n 

GammaA 

GammaB 

epsilonM 

epsilonSD 

r1 

r2 

DEfirst 

DEsecond 

Considering two experiments (k=1,2), each of them with two classes, and n genes, for each gene we simulate a true difference between the classes delta(g), drawn from a Gamma distribution with random sign. The true difference delta(g) is 0 if the gene is not differentially expressed. We then add two normal random noise components, r[k] that act as experiment specific components and epsilon(gk), that is the geneexperiment components. The former is assigned deterministically, whilst the latter is drawn from a standard Gaussian distribution. So the log fold change (FC(gk)) is the sum of all these components for each gene and experiment. We divide the n genes in three groups: genes differentially expressed only in the first experiment, genes differentially expressed only in the second experiment and genes differentially expressed in neither experiment. There are not true positive genes (i.e. truly DE in both experiments), so we should find no genes in common using our method.
Then, as described in Hwang et al., a two tails Ttest is performed for each FC(gk) and a pvalue is generated as: P(gk) = 2 Normal cdf(absolute value (FC(gk)/r(k))) where FC(gk) is the t statistic that evaluates the differential expression between the two classes for the g gene and k experiment.
names 
Which group each simulated gene expression value belongs to 
FC1 
T statistic for the first experiment 
FC2 
T statistic for the second experiment 
Pval 
pvalues for the experiment to be compared 
Alberto Cassese, Marta Blangiardo
Hwang D, Rust A, Ramsey S, Smith J, Leslie D, Weston A, de Atauri P, Aitchison J, Hood L, Siegel A, Bolouri H (2005): A data integration methodology for system biology. PNAS 2005.
M.Blangiardo and S.Richardson (2007) Statistical tools for synthesizing lists of differentially expressed features in related experiments, Genome Biology, 8, R54.
1 2  data.indep = simulation.indep(n=500,GammaA=1,
GammaB=1,r1=0.5,r2=0.8,DEfirst=300,DEsecond=200)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.