\HeaderA{bgcorrect}{Background Correction}{bgcorrect}
\methaliasA{bgcorrect.gc}{bgcorrect}{bgcorrect.gc}
\methaliasA{bgcorrect.mas4}{bgcorrect}{bgcorrect.mas4}
\methaliasA{bgcorrect.mas5}{bgcorrect}{bgcorrect.mas5}
\methaliasA{bgcorrect.rma}{bgcorrect}{bgcorrect.rma}
\aliasA{xpsBgCorrect}{bgcorrect}{xpsBgCorrect}
\aliasA{xpsBgCorrect-methods}{bgcorrect}{xpsBgCorrect.Rdash.methods}
\keyword{manip}{bgcorrect}
\begin{Description}\relax
Background corrects probe intensities in an object of class \code{\LinkA{DataTreeSet}{DataTreeSet}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
bgcorrect(xps.data, filename = character(0), filedir = getwd(), tmpdir = "", update = FALSE, select = "none", method = character(0), option = character(0), exonlevel = "", params = list(), verbose = TRUE)

bgcorrect.gc(xps.data, filename = character(0), filedir = getwd(), tmpdir = "", update = FALSE, exonlevel = "", select = "antigenomic", verbose = TRUE)

bgcorrect.mas4(xps.data, filename = character(0), filedir = getwd(), tmpdir = "", update = FALSE, exonlevel = "", verbose = TRUE)

bgcorrect.mas5(xps.data, filename = character(0), filedir = getwd(), tmpdir = "", update = FALSE, exonlevel = "", verbose = TRUE)

bgcorrect.rma(xps.data, filename = character(0), filedir = getwd(), tmpdir = "", update = FALSE, exonlevel = "", verbose = TRUE)

xpsBgCorrect(object, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{xps.data}] object of class \code{DataTreeSet}.
\item[\code{filename}] file name of ROOT data file.
\item[\code{filedir}] system directory where ROOT data file should be stored.
\item[\code{tmpdir}] optional temporary directory where temporary ROOT files should be stored.
\item[\code{update}] logical. If \code{TRUE} the existing ROOT data file \code{filename} will be updated.
\item[\code{select}] type of probes to select for background correction.
\item[\code{method}] background method to use.
\item[\code{option}] type of background correction to use.
\item[\code{exonlevel}] exon annotation level determining which probes should be used
for summarization; exon/genome arrays only.
\item[\code{params}] vector of parameters for background method.
\item[\code{verbose}] logical, if \code{TRUE} print status information.
\item[\code{object}] object of class \code{DataSet}.
\item[\code{...}] the arguments described above.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Background corrects probe intensities in an object of class \code{\LinkA{DataTreeSet}{DataTreeSet}}.

\code{xpsBgCorrect} is the \code{DataSet} method called by function \code{bgcorrect},
containing the same parameters.
\end{Details}
\begin{Value}
An \code{\LinkA{DataTreeSet}{DataTreeSet}}
\end{Value}
\begin{Author}\relax
Christian Stratowa
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{express}{express}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## first, load ROOT scheme file and ROOT data file
scheme.test3 <- root.scheme(paste(.path.package("xps"),"schemes/SchemeTest3.root",sep="/"))
data.test3 <- root.data(scheme.test3, paste(.path.package("xps"),"rootdata/DataTest3_cel.root",sep="/"))

## MAS4 sector background
data.bg.mas4 <- bgcorrect.mas4(data.test3,"tmp_Test3MAS4Bgrd",filedir=getwd(),tmpdir="",verbose=FALSE)

## need to attach background intensities
data.bg.mas4 <- attachBgrd(data.bg.mas4)

## get data.frame
bg.mas4 <- validBgrd(data.bg.mas4)
head(bg.mas4)

## plot images
if (interactive()) {
image.dev(data.bg.mas4,bg=TRUE,col=rainbow(32))
image(matrix(bg.mas4[,1], ncol=ncols(schemeSet(data.bg.mas4)), nrow=nrows(schemeSet(data.bg.mas4))))
}
\end{ExampleCode}
\end{Examples}

