arrayData-class          package:arrayMagic          R Documentation

_C_l_a_s_s _a_r_r_a_y_D_a_t_a, _a _s_i_m_p_l_e _c_o_n_t_a_i_n_e_r _f_o_r
_r_a_w _d_a_t_a _a_n_d _r_e_l_a_t_e_d _i_n_f_o_r_m_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     A simple class to store raw data, annotation information for spots
     and hybridisations, as well as weights.

_C_r_e_a_t_i_n_g _O_b_j_e_c_t_s:

     '  new('arrayData','
      '    intensities = ..., # optional; object of class array'
      '    weights     = ..., # optional; object of class matrix'
      '    spotAttr    = ..., # optional; object of class data.frame'
      '    hybAttrList = ..., # optional; list of two objects of class
     data.frame'
      '  )'

_S_l_o_t_s:

     '_i_n_t_e_n_s_i_t_i_e_s': Object of class 'array'; three-dimensional; dim =
          nrOfSpots x nrOfChannels x nrOfHybridisations; second
          dimension must contain "green"  and "red" and possibly
          "greenBackground" and "redBackground"; default: 'NULL'

     '_w_e_i_g_h_t_s': Object of class 'matrix'; dim = nrOfSpots x
          nrOfHybridisations; range = [0,1]; default: 'NULL'.

     '_s_p_o_t_A_t_t_r': Object of class 'data.frame'; dim = nrOfSpots x
          nrOfSpotCharacteristics; default: 'NULL'

     '_h_y_b_A_t_t_r_L_i_s_t': list of two objects named "green" and "red" of
          class 'data.frame'; the dimension of each 'data.frame' is
          given by nrOfHybridisations x
          nrOfHybridisationCharacteristics ; default: 'NULL'

_M_e_t_h_o_d_s:


     _i_n_t_e_n_s_i_t_i_e_s<- (arrayData): Set the 'intensities' of 'arrayData'. 

     _g_e_t_I_n_t_e_n_s_i_t_i_e_s (arrayData): Returns the 'intensities' 'array'.

     _w_e_i_g_h_t_s<- (arrayData): Set the 'weights' of 'arrayData'. 

     _g_e_t_W_e_i_g_h_t_s (arrayData): Returns the 'weights' object. 

     _s_p_o_t_A_t_t_r<- (arrayData): Set the 'spotAttr' of 'arrayData'. 

     _g_e_t_S_p_o_t_A_t_t_r (arrayData): Returns the 'spotAttr' 'data.frame'.

     _g_e_t_H_y_b_A_t_t_r (arrayData): Returns the "intersection" of the "red"
          and "green" 'data.frame' of 'hybAttrList' or if one is 'NULL'
          the other one. The "intersection" are those columns which
          match in column name and its content otherwise 'NULL' is
          returned.

     _g_e_t_H_y_b_A_t_t_r_G_r_e_e_n (arrayData): Returns the "green" list element  of
          'hybAttrList', i.e. a 'data.frame'. 

     _g_e_t_H_y_b_A_t_t_r_R_e_d (arrayData): Returns the "red" list element of
          'hybAttrList', i.e. a 'data.frame'. 

     _h_y_b_A_t_t_r_L_i_s_t<- (arrayData): Set the 'hybAttrList' of 'arrayData'. 

     _g_e_t_H_y_b_A_t_t_r_L_i_s_t (arrayData): Returns the 'hybAttrList' object. 

     _s_h_o_w (arrayData): Renders information about the 'arrayData' object
          on standard out.

     [ (arrayData,i,j): A subset operator, where i corresponds to the
          spots and j to the hybridisations.

     _c_b_i_n_d (...): Concatenates 'arrayData' objects. Spots/rows are
          assumed to match; possibly you have to subset and reorder the
          objects beforehand cf. function 'cbind.arrayData'.


_A_u_t_h_o_r(_s):

     Andreas Buness <a.buness@dkfz.de>

_S_e_e _A_l_s_o:

     'exprSetRG-class'

_E_x_a_m_p_l_e_s:

     intensities <- array(data=runif(120),dim=c(20,2,3))
     dimnames(intensities) <- list(NULL, c("green","red"), NULL)
     spotAttr <- data.frame(Name=I(rep(c("x","y","k","l","z"),4)),
                            Index=c(1:20))
     arrayDataObject <- new("arrayData", intensities=intensities, weights=intensities[,1,],
                            spotAttr=spotAttr, hybAttrList=NULL)
     print(arrayDataObject)
     hybs <- c(1,3)
     spots <- c(1:10, 14)
     aD <- arrayDataObject[spots,hybs]
     print(aD)
     stopifnot( all( getIntensities(arrayDataObject)[spots, , hybs] == getIntensities(aD) ) )
     stopifnot( all( getWeights(arrayDataObject)[spots, hybs] == getWeights(aD) ) )
     stopifnot( all( getSpotAttr(arrayDataObject)[spots, ] == getSpotAttr(aD) ) )

     hybAttr <- data.frame(Name=I(c("hx","hy","hz")),
                           Index=c(1:3))
     arrayDataObject <- new("arrayData", intensities=intensities, weights=intensities[,1,],
                            spotAttr=spotAttr, hybAttrList=list(green=hybAttr,red=hybAttr))
     hybAttrGreen <- data.frame(Name=I(c("hx","hy","hz")),
                           Index=c(4:6))
     aDObject <- new("arrayData", intensities=intensities, weights=intensities[,1,],
                            spotAttr=spotAttr, hybAttrList=list(green=hybAttrGreen,red=hybAttr))
     print(arrayDataObject)
     cbind(aDObject,aDObject)
     hybs <- c(1)
     spots <- c(1)
     aD <- arrayDataObject[spots,hybs]
     print(aD)
     stopifnot( all( getIntensities(arrayDataObject)[spots, , hybs] == getIntensities(aD) ) )
     stopifnot( all( getWeights(arrayDataObject)[spots, hybs] == getWeights(aD) ) )
     stopifnot( all( getSpotAttr(arrayDataObject)[spots, ] == getSpotAttr(aD) ) )
     stopifnot( all( getHybAttr(arrayDataObject)[spots, ] == getHybAttr(aD) ) )
     stopifnot( all( getHybAttrRed(arrayDataObject)[spots, ] == getHybAttrRed(aD) ) )
     stopifnot( all( getHybAttrGreen(arrayDataObject)[spots, ] == getHybAttrGreen(aD) ) )

     stopifnot( all( getHybAttrRed(aDObject) == hybAttr) )
     stopifnot( all( getHybAttrGreen(aDObject) == hybAttrGreen) )
     stopifnot( all( getHybAttr(aDObject) == data.frame(Name=I(c("hx","hy","hz"))) ) )
     weights(aDObject) <- intensities[,2,]
     intensities(aDObject) <- intensities
     spotAttr(aDObject) <- spotAttr
     hybAttrList(aDObject) <- list(green=hybAttr,red=hybAttrGreen)
     aD <- new("arrayData")
     stopifnot(is(aD, "arrayData"))
      

