\HeaderA{findSigLevelFdr}{This function has not been properly implemented yet}{findSigLevelFdr}
\keyword{manip}{findSigLevelFdr}
\begin{Description}\relax
Method to find the cutoff at which gains and losses are considered significant using permutations
\end{Description}
\begin{Usage}
\begin{verbatim}
findSigLevelFdr(data, observedSpm, n = 1, fdrTarget=0.05, maxmem=1000)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{data}] aCGH data in the same format as used for 'calcSpm' 
\item[\code{observedSpm}] A sample point matrix as produced by 'calcSpm'
\item[\code{n}] Number of permutations 
\item[\code{fdrTarget}] Target False Discovery Rate (FDR) 
\item[\code{maxmem}] This parameter controls memory usage, set to lower value to lower memory consumption 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The number of permutations needed for reliable results depends on the data and can not be determined beforehand. As a general rule-of-thumb around 100 permutations should be used for 'quick checks'
and around 2000 permutations for more rigorous testing. 
The FDR method is less conservatie than the p-value based approach since instead of controlling the family wise error rate (FWER, P(false positive > 1)) it controls the false
discovery rate (FDR) (false positives / total number of called data points).
\end{Details}
\begin{Value}
A list with the cutoffs corresponding to the given FDR

\begin{ldescription}
\item[\code{pos }] The cutoff for the gains
\item[\code{neg }] The cutoff for the losses'
\end{ldescription}
\end{Value}
\begin{Author}\relax
Jorma de Ronde
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{plotScaleSpace}{plotScaleSpace}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(hsSampleData)
data(hsMirrorLocs)

spm1mb <- calcSpm(hsSampleData, hsMirrorLocs)

sigLevel1mb <- findSigLevelTrad(hsSampleData, spm1mb, n=3)

plot(spm1mb, sigLevels=sigLevel1mb)
plotScaleSpace(list(spm1mb), list(sigLevel1mb), type='g')
\end{ExampleCode}
\end{Examples}

