\HeaderA{attachExpr-methods}{Attach/Remove Expression Measures}{attachExpr.Rdash.methods}
\aliasA{attachExpr}{attachExpr-methods}{attachExpr}
\aliasA{removeExpr}{attachExpr-methods}{removeExpr}
\aliasA{removeExpr-methods}{attachExpr-methods}{removeExpr.Rdash.methods}
\keyword{methods}{attachExpr-methods}
\begin{Description}\relax
Attach/remove expression levels to/from \code{\LinkA{ExprTreeSet}{ExprTreeSet}}.

\emph{Usage}

\code{attachExpr(object, treenames = "*")}

\code{removeExpr(object)}
\end{Description}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] Object of class \code{"ExprTreeSet"}.
\item[\code{treenames}] Object of class \code{"list"} representing the names of the 
\code{\LinkA{ROOT}{ROOT}} expression trees.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
By default expression levels will be saved in class \code{\LinkA{ExprTreeSet}{ExprTreeSet}} as slot
\code{data}, since usually the \code{data.frame} obtained as result of e.g. \code{rma}
normalization is of reasonable size. However, when normalizing many arrays, especially exon
arrays at probeset levels, it may be better to compute \code{rma} with slot \code{add.data=FALSE}
thus avoiding memory problems. In this case, function \code{attachExpr} allows to  fill
slot \code{data} on demand.

\code{attachExpr} exports expression levels from expression trees from \code{\LinkA{ROOT}{ROOT}}
expression file and and saves as data.frame \code{data}. \code{treenames} is a vector of
tree names to attach; for \code{treenames="*"} all trees from slot \code{treenames}
will be exported and expression levels attached as data.frame \code{data}.

\code{removeExpr} removes expression levels from \code{\LinkA{ExprTreeSet}{ExprTreeSet}} and replaces
data.frame \code{data} with an empty data.frame of dim(0,0).
\end{Details}
\begin{Value}
A \code{\LinkA{ExprTreeSet}{ExprTreeSet}} object.
\end{Value}
\begin{Note}\relax
Do not use \code{attachExpr} unless you know that your computer has sufficient RAM,
especially when using exon arrays. It may be advisible to use a subset of \code{treenames}
only.
\end{Note}
\begin{Author}\relax
Christian Stratowa
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{attachCall}{attachCall}}, \code{\LinkA{removeCall}{removeCall}}
\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.rma <- rma(data.test3,"tmp_Test3RMA0",tmpdir="",background="pmonly",normalize=TRUE,add.data=FALSE,verbose=FALSE)

## attach data
data.rma <- attachExpr(data.rma)

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

## remove data
data.rma <- removeExpr(data.rma)

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

