if (FALSE) {
# Simulate replicated time-course gene expression profiles
# from OU processes
# Simulation parameters
times = c(0,5,10,15,20,25,30,35,40,50,60,70,80,90,100,110,120,150)
ntime=length (times)
nrep=4
nclust = 6
npars = 8
pars.mtx = matrix (0, nrow=nclust, ncol=npars)
# late weak upregulation or downregulation
pars.mtx[1,] = c(0.05, 0.1, 0.5, 0, 0.16, 0.1, 0.4, 0.05)
# repression
pars.mtx[2,] = c(0.05, 0.1, 0.5, 1, 0.16, -1.0, 0.1, 0.05)
# early strong upregulation
pars.mtx[3,] = c(0.05, 0.5, 0.2, 0, 0.16, 2.5, 0.4, 0.15)
# strong repression
pars.mtx[4,] = c(0.05, 0.5, 0.2, 1, 0.16, -1.5, 0.4, 0.1)
# low upregulation
pars.mtx[5,] = c(0.05, 0.3, 0.3, -0.5, 0.16, 0.5, 0.2, 0.08)
# late strong upregulation
pars.mtx[6,] = c(0.05, 0.3, 0.3, -0.5, 0.16, 0.1, 1, 0.1)
nsize = rep(40, nclust)
# Generate data
simudata = simuDataREM (pars=pars.mtx, dt=1, T=150,
ntime=ntime, nrep=nrep, nsize=nsize, times=times, method="svd", model="OU")
# Display simulated data
plotSimulation (simudata, times=times,
nsize=nsize, nrep=nrep, lty=1, ylim=c(-4,4), type="l", col="black")
# Write simulation parameters and simulated data
# to external files
outputData (datafilename= "simu_test.dat", parfilename= "simu_test.par",
meanfilename= "simu_test_mean.dat", simudata=simudata, pars=pars.mtx,
nitem=sum(nsize), ntime=ntime, nrep=nrep)
}
Run the code above in your browser using DataLab