\Header{normalize.qspline}{Normalize arrays}
\alias{normalize.AffyBatch.qspline}{normalize.qspline}
\alias{qspline-normalize}{normalize.qspline}
\begin{Description}\relax
normalizes arrays in an AffyBatch each other or to a set of target intensities
\end{Description}
\begin{Usage}
\begin{verbatim}
normalize.AffyBatch.qspline(abatch,type=c("separate","pmonly","mmonly","together"),...)

normalize.qspline(x, target = NULL, samples = NULL, 
                  fit.iters = 5, min.offset = 5, 
                  spline.method = "natural", smooth = TRUE,
                  spar = 0, p.min = 0, p.max = 1.0, 
                  incl.ends = TRUE, converge = FALSE, 
                  verbose = TRUE, na.rm = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a \code{data.matrix} of intensities
\item[\code{abatch}] an \code{AffyBatch}
\item[\code{target}] numerical vector of intensity values to normalize to.
(could be the name for one of the celfiles in 'abatch')
\item[\code{samples}] numerical, the number of quantiles to be used for spline.
if (0,1], then it is a sampling rate
\item[\code{fit.iters}] number of spline interpolations to average
\item[\code{min.offset}] minimum span between quantiles (rank difference) for the
different fit iterations
\item[\code{spline.method}] specifies the type of spline to be used. Possible values are 
`"fmm"', `"natural"', and `"periodic"'.
\item[\code{smooth}] logical, if `TRUE', smoothing splines are used on the quantiles
\item[\code{spar}] smoothing parameter for `splinefun', typically in (0,1].
\item[\code{p.min}] minimum percentile for the first quantile
\item[\code{p.max}] maximum percentile for the last quantile
\item[\code{incl.ends}] include the minimum and maximum values from the normalized
and target arrays in the fit
\item[\code{converge}] (currently unimplemented)
\item[\code{verbose}] logical, if `TRUE' then normalization progress is reported
\item[\code{na.rm}] logical, if `TRUE' then handle NA values (by ignoring
them)
\item[\code{type}] A string specifying how the normalization should be
applied. See details for more.
\item[\code{...}] Optional parameters to be passed through
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This normalization method uses the quantiles from each array and the 
target to fit a system of cubic splines to normalize the data. The 
target should be the mean (geometric) or median of each probe but could 
also be the name of a particular chip in the \code{abatch} object.

Parameters setting can be of much importance when using this method.
The parameter \code{fit.iter} is used as a starting point to find a
more appropriate value. Unfortunately the algorithm used do not
converge in some cases. If this happens, the \code{fit.iter} value is
used and a warning is thrown. Use of different settings for the
parameter \code{samples} was reported to give good results. More
specifically, for about 200   data points use
\code{samples = 0.33}, for about 2000  data points use
\code{samples = 0.05}, for about 10000 data points use
\code{samples = 0.02}
(thanks to Paul Boutros).

The \code{type} argument should be one of
\code{"separate","pmonly","mmonly","together"} which indicates whether
to normalize only one probe type (PM,MM) or both together or separately.\end{Details}
\begin{Value}
a normalized \code{AffyBatch}.\end{Value}
\begin{Author}\relax
Laurent and Workman C.
\end{Author}
\begin{References}\relax
Christopher Workman, Lars Juhl Jensen, Hanne Jarmer, Randy Berka,
Laurent Gautier, Henrik Bj{\o}rn Nielsen, Hans-Henrik Saxild, Claus
Nielsen, S{\o}ren Brunak, and Steen Knudsen. A new non-linear normal-
ization method for reducing variability in dna microarray experiments.
Genome Biology, accepted, 2002
\end{References}

