spotMerge             package:arrayMagic             R Documentation

_A_v_e_r_a_g_i_n_g _o_f _s_p_o_t _r_e_p_l_i_c_a_s

_D_e_s_c_r_i_p_t_i_o_n:

     The mean of replicated spots with identical number of replicas is
     calculated by default for each channel separately (note:
     'spotMerge' does require an equal number of replicas). Other
     summarization functions can be applied if supplied as argument
     (cf. argument 'mergeFunc') All other spots need to be eliminated
     with the help of the argument 'identifiersToBeSkipped'. The mean
     (if not otherwise specified via argument 'mergeFunc') is
     calculated for the expression levels 'exprs' of the
     'exprSetRGObject' and for the 'intensities' and 'weights' of the
     'arrayDataObject'. Any existing 'se.exprs'-'matrix' as part of
     'exprSetRGObject' is discarded. The standard deviation of the spot
     merge operation for the expression values is returned as
     'se.exprs'. The corresponding rows of 'spotAttr' in
     'arrayDataObject' are concatenated and form a single row of
     respectively more columns.

_U_s_a_g_e:

     spotMerge(exprSetRGObject, arrayDataObject, spotIdentifier="Name", identifiersToBeSkipped=NULL, mergeFunc=mean)

_A_r_g_u_m_e_n_t_s:

arrayDataObject: object of type 'arrayData'; required; default: missing

exprSetRGObject: object of type 'exprSetRG'; required; default: missing

spotIdentifier: character string; required; default: "Name" 

identifiersToBeSkipped: vector of character strings, all spots which
          identifiers match are skipped;  required; default: 'NULL'

mergeFunc: function; required; default: 'mean'

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     A list containing the "merged" 'exprSetRGObject' and
     'arrayDataObject'.

_A_u_t_h_o_r(_s):

     Andreas Buness <a.buness@dkfz.de>

_S_e_e _A_l_s_o:

     'processArrayData', 'slideMerge', 'exprSetRG-class',
     'arrayData-class'

_E_x_a_m_p_l_e_s:

         intensities <- array(data=runif(600),dim=c(100,2,3))
         dimnames(intensities) <- list(NULL, c("green","red"), NULL)
         spotAttr <- data.frame(Name=I(c("y","x","k","l","z")[gl(5,20)]),
                                Zahl=rep(c(1,2,3,4,5),20),
                                Index=c(1:100))
         arrayDataObject <- new("arrayData", intensities=intensities, weights=intensities[,1,],
                                spotAttr=spotAttr, hybAttrList=NULL)
         indGreen=1:3
         indRed=4:6
         channels <- matrix( c(indGreen,indRed), nrow=length(indGreen), byrow=FALSE )
         colnames(channels) <- c("green","red")
         exprMatrix <- matrix(data=1:600,nrow=100,ncol=6,byrow=FALSE)
         pD <- data.frame(matrix(0,nrow=6,ncol=1))
         exprSetRGObject <- new("exprSetRG", exprs=exprMatrix, se.expr=exprMatrix,
                                   phenoData=new("phenoData",
                                     pData= pD,varLabels=list(rep("varLabel1",1))),
                                   channels=channels)
         resultList <- spotMerge(arrayDataObject=arrayDataObject,exprSetRGObject=exprSetRGObject, identifiersToBeSkipped=c("x","z"))
         resultExprSetRG <- resultList[["exprSetRGObject"]]
         resultY <- (0:5)*100 + sum(1:20)/20
         stopifnot( all( all(exprs(resultExprSetRG)["y",] == resultY) ) )
         resultK <- (0:5)*100 + sum(41:60)/20
         stopifnot( all( all(exprs(resultExprSetRG)["k",] == resultK) ) )
         resultL <- (0:5)*100 + sum(61:80)/20
         stopifnot( all( all(exprs(resultExprSetRG)["l",] == resultL) ) )
         stopifnot( dim(exprs(resultExprSetRG))[1] == 3 )
         stopifnot( dim(exprs(resultExprSetRG))[2] == 6 )
         resultArrayData <- resultList[["arrayDataObject"]]
         stopifnot( all(getIntensities(resultArrayData)[,1,] == getWeights(resultArrayData)) )
         nameColumns <- grep("Name", colnames(getSpotAttr(resultArrayData)))
         zahlColumns <- grep("Zahl", colnames(getSpotAttr(resultArrayData)))
         indexColumns <- grep("Index", colnames(getSpotAttr(resultArrayData)))
         stopifnot( all(getSpotAttr(resultArrayData)["y",nameColumns] == rep ("y", 20 ) ))
         stopifnot( all(getSpotAttr(resultArrayData)["y",indexColumns] == 1:20 ) )
         stopifnot( all(getSpotAttr(resultArrayData)["y",zahlColumns] == rep (1:5, 4 ) ))

      
         

             

