\Header{normalize.AffyBatch.vsn}{Wrapper for vsn to be used as a normalization method in the package affy}
\keyword{robust}{normalize.AffyBatch.vsn}
\begin{Description}\relax
Wrapper for \code{\Link{vsn}} to be used as a normalization method in the package affy
\end{Description}
\begin{Usage}
\begin{verbatim}normalize.AffyBatch.vsn(abatch, subsample=20000, niter = 4, strata, ...)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{abatch}] An object of type \code{\Link{AffyBatch}}.
\item[\code{subsample}] The number of probes to be sampled for the fit of the transformation parameters.
\item[\code{niter}] Parameter passed on to \code{\Link{vsn}}.
\item[\code{strata}] Integer vector of length nrow(y). See 
\code{\Link{vsn}} for details.
\item[\code{...}] Further parameters for \code{\Link{vsn}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Please refer to the "details" and "references" sections of the man page for
\code{\Link{vsn}} for more details about this method.

\bold{Important note}: after calling \code{\Link{vsn}}, the function
\code{normalize.AffyBatch.vsn} \bold{exponentiates} the data. This is done in
order to make the behavior of this function similar to the other
normalization methods in affy. There, it is assumed that in subsequent
analysis steps (e.g. in \code{\Link{medianpolish}}), the logarithm to
base 2 needs to be taken.
\end{Details}
\begin{Value}
An object of class \code{\Link{AffyBatch}}.
\end{Value}
\begin{Author}\relax
Wolfgang Huber \url{mailto:w.huber@dkfz.de}
\end{Author}
\begin{SeeAlso}\relax
\code{\Link{vsn}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
### The example has been commented out because it takes a long time.
### Please also refer to the vignette.

## library(affy)
## library(affydata)
## data(Dilution)

### let affy know about vsn
## normalize.AffyBatch.methods <- c(normalize.AffyBatch.methods, "vsn")

## es1 = expresso(Dilution[1:2], 
##        bg.correct       = FALSE,   ## bg correction is done by vsn
##        normalize.method = "vsn",
##        pmcorrect.method = "pmonly", 
##        summary.method   = "medianpolish")

## es2 = expresso(Dilution[1:2], 
##        bgcorrect.method = "rma",
##        normalize.method = "quantiles", 
##        pmcorrect.method = "pmonly",
##        summary.method   = "medianpolish")

## par(mfrow=c(2,2), pch=".")

### extract expression values
## x1 = exprs(es1)
## x2 = exprs(es2) 
 
### scatter plot
## plot(x1, main="vsn: chip 3 vs 4")
## plot(x2, main="rma: chip 3 vs 4")

### rank(mean) - difference plot
## ylim = c(-0.7, 0.7)
## plot(rank(rowSums(x1)), diff(t(x1)), ylim=ylim, main="rank(mean) vs differences")
## abline(h=0, col="red")

## plot(rank(rowSums(x2)), diff(t(x2)), ylim=ylim, main="rank(mean) vs differences")
## abline(h=0, col="red")
\end{ExampleCode}
\end{Examples}

