\Header{maCompPlate}{Generate plate IDs}
\keyword{methods}{maCompPlate}
\begin{Description}\relax
This function generates plate IDs from the dimensions of the grid and
spot matrices. Note that this function only applies to arrays with a
regular plate layout, where the number of spots is a multiple of the
number of wells on a plate (usually 96 or 384) and each well contributes 
exactly one spot. It should thus be used with caution.
\end{Description}
\begin{Usage}
\begin{verbatim}
maCompPlate(x, n=384)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] object of class \code{"\Link{marrayLayout}"}, \code{"\Link{marrayRaw}"}, \code{"\Link{marrayNorm}"},  \code{"\Link{marraySpots}"}, or  \code{"\Link{marrayTwo}"}.
\item[\code{n}] object of class "numeric", number of wells in each plate, usually 384 or 96.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Having plate IDs may be useful for the purpose of normalization. Normalization by plate can be done using the function \code{\Link{maNormMain}}.
\end{Details}
\begin{Value}
a vector of plate IDs (\code{\Link{factor}}).
\end{Value}
\begin{Author}\relax
Yee Hwa (Jean) Yang, Sandrine Dudoit, \url{http://www.stat.berkeley.edu/~sandrine}.
\end{Author}
\begin{SeeAlso}\relax
\code{\Link{marrayLayout}}, \code{\Link{marrayRaw}}, \code{\Link{marrayNorm}}, \code{\Link{marraySpots}}, \code{\Link{marrayTwo}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

L<-new("marrayLayout", maNgr=4, maNgc=4, maNsr=22, maNsc=24)
plate<-maCompPlate(L,384)
table(plate)
maPlate(L)<-plate

\end{ExampleCode}
\end{Examples}

