\HeaderA{read.marrayLayout}{Create objects of class marrayLayout}{read.marrayLayout}
\aliasA{widget.marrayLayout}{read.marrayLayout}{widget.marrayLayout}
\keyword{file}{read.marrayLayout}
\keyword{connection}{read.marrayLayout}
\begin{Description}\relax
This function creates objects of class \code{\LinkA{marrayLayout}{marrayLayout}} to store layout parameters for  two-color cDNA microarrays.
\end{Description}
\begin{Usage}
\begin{verbatim}
read.marrayLayout(fname = NULL, ngr, ngc, nsr, nsc, pl.col = NULL, ctl.col = NULL, sub.col = NULL, notes = fname, skip, sep = "\t", quote = "\"", ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{fname}] the name of the file that stores plate and control
information. This is usually a file obtained from a database.
\item[\code{ngr}] the number of rows of grids per image.
\item[\code{ngc}] the number of columns of grids per image.
\item[\code{nsr}] the number of rows of spots per grid.
\item[\code{nsc}] the number of columns of spots per grid.
\item[\code{pl.col}] the column number in \code{fname} that contains plate information.
\item[\code{ctl.col}] the column number in \code{fname} that contains control information.
\item[\code{sub.col}] the column number in \code{fname} that contains full ID information.
\item[\code{notes}] object of class character, vector of explanatory text.
\item[\code{skip}] the number of lines of the data file to skip before
beginning to read data.
\item[\code{sep}] the field separator character.  Values on each line of the
file are separated by this character. The
default is to read a tab delimited file.
\item[\code{quote}] the set of quoting characters. By default, this is disable
by setting `quote="\""'.
\item[\code{...}] further arguments to \code{\LinkA{scan}{scan}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\end{Details}
\begin{Value}
An object of class \code{\LinkA{marrayLayout}{marrayLayout}}.
\end{Value}
\begin{Note}\relax
\end{Note}
\begin{Author}\relax
Jean Yang \email{yeehwa@stat.berkeley.edu}
\end{Author}
\begin{References}\relax
http://www.bioconductor.org/
\end{References}
\begin{Examples}
\begin{ExampleCode}
datadir <- system.file("swirldata", package="marray")

### Reading in control information from file
skip <-  grep("Row", readLines(file.path(datadir,"fish.gal"), n=100)) - 1
swirl.layout <- read.marrayLayout(fname=file.path(datadir,"fish.gal"), ngr=4, ngc=4,
nsr=22, nsc=24, ctl.col=4, skip=skip)

### Setting control information.
swirl.gnames <- read.marrayInfo(file.path(datadir,"fish.gal"), info.id=4:5, labels=5, skip=21)
x <-  maInfo(swirl.gnames)[,1]
y <- rep(0, maNspots(swirl.layout))
y[x == "control"] <- 1
slot(swirl.layout, "maControls") <- as.factor(y)
\end{ExampleCode}
\end{Examples}


