\HeaderA{justvsn}{Normalization with vsn}{justvsn}
\aliasA{justvsn,AffyBatch-method}{justvsn}{justvsn,AffyBatch.Rdash.method}
\aliasA{justvsn,ExpressionSet-method}{justvsn}{justvsn,ExpressionSet.Rdash.method}
\aliasA{justvsn,RGList-method}{justvsn}{justvsn,RGList.Rdash.method}
\aliasA{justvsn-methods}{justvsn}{justvsn.Rdash.methods}
\begin{Description}\relax
\code{justvsn} fits the vsn model to data
and returns an \code{\LinkA{ExpressionSet}{ExpressionSet}}.
It is a simple wrapper for
\code{\LinkA{vsn2}{vsn2}} and \code{\LinkA{predict}{predict}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
justvsn(x, reference, strata, ...)

## S4 method for signature 'RGList':
justvsn(x, reference, strata, backgroundsubtract=FALSE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] An object containing the data to which the model is to be
fitted. Methods exist for \code{\LinkA{ExpressionSet}{ExpressionSet}},
\code{\LinkA{AffyBatch}{AffyBatch}} (from the \code{affy} package) and
\code{\LinkA{RGList}{RGList}} (from the \code{limma} package).
\item[\code{reference, strata, ...}] As in \code{\LinkA{vsn2}{vsn2}}.
\item[\code{backgroundsubtract}] Logical of length 1, it applies only to the
method for \code{\LinkA{RGList}{RGList}} objects and indicates whether
local background estimates in the \code{Rb} and \code{Gb} slots of
\code{x} should be subtracted before fitting vsn.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
See \code{\LinkA{vsn2}{vsn2}}.
\end{Details}
\begin{Value}
An \code{\LinkA{ExpressionSet}{ExpressionSet}}.

If \code{x} is an \code{\LinkA{ExpressionSet}{ExpressionSet}}, then the
dimensions and the metadata of the returned object will be the
same, and its matrix of expression values are the normalized and
transformed version of the input.

If \code{x} is an \code{\LinkA{AffyBatch}{AffyBatch}}, probe-wise
background correction and between-array normalization are done by
\code{\LinkA{vsn2}{vsn2}} on the perfect match (PM) values only. Probeset
summaries are calculated with the medianpolish algorithm of
\code{\LinkA{rma}{rma}}.

If \code{x} is an \code{\LinkA{RGList}{RGList}}, then
\code{\LinkA{vsn2}{vsn2}} is applied to the matrix \code{cbind(x\$R, x\$G)}.
If \code{backgroundsubtract=TRUE}, then \code{cbind(x\$Rb, x\$Gb)} is
subtracted before.
\end{Value}
\begin{Author}\relax
Wolfgang Huber \url{http://www.ebi.ac.uk/huber}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{vsn2}{vsn2}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
##--------------------------------------------------
## use "vsn2" to produce a "vsn" object
##--------------------------------------------------
data("kidney")
fit = vsn2(kidney)
nkid = predict(fit, newdata=kidney)

##--------------------------------------------------
## justvsn on ExpressionSet
##--------------------------------------------------
nkid2 = justvsn(kidney)
stopifnot(identical(exprs(nkid), exprs(nkid2)))

##--------------------------------------------------
## justvsn on AffyBatch
##--------------------------------------------------
data("affybatch.example")
data("cdfenv.example")
eabe = justvsn(affybatch.example)

##--------------------------------------------------
## justvsn on RGList
##--------------------------------------------------
rg = new("RGList", list(R=exprs(kidney)[,1,drop=FALSE], G=exprs(kidney)[,2,drop=FALSE]))
erge = justvsn(rg)
\end{ExampleCode}
\end{Examples}

