slideMerge {arrayMagic}R Documentation

slideMerge

Description

Arguments

exprSetArrayObject object of class exprSetArray
slideMergeVariable character string specifying the variable of the phenoData used to determine replicas
sampleAnnotationColumns vector of character strings; containing all phenoData variables relevant for further analysis. The annotation should be consistent for replicas. By default all phenoData variables are taken, i.e. sampleAnnotationColumns is missing.

Details

Value

modified exprSetArrayObject

Author(s)

Andreas Buness <a.buness@dkfz.de>

See Also

spotMerge

Examples


  indCy3=1:4
  indCy5=5:8
  channels <- matrix( c(indCy3,indCy5), nrow=length(indCy3), byrow=FALSE )
  colnames(channels) <- c("Cy3","Cy5")
  myMatrix <- matrix(c(1:8,rep(1:4,2),c(1,1,1,4,2,2,2,2),c(2,2,2,2,4,1,1,1) ,rep(c(1,1,2,2),2)),nrow=8,ncol=5,byrow=FALSE)
  colnames(myMatrix) <- c("one","two","three","four","merge")
  exprsMatrix <-  matrix(rep(1:10,4), ncol=8, nrow=5, byrow=FALSE) 
  eSA <- new("exprSetArray", exprs=exprsMatrix, phenoData=
                new("phenoData", pData=data.frame(myMatrix),
                varLabels=as.list(colnames(myMatrix))),
              channels=channels)
  eSM <- slideMerge(exprSetArrayObject=eSA, slideMergeVariable="merge")
  stopifnot( all(  dim(exprs(eSM)) == c(5,4) ) )
  stopifnot( all(as.matrix(pData((phenoDataSlide(eSM)[,which(varLabels(phenoDataSlide(eSM)) == "slidesInGroup")]))) == matrix(c("1;2","3;4"),ncol=1,nrow=2)) )
          exprs(eSM)
  stopifnot( all(exprs(getExprSetCy3(eSM)) == cbind(rowMeans(exprs(getExprSetCy3(eSA))[,1:2]), rowMeans(exprs(getExprSetCy3(eSA))[,3:4]))))
  stopifnot( all(exprs(getExprSetCy5(eSM)) == cbind(rowMeans(exprs(getExprSetCy5(eSA))[,1:2]), rowMeans(exprs(getExprSetCy5(eSA))[,3:4]))))
  stopifnot(se.exprs(getExprSetCy3(eSM)) == cbind(as.matrix(apply((exprs(getExprSetCy3(eSA))[,1:2]),1,sd)), as.matrix(apply((exprs(getExprSetCy3(eSA))[,3:4]),1,sd))))
  stopifnot(se.exprs(getExprSetCy5(eSM)) == cbind(as.matrix(apply((exprs(getExprSetCy5(eSA))[,1:2]),1,sd)), as.matrix(apply((exprs(getExprSetCy5(eSA))[,3:4]),1,sd))))
  # one and two are inconsistent in both channels
  stopifnot( all(unlist(varLabels(phenoDataSlide(eSM))) == c("one","two","merge","slidesInGroup")) )

        

[Package Contents]