\Header{exprSetRG-class}{Class exprSetRG for two colour DNA microarray data
(extension of exprSet)}
\alias{as.exprSet}{exprSetRG-class}
\alias{as.exprSet,exprSetRG-method}{exprSetRG-class}
\alias{cbind}{exprSetRG-class}
\alias{cbind,exprSetRG,exprSetRG-method}{exprSetRG-class}
\alias{exprSetRG}{exprSetRG-class}
\alias{getExprSetGreen}{exprSetRG-class}
\alias{getExprSetGreen,exprSetRG-method}{exprSetRG-class}
\alias{getExprSetGreenMinusRed}{exprSetRG-class}
\alias{getExprSetGreenMinusRed,exprSetRG-method}{exprSetRG-class}
\alias{getExprSetLogRatio}{exprSetRG-class}
\alias{getExprSetLogRatio,exprSetRG-method}{exprSetRG-class}
\alias{getExprSetRed}{exprSetRG-class}
\alias{getExprSetRed,exprSetRG-method}{exprSetRG-class}
\alias{getExprSetRedMinusGreen}{exprSetRG-class}
\alias{getExprSetRedMinusGreen,exprSetRG-method}{exprSetRG-class}
\alias{getIndGreen}{exprSetRG-class}
\alias{getIndGreen,exprSetRG-method}{exprSetRG-class}
\alias{getIndRed}{exprSetRG-class}
\alias{getIndRed,exprSetRG-method}{exprSetRG-class}
\alias{initialize,exprSetRG-method}{exprSetRG-class}
\alias{pDataGreen}{exprSetRG-class}
\alias{pDataGreen,exprSetRG-method}{exprSetRG-class}
\alias{pDataRed}{exprSetRG-class}
\alias{pDataRed,exprSetRG-method}{exprSetRG-class}
\alias{pDataSlide}{exprSetRG-class}
\alias{pDataSlide,exprSetRG-method}{exprSetRG-class}
\alias{phenoDataGreen}{exprSetRG-class}
\alias{phenoDataGreen,exprSetRG-method}{exprSetRG-class}
\alias{phenoDataRed}{exprSetRG-class}
\alias{phenoDataRed,exprSetRG-method}{exprSetRG-class}
\alias{phenoDataSlide}{exprSetRG-class}
\alias{phenoDataSlide,exprSetRG-method}{exprSetRG-class}
\alias{show,exprSetRG-method}{exprSetRG-class}
\alias{slideSubset}{exprSetRG-class}
\alias{slideSubset,exprSetRG-method}{exprSetRG-class}
\alias{[,exprSetRG-method}{exprSetRG-class}
\keyword{classes}{exprSetRG-class}
\keyword{methods}{exprSetRG-class}
\begin{Description}\relax
This is a class representation for two colour
DNA microarray data. The class is based on the
class \code{exprSet} of the \code{Biobase} package.
The red and green channels  are stored in a
single \code{exprSet} object. The information on the
corresponding red-green pairs is stored separately.
Several class methods offer a convienent way
to access and set data.
\end{Description}
\begin{Section}{Creating Objects}
\code{  new('exprSetRG',}\\
\code{    channels = ..., \# object of class matrix with columns "green" and "red" }\\
\code{    exprs    = ..., \# object of class matrix}\\
\code{    se.exprs = ..., \# object of class matrix}\\
\code{    phenoData= ..., \# object of class phenoData}\\
\code{    notes    = ..., \# object of class character}\\
\code{    annotation    = ..., \# object of class character}\\
\code{  )}
\end{Section}
\begin{Section}{Slots}
\describe{
\item[\code{indGreen}:] Object of class \code{vector}; indexes of the
green channel
\item[\code{indRed}:] Object of class \code{vector}; indexes of the
red channel
\item[\code{exprs}:] Object of class \code{matrix}; the observed
expression levels. This is a matrix with columns representing
the red and green channels and rows representing genes. Each row
in \code{channels} lists the indexes of the corresponding
pair of red and green channels representing a single
microarray slide.
\item[\code{se.exprs}:] Object of class \code{matrix}; this is
a matrix of the same dimensions as \code{exprs}, e.g. useful to
represent the standard error estimates for the corresponding
expression levels. 
\item[\code{phenoData}:] Object of class \code{phenoData}, i.e.
an instance of class \code{phenoData} 
containing annotation information on the individual channels.
The columns of the pData slot of this entity represent
variables and the rows represent channels. 
\item[\code{notes}:] Object of class \code{character} containing
explanatory text; default: ""
\item[\code{annotation}:] Object of class \code{character};
default: ""
}
\end{Section}
\begin{Section}{Extends}
Class \code{exprSet}, directly.
\end{Section}
\begin{Section}{Methods}
\describe{

\item[show] (exprSetRG):
renders information about the exprSetRG
in a concise way on stdout, cf. class exprSet.

\item[getExprSetLogRatio] (exprSetRG, seExprsHandling):
Returns an \code{exprSet}
object of the difference of the expression levels, i.e. the green
channel minus the red channel. 
The \code{phenoData} slot it the result
of calling the class method \code{phenoDataSlide}
on the object \code{exprSetRG}.
The \code{se.exprs} slot contains
the root-mean-square or the mean of the se.exprs of both channels
depending on the argument \code{seExprsHandling}.
The root-mean-square might be useful if the two
se.exprs values are estimated standard deviations
based on the same number observations and identical
distribution. \code{seExprsHandling} must be a character string;
possible values are "rootMeanSquare" or "mean";
the default value is "rootMeanSquare". 

\item[getExprSetGreenMinusRed] same as method
\code{getExprSetLogRatio} 

\item[getExprSetRedMinusGreen] similar to method
\code{getExprSetLogRatio}; the "negative" difference
of the expression levels is returned, i.e. the red
channel minus the green channel.


\item[getExprSetGreen] (exprSetRG): Returns an \code{exprSet}
object which contains the expression levels of the green channel
and the corresponding annotation.

\item[getExprSetRed] (exprSetRG): Returns an \code{exprSet}
object which contains the expression levels of the red channel
and the corresponding annotation.

\item[phenoDataSlide] (exprSetRG): Returns an \code{phenoData}
object characterizing all microarray slides.
Those annotation information, which is the same for both channels
(and not \code{NA}) is taken directly, e.g. the
the slide number. All other annotation variables are added
specifically for each channel, i.e. prefixed with
"greenSpecific\_" and "redSpecific\_".
Do not use varLabels-names for subsetting.

\item[pDataSlide] (exprSetRG): Returns an \code{pData}
object, i.e. \code{pData(phenoDataSlide(exprSetRG))};
cf. \code{phenoDataSlide}.
Do not use varLabels-names for subsetting.

\item[phenoDataGreen] (exprSetRG): Returns an \code{phenoData}
object of the annotation information given for the green channel.
Do not use varLabels-names for subsetting.

\item[pDataGreen] (exprSetRG): Returns the \code{pData}
object taken out of the result of calling \code{phenoDataGreen}.
Do not use varLabels-names for subsetting.

\item[phenoDataRed] (exprSetRG): Returns an \code{phenoData}
object of the annotation information given for the red channel.
Do not use varLabels-names for subsetting.

\item[pDataRed] (exprSetRG): Returns the \code{pData}
object taken out of the result of calling \code{phenoDataRed}.
Do not use varLabels-names for subsetting.

\item[slideSubset] (exprSetRG,i,j): Subsetting operation; where
i corresponds to the rows  and j corresponds to the
microarray slides.
j is given by indexes or logicals related to the order
of the channel pairs in \code{channels};
cf. the constructor slot \code{channels}.

\item[getIndGreen] (exprSetRG): An accessor function for slot
\code{indGreen}. The corresponding elements of indGreen and indRed
define microarray slides.

\item[getIndRed] (exprSetRG): An accessor function for slot
\code{indRed}. The corresponding elements of indGreen and indRed
define microarray slides.

\item[[] (exprSetRG,i,j,type):
A subset operator.
Ensures that both the data and the annotation
information (\code{phenoData}) are subseted properly.
This may only mix up the pairing of the channels,
i.e. the validity of an exprSetRG,
if you use argument option type == "invalidExprSetRG".
Default: "validExprSetRG".

\item[cbind] (...): Concatenates \code{exprSetRG} objects.
Genes (rows) are assumed to match;
cf. \code{\Link{cbind.exprSetRG}} 

\item[as.exprSet] (exprSetRG): Class cast, returns an object of
\code{exprSet}, the information on the red and green channesl
is discarded.

}
\end{Section}
\begin{Author}\relax
Andreas Buness <a.buness@dkfz.de>
\end{Author}
\begin{SeeAlso}\relax
\code{exprSet-class},
\code{\Link{arrayData-class}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  indGreen=1:3
  indRed=4:6
  channels <- matrix( c(indGreen,indRed), nrow=length(indGreen), byrow=FALSE )
  colnames(channels) <- c("green","red")
  eSA <- new("exprSetRG", exprs=matrix(1:60, ncol=6, nrow=10), phenoData=
          new("phenoData", pData=data.frame(matrix(0,nrow=6,ncol=1)),
              varLabels=list(rep("varLabel1",1))), channels=channels)
  stopifnot( all(pDataSlide(eSA) ==pData(eSA)[1:3,,drop=FALSE]) )
  eSAGreen <- getExprSetGreen(eSA)
  eSARed <- getExprSetRed(eSA)
  eSALogRatio <- getExprSetLogRatio(eSA)
  eSALogRatio2 <- getExprSetGreenMinusRed(eSA)
  eSALogRatio3 <- getExprSetRedMinusGreen(eSA)
  stopifnot( identical( eSALogRatio, eSALogRatio2 ) )
  stopifnot( identical( exprs(eSALogRatio), exprs(eSAGreen)-exprs(eSARed)) )
  stopifnot( all.equal.numeric( exprs(eSALogRatio3), exprs(eSARed)-exprs(eSAGreen)) )
  eSAPart <- eSA[,c(1,3,1,4,6,4)]
  eSAInvalid <- eSA[,c(1,3,1,5,6,4),type="invalidExprSetRG"]
  eSAPart2 <- slideSubset(eSA,j=c(1,3,1))

  eSAeSA <- cbind(eSA, eSA)
  eSAeSAPart2 <- cbind(eSA, eSAPart2)
  stopifnot(is(as.exprSet(eSA), "exprSet"))
  
 \end{ExampleCode}
\end{Examples}

