\HeaderA{express}{Compute expression levels from raw data}{express}
\aliasA{xpsPreprocess}{express}{xpsPreprocess}
\aliasA{xpsPreprocess-methods}{express}{xpsPreprocess.Rdash.methods}
\keyword{manip}{express}
\begin{Description}\relax
This function allows to combine different algorithms to compute expression levels,
or to return the result for different algorithms only.
\end{Description}
\begin{Usage}
\begin{verbatim}
express(xps.data,
        filename = character(),
        filedir = getwd(),
        tmpdir = "",
        update = FALSE,
      # background correction
        bgcorrect.method = NULL,
        bgcorrect.select = character(),
        bgcorrect.option = character(),
        bgcorrect.params = list(),
      # normalization
        normalize.method = NULL,
        normalize.select = character(),
        normalize.option = character(),
        normalize.logbase = character(),
        normalize.params = list(),
      # expression values
        summarize.method = NULL,
        summarize.select = character(),
        summarize.option = character(),
        summarize.logbase = character(),
        summarize.params = list(),
      # reference values
        reference.index  = 0,
        reference.method = "mean",
        reference.params = list(0),
      # misc.
        exonlevel  = "",
        xps.scheme = NULL,
        add.data   = TRUE,
        verbose    = TRUE)

xpsPreprocess(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{bgcorrect.method}] background method to use.
\item[\code{bgcorrect.select}] type of probes to select for background correction.
\item[\code{bgcorrect.option}] type of background correction to use.
\item[\code{bgcorrect.params}] vector of parameters for background method.
\item[\code{normalize.method}] normalization method to use.
\item[\code{normalize.select}] type of probes to select for normalization.
\item[\code{normalize.option}] normalization option.
\item[\code{normalize.logbase}] logarithm base as character, one of \sQuote{0}, \sQuote{log},
\sQuote{log2}, \sQuote{log10}.
\item[\code{normalize.params}] vector of parameters for normalization method.
\item[\code{summarize.method}] summarization method to use.
\item[\code{summarize.select}] type of probes to select for summarization.
\item[\code{summarize.option}] option determining the grouping of probes for summarization, one of 
\sQuote{transcript}, \sQuote{exon}, \sQuote{probeset}; exon arrays only.
\item[\code{summarize.logbase}] logarithm base as character, one of \sQuote{0}, \sQuote{log},
\sQuote{log2}, \sQuote{log10}.
\item[\code{summarize.params}] vector of parameters for summarization method.
\item[\code{reference.index}] index of reference tree to use, or 0.
\item[\code{reference.method}] for \code{refindex=0}, either trimmed mean or median of trees.
\item[\code{reference.params}] vector of parameters for reference method.
\item[\code{exonlevel}] exon annotation level determining which probes should be used for summarization; exon/genome arrays only.
\item[\code{xps.scheme}] optional alternative \code{SchemeSet}.
\item[\code{add.data}] logical. If \code{TRUE} expression data will be included as slot \code{data}.
\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
This function allows to combine different algorithms to compute expression levels,
or to return the result for different algorithms only.

\code{xpsPreprocess} is the \code{DataSet} method called by function \code{express},
containing the same parameters.
\end{Details}
\begin{Value}
An object of type \code{\LinkA{DataTreeSet}{DataTreeSet}} or \code{\LinkA{ExprTreeSet}{ExprTreeSet}}.
\end{Value}
\begin{Author}\relax
Christian Stratowa
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{bgcorrect}{bgcorrect}}, \code{\LinkA{normalize}{normalize}}, \code{\LinkA{summarize}{summarize}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## load existing 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="/"))

## compute rma with a single call to express()
expr.rma <- express(data.test3,"tmp_Test3Exprs",filedir=getwd(),tmpdir="",update=FALSE,
            bgcorrect.method="rma",bgcorrect.select="none",bgcorrect.option="pmonly:epanechnikov",bgcorrect.params=c(16384),
            normalize.method="quantile",normalize.select="pmonly",normalize.option="transcript:together:none",normalize.logbase="0",normalize.params=c(0.0),
            summarize.method="medianpolish",summarize.select="pmonly",summarize.option="transcript",summarize.logbase="log2",summarize.params=c(10, 0.01, 1.0),
            verbose=FALSE)

## get expression data.frame
expr <- exprs(expr.rma)
head(expr)

## plot expression levels
if (interactive()) {
boxplot(expr.rma)
boxplot(log2(expr[,3:6]))
}
\end{ExampleCode}
\end{Examples}

