\HeaderA{readIntensities}{readIntensities}{readIntensities}
\keyword{IO}{readIntensities}
\begin{Description}\relax
The function takes the \code{data.frame}
\code{slideDescription} as input and reads
the listed image analysis raw data files of
the column \code{slideNameColumn}; cf.
function \code{\LinkA{readpDataSlides}{readpDataSlides}}. Each
image analysis raw data file must contain
tab separated columns and a header line -
not necessarily at the top of the file; cf.
the arguments \code{removePatterns} and
\code{skip}. Each file may only contain the
information for one channel, cf. argument
\code{channelColumn}.
The raw data information is returned as an
object of class \code{\LinkA{arrayData}{arrayData}}.
Note: All image analysis quantification
(=raw data) files have to correspond
to the same type of microarray.
\end{Description}
\begin{Usage}
\begin{verbatim}readIntensities(slideDescription, fileNameColumn="fileName", slideNameColumn, channelColumn = NULL, loadPath=".", type = "GenePix", spotAnnoColumns = NULL, dataColumns = NULL, removePatterns = NULL, skip = NULL, spotIdentifier, ..., verbose = TRUE)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{slideDescription}] \code{data.frame}; required; default: missing.
(cf. the return value of the function \code{\LinkA{readpDataSlides}{readpDataSlides}})
The \code{data.frame} must contain at least one column;
this column has to be named as the argument \code{fileNameColumn}.
It may additionally contain a column named \code{slideNameColumn}.

\item[\code{fileNameColumn}] character string; required; default: "fileName".
\code{fileNameColumn} specifies the column which
contains all image quantification result files
in the \code{data.frame} of argument
\code{slideDescription}.
\item[\code{slideNameColumn}] character string; optional; default missing;
refers to the \code{data.frame} of argument \code{slideDescription}.
If \code{slideNameColumn} is missing the value is set
to \code{fileNameColumn}.
\item[\code{channelColumn}] named vector of character strings;
optional; default \code{NULL}. 
If the \code{data.frame} of argument
\code{slideDescription} contains information
for each channel of every slide/hybridisation separately, the
\code{channelColumn} vector contains the column name of the
\code{data.frame} of argument \code{slideDescription}
used to specify the channel.
If \code{length(channelColumn) == 1} the character strings
"green" and "red" are assumed to be used for the coding,
otherwise \code{names(channelColumn)} must contain:
\code{c("channelColumnName","green","red")}.

\item[\code{loadPath}] character string; required; default: ".".
The path is used to load the image quantification result files;
note: "." refers to the working directory.

\item[\code{spotIdentifier}] character string; optional; default missing.
\code{spotIdentifier} specifies the column
in the image analysis result files which contain
spot or gene identifiers.
\item[\code{type}] character string; required;
possible values: "GenePix", "ScanAlyze",
"generic" and "genericOneFilePerChannel";
cf. Details section.
Note: value "generic" requires the arguments
\code{spotAnnoColumns}, \code{dataColumns}
and possibly \code{skip} and \code{removePatterns},
value "genericOneFilePerChannel" additionally requires
the argument "channelColumn";
whereas "GenPix"
and "ScanAlyze" use predefined values if not
otherwise specified;
default: "GenePix".
\item[\code{spotAnnoColumns}] vector of character strings;
the column names of the image analysis data file.
The columns must contain the same information for all
files, e.g. the information on the layout of the microarray.
The argument \code{spotIdentifier} is automatically
added to the vector if not already included; default: \code{NULL} 
\item[\code{dataColumns}] named vector of character strings;
the column names of the image analysis data file.
The columns  contain the raw intensities values of each spot; 
\code{names(dataColumns)} must contain:
\code{c("greenForeground", "greenBackground",
                 "redForeground", "redBackground")};
default: \code{NULL}

\item[\code{removePatterns}] vector of character string(s) each defining
a regular expression; default: \code{NULL};
all lines of each image analysis raw data file,
which match any of the regular expression(s) are discarded.

\item[\code{skip}] integer; default: \code{NULL};
number of lines skipped in each image analysis data file;
Argument \code{skip} applies after all lines matched by
one of the arguments of
\code{removePatterns} have been discarded.

\item[\code{...}] further arguments which are passed to \code{\LinkA{read.table}{read.table}}.
A function which is used inside this function. The arguments
must not include \code{sep},  \code{header}, \code{as.is}
and \code{skip} (for \code{skip} cf. above).

\item[\code{verbose}] logical; required; default \code{TRUE}
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Details on the argument \code{type}:
\code{type="GenePix"} defines 
\code{spotAnnoColumns =  c("Block", "Column", "Row", "Name", "ID")}
and
\code{dataColumns = c("F532.Median", "B532.Median",
                           "F635.Median", "B635.Median")} and corresponding
\code{names(dataColumns) = c("greenForeground", "greenBackground",
      "redForeground", "redBackground")}, a dynamically determined argument 
\code{skip =  grep("Block...Column", imageFile) - 1} and
\code{removePatterns = NULL},
whereas
\code{type="ScanAlyze"} defines
\code{spotAnnoColumns = c( "HEADER", "SPOT", "GRID", "ROW", "COL" )}
and
\code{dataColumns = c("CH1I", "CH1B", "CH2I", "CH2B")} and corresponding
\code{names(dataColumns) = c("greenForeground", "greenBackground",
                                  "redForeground", "redBackground")},
\code{skip = 0} and
\code{removePatterns = c("\textasciicircum{}REMARK")}.
\end{Details}
\begin{Value}
object of class \code{\LinkA{arrayData}{arrayData}}
\end{Value}
\begin{Author}\relax
Andreas Buness <a.buness@dkfz.de>
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{readpDataSlides}{readpDataSlides}},
\code{\LinkA{arrayData-class}{arrayData.Rdash.class}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

   

 \end{ExampleCode}
\end{Examples}

