\HeaderA{vsn2trsf}{Apply the vsn transformation to data}{vsn2trsf}
\aliasA{predict,vsn-method}{vsn2trsf}{predict,vsn.Rdash.method}
\begin{Description}\relax
Apply the vsn transformation to data.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S4 method for signature 'vsn':
predict(object, newdata, strata=object@strata, log2scale=TRUE, useDataInFit=FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] An object of class \code{\LinkA{vsn}{vsn.Rdash.class}} that
contains transformation parameters and strata information, typically
this is the result of a previous call to \code{vsn2}.
\item[\code{newdata}] Object of class
\code{\LinkA{ExpressionSet}{ExpressionSet}},
\code{\LinkA{NChannelSet}{NChannelSet}},
\code{\LinkA{AffyBatch}{AffyBatch}} (from the \code{affy} package),
\code{\LinkA{RGList}{RGList}} (from the \code{limma} package),
\code{matrix} or \code{numeric}, with the data to which the
fit is to be applied to.
\item[\code{strata}] Optional, a \code{factor} or \code{integer}
that aligns with the rows of \code{newdata}; see
the \code{strata} argument of \code{\LinkA{vsn2}{vsn2}}.
\item[\code{log2scale}] If \code{TRUE}, the data are returned on the glog
scale to base 2, and an overall offset c is added (see \emph{Value}
section of the \code{\LinkA{vsn2}{vsn2}} manual page). If \code{FALSE}, the
data are returned on the glog scale to base e, and no offset is
added.
\item[\code{useDataInFit}] If \code{TRUE}, then no transformation is
attempted and the data stored in \code{object} is transferred
appropriately into resulting object, which otherwise preserves the
class and metadata of \code{newdata}. This option exists to increase
performance in constructs like
\begin{alltt}
       fit = vsn2(x, ...)
       nx = predict(fit, newdata=x)
\end{alltt}
and is used, for example, in the \code{\LinkA{justvsn}{justvsn}} function.

\end{ldescription}
\end{Arguments}
\begin{Value}
An object typically of the same class as \code{newdata}. There are two
exceptions: if \code{newdata} is an
\code{\LinkA{RGList}{RGList}}, the return value is an
\code{\LinkA{NChannelSet}{NChannelSet}}, and
if \code{newdata} is numeric, the return value is a \code{matrix} with 1
column.
\end{Value}
\begin{Author}\relax
Wolfgang Huber \url{http://www.ebi.ac.uk/huber}
\end{Author}
\begin{Examples}
\begin{ExampleCode}
data("kidney")

## nb: for random subsampling, the 'subsample' argument of vsn
##   provides an easier way to do this
fit = vsn2(kidney[sample(nrow(kidney), 500), ])
tn = predict(fit, newdata=exprs(kidney))

\end{ExampleCode}
\end{Examples}

