\HeaderA{readPlateData}{Read a collection of plate reader data files}{readPlateData}
\keyword{manip}{readPlateData}
\begin{Description}\relax
Reads a collection of plate reader data files into a data.frame.
The names of the files, plus additional information
(plate number, repeat number) is expected in a tab-delimited table specified
by the argument 'x'.
\end{Description}
\begin{Usage}
\begin{verbatim}
readPlateData(filename, path=dirname(filename), name, plateType="384", verbose=TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{filename}] the name of the file table (see details).
This argument is just passed on to the \code{\LinkA{read.table}{read.table}}
function, so any of the valid argument
types for \code{\LinkA{read.table}{read.table}} are valid here, too.
\item[\code{name}] a character of length 1 with the experiment name.
\item[\code{path}] a character of length 1 indicating the path in
which to find the plate reader files. By default, 
it can extract the path from \code{filename}.
\item[\code{plateType}] a character of length 1, allowed values are "96" and "384".
\item[\code{verbose}] a logical value, if TRUE, the function reports some of
its intermediate progress.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The file table is expected to be a tab-delimited file with at
least three columns, and column names \code{Filename}, \code{Plate},
and \code{Replicate}. The contents of the columns \code{Plate} and
\code{Replicate} are expected to be integers. Further columns are
allowed.

We distinguish between \emph{plates} and \emph{plate result file}.
A plate result file contains the measurements results for all
replicates and all channels of a plate, which is the physical carrier
of the reagents.
\end{Details}
\begin{Value}
An object of class \code{"cellHTS"}, which is currently implemented as
a list with elements
\begin{ldescription}
\item[\code{name}] copy of the input argument \code{name}
\item[\code{xraw}] an array of dimension plateSize x number of plates x
number of replicates x number of channels, containg the imported
measurement data.
\item[\code{pdim}] a numeric vector of length 2 containg the number of rows
and columns in a plate. The product of these two numbers is the
first dimension of \code{xraw}.
\item[\code{batch}] an integer vector with the batch number (1, 2, ...)
for each plate. Its length corresponds to the second dimension of 
of \code{xraw}.
\item[\code{plateList}] a data.frame containing what was read from input file
\code{x}, plus a column \code{status} of type character: it contains
the string "OK" if the data import
appeared to have gone well, and the respective error or warning
message otherwise.
\item[\code{intensityFiles}] a list of character vectors, each containing a
copy of the imported input data files. Its length corresponds to the
number of rows of \code{plateList}.
\item[\code{state}] a logical vector representing the processing status of
the object.
\end{ldescription}
\end{Value}
\begin{Author}\relax
W. Huber \email{huber@ebi.ac.uk}
\end{Author}
\begin{References}\relax
..
\end{References}
\begin{Examples}
\begin{ExampleCode}
 datadir = system.file("KcViabSmall", package = "cellHTS")
 x = readPlateData("Platelist.txt", "KcViabSmall", path=datadir)
\end{ExampleCode}
\end{Examples}

