\HeaderA{simulateData}{A function for simulating aCGH data and the corresponding clone layout}{simulateData}
\aliasA{generate.data}{simulateData}{generate.data}
\keyword{datasets}{simulateData}
\begin{Description}\relax
This simulation scheme operates in two stages. Initially, we simulate the layout of clones before using a modified version of the scheme developed by Willenbrock et al., 2005 to generate the $\mbox{log}_2$ ratios. For each simulated clone layout we generate 20 sets of simulated $\mbox{log}_2$ ratios from one of five templates. Additionally, we also take account of the cellularity of the test sample in our simulation.
\end{Description}
\begin{Usage}
\begin{verbatim}
simulateData(nArrays = 20, chrominfo = NULL, prb.short.tiled = 0.5,
                 prb.long.tiled = 0.5, non.tiled.lower.res = 0.9,
                 non.tiled.upper.res = 1.1, length.clone.lower = 0.05,
                 length.clone.upper = 0.2, tiled.lower.res = -0.05,
                 tiled.upper.res = 0, sd = NULL, output = FALSE,
                 prb.proportion.tiled = c(0.2, 0.2, 0.2, 0.2, 0.2),
                 zerolengthnontiled = NULL, zerolengthtiled = NULL,
                 nonzerolengthnontiled = NULL, nonzerolengthtiled =
                 NULL, seed = 1)

\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{nArrays}] The number of arrays we want to simulate 
\item[\code{chrominfo}] The information about chromosome length/centromere location to be used. Defaults to the information provided in aCGH package of Jane Fridlyand and Peter Dimitrov. 
\item[\code{prb.short.tiled}] The probability of a tiled region on the short arm of the simulated chromosome (defaults to 0.5).
\item[\code{prb.long.tiled}] The probability of a tiled region on the long arm of the simulated chromosome (defaults to 0.5).
\item[\code{non.tiled.lower.res}] The lower limit for the distance (in Mbs) between adjacent clones in non-tiled regions of the genome (defaults to 0.9Mb).
\item[\code{non.tiled.upper.res}] The upper limit for the distance (in Mbs) between adjacent clones in non-tiled regions of the genome (defaults to 1.1Mb). 
\item[\code{length.clone.lower}] The lower limit for the length (in Mbs) of a clone (this defaults to 0.05Mb). 
\item[\code{length.clone.upper}] 
\item[\code{tiled.lower.res}] The lower limit for the distance (in Mbs) between adjacent clones in tiled regions of the genome (defaults to -0.05Mb). 
\item[\code{tiled.upper.res}] The upper limit for the distance (in Mbs) between adjacent clones in tiled regions of the genome (defaults to 0Mb). 
\item[\code{sd}] The standard deviation of the simulated data in each of the states. Defaults to being randomly sampled between 0.1 and 0.2. 
\item[\code{output}] A logical variable which is TRUE if you want the output to be written to txt files in the present working directory. Defaults to FALSE. 
\item[\code{prb.proportion.tiled}] Given that an arm of a chromosome contains a tiled region this variable (which is a vector of length 5) gives the probability that 20,30,40,50 or 100\% of the chromosome is tiled. It defaults to (0.2,0.2,0.2,0.2,0.2) 
\item[\code{zerolengthnontiled}] The empirical distribution for regions of the genome which are non-tiled and contain no copy number gains or losses. Defaults to zero.length.distr.non.tiled 
\item[\code{zerolengthtiled}] The empirical distribution for regions of the genome which are tiled and contain no copy number gains or losses. Defaults to zero.length.distr.tiled 
\item[\code{nonzerolengthnontiled}] The empirical distribution for regions of the genome which are non-tiled and contain no copy number gains or losses. Defaults to non.zero.length.distr.non.tiled 
\item[\code{nonzerolengthtiled}] The empiricial distribution for regions of the genome which are tiled and contain copy number gains or losses. Defaults to non.zero.length.distr.tiled 
\item[\code{seed}] Seed value allowing simulation to be reproduced if the same seed value is set.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
For more details see the article by Marioni and Thorne published in Bioinformatics.
\end{Details}
\begin{Value}
The function returns a list containing the following elements.
\begin{ldescription}
\item[\code{clones}] Gives the start, end and midpoint of the simulated clones.
\item[\code{class.output }] A list of the true underlying state clones are assigned to for each of the twenty simulations associated with each clone layout.
\item[\code{class.matrix}] Defines the true underlying state clones are assigned to in each of the five classes
\item[\code{classes}] Which of the five class outputs has been used to simulate the $\mbox{log}_2$ ratios
\item[\code{datamatrix}] A matrix containing twenty columns each of which contains the simulated $\mbox{log}_2$ ratios associated with each of the simulations for a particular clone layout.
\item[\code{samples}] Gives information about the cellularity associated with each of the samples.
\end{ldescription}
\end{Value}
\begin{Author}\relax
John Marioni and Natalie Thorne
\end{Author}
\begin{References}\relax
See the relevant article in Bioinformatics or the following website: www.damtp.cam.ac.uk/user/jcm68
\end{References}
\begin{Examples}
\begin{ExampleCode}
\end{ExampleCode}
\end{Examples}

