\Header{bg.correct}{Background Correction}
\alias{bg.correct-methods}{bg.correct}
\alias{bg.correct.mas}{bg.correct}
\alias{bg.correct.methods}{bg.correct}
\alias{bg.correct.none}{bg.correct}
\alias{bg.correct.rma}{bg.correct}
\alias{bg.correct.rma2}{bg.correct}
\alias{bgcorrect.methods}{bg.correct}
\keyword{manip}{bg.correct}
\begin{Description}\relax
Background corrects probe intensities in an object of class
\code{\Link{AffyBatch}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
bg.correct(object, method, ...)

bg.correct.rma(object,...)
bg.correct.mas(object, griddim)
bg.correct.none(object, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] An object of class \code{\Link{AffyBatch}}.
\item[\code{method}] A \code{character} that defines what background
correction method will be used. Available methods are given by
\code{bg.correct.methods}. 
\item[\code{griddim}] grid dimension used for mas background estimate. The array
is divided into griddm equal parts. Default is 16.
\item[\code{...}] arguments to pass along to the engine function.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The name of the method to apply must be double-quoted.
Methods provided with the package are currently:
\begin{itemize}
\item bg.correct.none: returns \code{object} unchanged.
\item bg.correct.chipwide: noise correction as described in a
`white paper' from Affymetrix.
\item bg.correct.rma: the model based correction used by the RMA
expression measure.
\end{itemize}

They are listed in the variable \code{bg.correct.methods}. The user must
supply the word after "bg.correct", i.e none, subtractmm, rma, etc...

More details are available in the vignette.

\code{bg.correct.rma2} gives access to the older background method
that was used by the \code{\Link{rma}} function in version 1.1
bioconductor releases. For the 1.2 release \code{\Link{rma}} performs
the same background adjustment as \code{bg.correct.rma}. Unless you
wish to duplicate older results in which case
you should use \code{bg.correct.rma}.

Details on the internal fucntions used by \code{bg.correct.rma} are in
\code{\Link{bg.adjust}}.\end{Details}
\begin{Value}
An \code{\Link{AffyBatch}} for which the
intensities have been background adjusted.
For some methods (RMA), only PMs are corrected and the MMs remain the
same.\end{Value}
\begin{Examples}
\begin{ExampleCode}
    data(affybatch.example)

    ##bgc will be the bg corrected version of affybatch.example 
    bgc <- bg.correct(affybatch.example,method="rma") 

    ##This plot shows the tranformation
    plot(pm(affybatch.example)[,1],pm(bgc)[,1],log="xy",
        main="PMs before and after background correction")

\end{ExampleCode}
\end{Examples}

