\HeaderA{normalizeForPrintorder}{Print-Order Normalization}{normalizeForPrintorder}
\methaliasA{normalizeForPrintorder.rg}{normalizeForPrintorder}{normalizeForPrintorder.rg}
\aliasA{plotPrintorder}{normalizeForPrintorder}{plotPrintorder}
\keyword{models}{normalizeForPrintorder}
\begin{Description}\relax
Normalize intensity values on one or more spotted microarrays to adjust for print-order effects.
\end{Description}
\begin{Usage}
\begin{verbatim}
normalizeForPrintorder(object, layout, start="topleft", method = "loess", separate.channels = FALSE, span = 0.1, plate.size = 32)
normalizeForPrintorder.rg(R, G, printorder, method = "loess", separate.channels = FALSE, span = 0.1, plate.size = 32, plot = FALSE)
plotPrintorder(object, layout, start="topleft", slide = 1, method = "loess", separate.channels = FALSE, span = 0.1, plate.size = 32)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an \code{RGList} or \code{list} object containing components \code{R} and \code{G} which are matrices containing the red and green channel intensities for a series of arrays
\item[\code{R}] numeric vector containing red channel intensities for a single microarray
\item[\code{G}] numeric vector containing the green channel intensities for a single microarray
\item[\code{layout}] list specifying the printer layout, see \code{\LinkA{PrintLayout-class}{PrintLayout.Rdash.class}}
\item[\code{start}] character string specifying where printing starts in each pin group.  Choices are \code{"topleft"} or \code{"topright"}.
\item[\code{printorder}] numeric vector specifying order in which spots are printed.
Can be computed from \code{printorder(layout,start=start)}.
\item[\code{slide}] positive integer giving the column number of the array for which a plot is required
\item[\code{method }] character string, "loess" if a smooth loess curve should be fitted through the print-order trend or "plate" if plate effects are to be estimated
\item[\code{separate.channels}] logical, \code{TRUE} if normalization should be done separately for the red and green channel and \code{FALSE} if the normalization should be proportional for the two channels
\item[\code{span}] numerical constant between 0 and 1 giving the smoothing span for the loess the curve.  Ignored if \code{method="plate"}.
\item[\code{plate.size}] positive integer giving the number of consecutive spots corresponding to one plate or plate pack.  Ignored if \code{method="loess"}.
\item[\code{plot}] logical. If \code{TRUE} then a scatter plot of the print order effect is sent to the current graphics device.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Print-order is associated with the 384-well plates used in the printing of spotted microarrays.
There may be variations in DNA concentration or quality between the different plates.
The may be variations in ambient conditions during the time the array is printed.

This function is intended to pre-process the intensities before other normalization methods are applied to adjust for variations in DNA quality or concentration and other print-order effects.

Printorder means the order in which spots are printed on a microarray.
Spotted arrays are printed using a print head with an array of print-tips.
Spots in the various tip-groups are printed in parallel.
Printing is assumed to start in the top left hand corner of each tip-groups and to proceed right and down by rows, or else to start in the top right hand and to proceed left and down by rows.
See \code{\LinkA{printorder}{printorder}} for more details.
(WARNING: this is not always the case.)
This is true for microarrays printed at the Australian Genome Research Facility but might not be true for arrays from other sources.

If \code{object} is an \code{RGList} then printorder is performed for each intensity in each array.

\code{plotPrintorder} is a non-generic function which calls \code{normalizeForPrintorder} with \code{plot=TRUE}.
\end{Details}
\begin{Value}
\code{normalizeForPrintorder} produces an \code{RGList} containing normalized intensities.

The function \code{plotPrintorder} or \code{normalizeForPrintorder.rg} with \code{plot=TRUE} returns no value but produces a plot as a side-effect.

\code{normalizeForPrintorder.rg} with \code{plot=FALSE} returns a list with the following components: 
\begin{ldescription}
\item[\code{R}] numeric vector containing the normalized red channel intensities
\item[\code{G}] numeric vector containing the normalized red channel intensites
\item[\code{R.trend}] numeric vector containing the fitted printorder trend for the red channel
\item[\code{G.trend}] numeric vector containing the fitted printorder trend for the green channe
\end{ldescription}
\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{References}\relax
Smyth, G. K. Print-order normalization of cDNA microarrays. March 2002.  \url{http://www.statsci.org/smyth/pubs/porder/porder.html}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{printorder}{printorder}}.

An overview of LIMMA functions for normalization is given in \LinkA{05.Normalization}{05.Normalization}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
library(sma)
data(MouseArray)
plotPrintorder(mouse.data,mouse.setup,slide=1,separate=TRUE)
RG <- normalizeForPrintorder(mouse.data,mouse.setup)
\end{ExampleCode}
\end{Examples}

