\HeaderA{mas4}{MAS 4.0 Expression Measure}{mas4}
\aliasA{xpsMAS4}{mas4}{xpsMAS4}
\aliasA{xpsMAS4-methods}{mas4}{xpsMAS4.Rdash.methods}
\keyword{manip}{mas4}
\begin{Description}\relax
This function converts a \code{\LinkA{DataTreeSet}{DataTreeSet}} into an \code{\LinkA{ExprTreeSet}{ExprTreeSet}}
using the XPS implementation of Affymetrix's MAS 4.0 expression measure.
\end{Description}
\begin{Usage}
\begin{verbatim}
mas4(xps.data,
     filename   = character(0),
     filedir    = getwd(),
     tmpdir     = "",
     normalize  = FALSE,
     sc         = 500,
     option     = "transcript",
     exonlevel  = "",
     update     = FALSE,
     xps.scheme = NULL,
     add.data   = TRUE,
     verbose    = TRUE)

xpsMAS4(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{normalize}] logical. If \code{TRUE} scale normalization is used after an \code{ExprTreeSet} is obtained.
\item[\code{sc}] value at which all arrays will be scaled to.
\item[\code{option}] option determining the grouping of probes for summarization, one of 
\sQuote{transcript}, \sQuote{exon}, \sQuote{probeset}; exon arrays only.
\item[\code{exonlevel}] exon annotation level determining which probes should be used for summarization; 
exon/genome arrays only.
\item[\code{update}] logical. If \code{TRUE} the existing ROOT data file \code{filename} will be updated.
\item[\code{xps.scheme}] optional alternative \code{SchemeTreeSet}.
\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{DataTreeSet}.
\item[\code{...}] arguments \code{filename},\code{filedir},\code{tmpdir},\code{option},\code{exonlevel},\code{xps.scheme}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function computes the Affymetrix MAS 4.0 expression measure, i.e. the 
\sQuote{Average Difference} expression level, as implemented in XPS.

If \code{normalize=TRUE} then the expression levels will be scaled to \code{sc}. 
For \code{sc=0} the expression levels will be scaled to the mean expression level.

\code{xpsMAS4} is the \code{DataTreeSet} method called by function \code{mas4}, however, 
expression levels will not be scaled to a common mean expression level.

For further details see \code{\LinkA{mas5}{mas5}}.
\end{Details}
\begin{Value}
An \code{\LinkA{ExprTreeSet}{ExprTreeSet}}
\end{Value}
\begin{Note}\relax
In contrast to function \code{mas4}, expression levels computed with \code{xpsMAS4} 
will not be scaled to a common mean expression level.
\end{Note}
\begin{Author}\relax
Christian Stratowa
\end{Author}
\begin{References}\relax
Affymetrix (1999) GeneChip Expression Analysis Algorithm Tutorial, Affymetrix Inc., 
Santa Clara, CA.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{xpsMAS4}{xpsMAS4}}, \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="/"))

data.mas4 <- mas4(data.test3,"tmp_Test3MAS4",tmpdir="",normalize=TRUE,sc=500, update=TRUE,verbose=FALSE)

## get data.frame
expr.mas4 <- validData(data.mas4)
head(expr.mas4)

## plot results (negative expression values!)
if (interactive()) {
boxplot(expr.mas4)
}

rm(scheme.test3, data.test3)
gc()
\end{ExampleCode}
\end{Examples}

