\HeaderA{slideMerge}{Averaging of two colour microarray replicas}{slideMerge}
\keyword{utilities}{slideMerge}
\begin{Description}\relax
The mean of the expression values is calculated
separately for each channel.
If no \code{se.exprs} values are given
in \code{exprSetRGObject},
\code{se.exprs} is set to the standard deviation
of the expression values
(which is possibly \code{NA}).
If available it is set to the root-mean-square
or the mean of the given \code{se.exprs}
values depending on the
argument \code{seExprsHandling}.
The root-mean-square can be useful if the 
\code{se.exprs} values are estimated standard deviations
based on the same number of observations taken from identical
distributions.
\end{Description}
\begin{Usage}
\begin{verbatim}slideMerge(exprSetRGObject, slideMergeColumn, sampleAnnotationColumns, seExprsHandling="rootMeanSquare", verbose=TRUE)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{exprSetRGObject}] object of class \code{\LinkA{exprSetRG}{exprSetRG}};
required; default missing
\item[\code{slideMergeColumn}] character string specifying the variable
of the \code{phenoData} object of the \code{exprSetRGObject},
which is used to determine replicas; required; default missing
\item[\code{sampleAnnotationColumns}] vector of character strings;
optional; default missing.
A vector which contains all \code{phenoData} variables
relevant for further analysis.
The \code{phenoData}-annotation should be consistent for slide replicas.
By default the argument \code{sampleAnnotationColumns} is missing
and all \code{phenoData} variables are used.
\item[\code{seExprsHandling}] character string;
either "rootMeanSquare" or "mean";
required; default "rootMeanSquare" 
\item[\code{verbose}] logical; required; default: \code{TRUE} 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The \code{phenoData}-annotation should be consistent for slide replicas,
The annotation within the group of replicas is checked for consistency
to assure a meaningful slide merge operation. Any ambiguities are
reported. This reporting shall help to avoid and discover slide
annotation errors. For example if samples are hybridized twice,
the "slideNumber" will not be consistent within the "sampleID"
which is used to determine replicas via the argument
\code{slideMergeColumn}.
\end{Details}
\begin{Value}
object of class \code{\LinkA{exprSetRG-class}{exprSetRG.Rdash.class}}, i.e.
the "merged" \code{exprSetRGObject}
\end{Value}
\begin{Author}\relax
Andreas Buness <a.buness@dkfz.de>
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{spotMerge}{spotMerge}},
\code{\LinkA{exprSetRG-class}{exprSetRG.Rdash.class}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

  indGreen=1:2
  indRed=3:4
  channels <- matrix( c(indGreen,indRed), nrow=length(indGreen), byrow=FALSE )
  colnames(channels) <- c("green","red")
  exprsMatrix <- matrix(rep(1:10,4),nrow=10,ncol=4,byrow=FALSE)
  phenoMatrix <- matrix(c(c(1,2),c(3,3),c(5,5)),nrow=2,ncol=3,byrow=FALSE)
  colnames(phenoMatrix) <- c("one","two","usedForMerge")
  phenoMatrix <- rbind(phenoMatrix,phenoMatrix)
  eSA <- new("exprSetRG", exprs=exprsMatrix, phenoData=
             new("phenoData", pData=data.frame(phenoMatrix, check.names=FALSE),
                 varLabels=as.list(colnames(phenoMatrix))),
             channels=channels)
  eSM <- slideMerge(exprSetRGObject=eSA, slideMergeColumn="usedForMerge")
  eSAOne <- slideSubset(eSA,j=c(1))
  stopifnot( all(exprs(eSAOne) == exprs(eSM) ))
  stopifnot( all( se.exprs(eSM) == 0 ) )

 

        \end{ExampleCode}
\end{Examples}

