\Header{normalizeBetweenArrays}{Normalize Between Arrays}
\keyword{models}{normalizeBetweenArrays}
\keyword{multivariate}{normalizeBetweenArrays}
\begin{Description}\relax
Normalizes expression intensities so that the intensities or log-ratios have similar distributions across a series of arrays.
\end{Description}
\begin{Usage}
\begin{verbatim}
normalizeBetweenArrays(object, method, ties=FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an \code{matrix} or \code{\Link{MAList}} object containing expression ratios for a series of arrays
\item[\code{method}] character string specifying the normalization method to be used.
Choices are \code{"none"}, \code{"scale"}, \code{"quantile"} or \code{"Aquantile"}.
A partial string sufficient to uniquely identify the choice is permitted.
\item[\code{ties}] logical, if \code{TRUE} then ties are treated in a careful way when \code{method="quantile"} or \code{method="Aquantile"}
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{normalizeWithinArrays} normalizes expression values to make intensities consistent within each array.
\code{normalizeBetweenArrays} normalizes expression values to achieve consistency between arrays.

The scale normalization method was proposed by Yang et al (2001, 2002) and is further explained by Smyth and Speed (2003).
The idea is simply to scale the log-ratios to have the same median-abolute-deviation (MAD) across arrays.
This idea has also been implemented by the \code{maNormScale} function in the marrayNorm package.
The implementation here is slightly different in that the MAD scale estimator is replaced with the median-absolute-value and the A-values are normalized as well as the M-values.

Quantile normalization was proposed by Bolstad et al (2003) for Affymetrix-style single-channel arrays and by Yang and Thorne (2003) for two-color cDNA arrays.
\code{method="quantile"} ensures that the intensities have the same empirical distribution across arrays and across channels.
\code{method="Aquantile"} ensures that the A-values (average intensities) have the same empirical distribution across arrays leaving the M-values (log-ratios) unchanged.
These two methods are called "q" and "Aq" respectively in Yang and Thorne (2003).

If \code{object} is a \code{matrix} then the scale or quantile normlization will be applied to the columns.
Applying \code{method="Aquantile"} when \code{object} is a \code{matrix} will produce an error.\end{Details}
\begin{Value}
If \code{object} is a matrix then \code{normalizeBetweenArrays} produces a matrix of the same size.
Otherwise, \code{normalizeBetweenArrays} produces an \code{\Link{MAList}} object.\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{References}\relax
Bolstad, B. M., Irizarry R. A., Astrand, M., and Speed, T. P. (2003), A comparison of normalization methods for high density oligonucleotide array data based on bias and variance. \emph{Bioinformatics} \bold{19}, 185-193.

Smyth, G. K., and Speed, T. P. (2003). Normalization of cDNA microarray data. In: \emph{METHODS: Selecting Candidate Genes from DNA Array Screens: Application to Neuroscience}, D. Carter (ed.). To appear.

Yang, Y. H., Dudoit, S., Luu, P., and Speed, T. P. (2001). Normalization for cDNA microarray data. In \emph{Microarrays: Optical Technologies and Informatics}, M. L. Bittner, Y. Chen, A. N. Dorsel, and E. R. Dougherty (eds), Proceedings of SPIE, Volume 4266, pp. 141-152. 

Yang, Y. H., Dudoit, S., Luu, P., Lin, D. M., Peng, V., Ngai, J., and Speed, T. P. (2002). Normalization for cDNA microarray data: a robust composite method addressing single and multiple slide systematic variation. \emph{Nucleic Acids Research} \bold{30}(4):e15.

Yang, Y. H., and Thorne, N. P. (2003). Normalization for two-color cDNA microarray data.
In: D. R. Goldstein (ed.), \emph{Science and Statistics: A Festschrift for Terry Speed}, IMS Lecture Notes - Monograph Series, Volume 40, pp. 403-418.\end{References}
\begin{SeeAlso}\relax
An overview of LIMMA functions for normalization is given in \link{4.Normalization}.

See also \code{\Link{maNormScale}} in the marrayNorm package and \code{\Link{normalize}} in the affy package.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
library(sma)
data(MouseArray)
MA <- normalizeWithinArrays(mouse.data, mouse.setup)
plot.scale.box(MA$M)

#  Between array scale normalization as in Yang et al (2001):
MA <- normalizeBetweenArrays(MA,method="scale")
print(MA)
show(MA)
plot.scale.box(MA$M)

#  One can get the same results using the matrix method:
M <- normalizeBetweenArrays(MA$M,method="scale")
plot.scale.box(M)

#  MpAq normalization as in Yang and Thorne (2003):
MpAq <- normalizeWithinArrays(mouse.data, mouse.setup)
MpAq <- normalizeBetweenArrays(MpAq, method="Aq")
plotDensities(MpAq)
\end{ExampleCode}
\end{Examples}

