\HeaderA{getSigSegments}{Retrieve the significantly gained and lost regions including the corresponding, original probes}{getSigSegments}
\keyword{manip}{getSigSegments}
\begin{Description}\relax
Retrieve the significantly gained and lost regions including the corresponding, original probes. A significance level must be selected by the user.
\end{Description}
\begin{Usage}
\begin{verbatim}
getSigSegments(spm, sigLevels, chromosomes=NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{spm}] The sample point matrix to be plotted 
\item[\code{sigLevels}] The significance thresholds to be used
\item[\code{chromosomes}] Takes a vector of chromosomes to be plotted. Defaults to all chromosomes. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
'sigLevels' should contain the significance thresholds in a list with the positive (gains) threshold in the 'pos' element and the negative (losses) threshold in the 'neg' element.
This is the format as returned by 'findSigLevelTrad' and 'findSigLevelFdr'.
\end{Details}
\begin{Value}
Returns a sigSegments object containing the chromosome, start position, end position, average KC score and the mode of the KC score in that region of all segments passing the thresholds as set in 'sigLevels'. 
Additionally, returns the IDs and indices of the probes and the positions in the sample point matrix within the significant regions.
The results are stored in two separate slots: 'gains' for gains and 'losses' for losses.
Use 'write.table' to save the results to file.
\end{Value}
\begin{Author}\relax
Jorma de Ronde
\end{Author}
\begin{References}\relax
~put references to the literature/web site here ~
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{findSigLevelTrad}{findSigLevelTrad}},  \code{\LinkA{findSigLevelTrad}{findSigLevelTrad}}, \code{\LinkA{write.table}{write.table}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(hsSampleData)
data(hsMirrorLocs)

spm1mb <- calcSpm(hsSampleData, hsMirrorLocs)

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

sigSegments1mb <- getSigSegments(spm1mb, siglevel1mb)
write.table(sigSegments1mb, file=file.path(tempdir(),'sigSegments1mb.txt'))

\end{ExampleCode}
\end{Examples}

