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. 

     _a_s._R_G_L_i_s_t (arrayData): Returns an object of 'RGList'. Foreground
          and background intensity values of 'intensities' are returned
          in form of an 'RGList' object. If no background is given, all
          background values in the RGList object are set to zero.

     _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( class(aD) == "arrayData" )
      

