\HeaderA{bg.correct}{Background Correction}{bg.correct}
\methaliasA{bg.correct.mas}{bg.correct}{bg.correct.mas}
\methaliasA{bg.correct.none}{bg.correct}{bg.correct.none}
\methaliasA{bg.correct.rma}{bg.correct}{bg.correct.rma}
\keyword{manip}{bg.correct}
\begin{Description}\relax
Background corrects probe intensities in an object of class
\code{\LinkA{AffyBatch}{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{\LinkA{AffyBatch}{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:
\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.
}

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.

R implementations similar in function to the internal implemntation used by \code{bg.correct.rma} are in
\code{\LinkA{bg.adjust}{bg.adjust}}.
\end{Details}
\begin{Value}
An \code{\LinkA{AffyBatch}{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}
if (require(affydata)) {
  data(Dilution)

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

  ##This plot shows the tranformation
  plot(pm(Dilution)[,1],pm(bgc)[,1],log="xy",
  main="PMs before and after background correction")
}
\end{ExampleCode}
\end{Examples}

