\inputencoding{latin1}
\HeaderA{nem}{Spatial Classification by EM algorithm}{nem}
\methaliasA{nem.arrayCGH}{nem}{nem.arrayCGH}
\methaliasA{nem.default}{nem}{nem.default}
\keyword{spatial}{nem}
\keyword{models}{nem}
\begin{Description}\relax
The function \code{nem} computes spatial classification by EM algorithm.
\end{Description}
\begin{Usage}
\begin{verbatim}
## Default S3 method:
nem(LogRatio, Col, Row, nk=nk, beta=1, iters=2000, ...)
## S3 method for class 'arrayCGH':
nem(arrayCGH, variable, nk=5, beta=1, iters=2000, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{LogRatio}] Vector that corresponds to the values to be classified.
\item[\code{Col}] Vector of columns coordinates.
\item[\code{Row}] Vector of rows coordinates.
\item[\code{nk}] Integer value corresponding to the number classes.
\item[\code{beta}] Scale parameter for importance of spatial information. 
\item[\code{iters}] Maximum number of iterations allowed.
\item[\code{arrayCGH}] Object of class \code{\LinkA{arrayCGH}{arrayCGH}}.
\item[\code{variable}] Variable that corresponds to the values to be classified.
\item[\code{...}] \ldots
\end{ldescription}
\end{Arguments}
\begin{Value}
Either a data frame with the following added elements:
\begin{ldescription}
\item[\code{ZoneNem}] Vector of label zones.
\item[\code{ZoneNem}] Vector of label zones.
\end{ldescription}
\end{Value}
\begin{Note}\relax
People interested in tools for array-CGH analysis can
visit our web-page: \url{http://bioinfo.curie.fr}.
\end{Note}
\begin{Author}\relax
Philippe Hupé, \email{manor@curie.fr}.
\end{Author}
\begin{References}\relax
C. Ambroise, \emph{Approche probabiliste en classification automatique et contraintes de voisinage}, Ph.D. thesis, Université de Technologie de Compiègne, 1996.

C. Ambroise, M. Dang, and G. Govaert, \emph{Clustering of
spatial data by the em algorithm} in Geostatistics for Environmental
Applications, A. Soares, J. Gomez-Hernandez, and R. Froidevaux, Eds.,
pp. 493-504. Kluwer Academic Publisher, 1997.

P. Neuvial, P. Hupé, I. Brito, S. Liva, E. Manié, C. Brennetot,
A. Aurias, F. Radvanyi, and E. Barillot. \emph{Spatial normalization
of array-CGH data}. BMC Bioinformatics, 7(1):264. May 2006.
\end{References}
\begin{Examples}
\begin{ExampleCode}
data(spatial)  ## arrays with local spatial effects

## Plot of LogRatio measured on the array CGH
## Not run: 
arrayPlot(edge,"LogRatio", main="Log2-Ratio measured on the array
CGH", zlim=c(-1,1), bar="v", mediancenter=TRUE) 
## End(Not run)

## Spatial trend of the scaled log-ratios (the variable "ScaledLogRatio"
## equals to the log-ratio minus the median value of the corresponding chromosome arm) 
edgeTrend <- arrayTrend(edge, variable="ScaledLogRatio",
span=0.03, degree=1, iterations=3, family="symmetric")

## Not run: 
arrayPlot(edgeTrend, variable="Trend", main="Spatial trend of the array CGH", bar="v") 
## End(Not run)

## Classification with spatial constraint of the spatial trend
edgeNem <- nem(edgeTrend, variable="Trend")
## Not run: 
arrayPlot(edgeNem, variable="ZoneNem", main="Spatial zones identified by nem", bar="v")
## End(Not run)
\end{ExampleCode}
\end{Examples}

