summarizeChannels          package:cellHTS2          R Documentation

_S_u_m_m_a_r_i_z_a_t_i_o_n _o_f _d_u_a_l-_c_h_a_n_n_e_l _d_a_t_a

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

     Combines plate intensities (raw or already corrected in a
     per-plate fashion) from dual-channel data stored in slot
     'assayData' of a 'cellHTS' instance by applying the function
     defined in 'fun'.

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

     summarizeChannels(object,
         fun = function(r1, r2, thresh) ifelse(r1>thresh, r2/r1, as.numeric(NA)))

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

  object: an object of class 'cellHTS' that has been configured. See
          details.

     fun: a user-defined function for the two channel summarization.
          'fun' takes two numeric vectors and returns a numeric vector
          of the same length. The default is to take the ratio between
          the second and first channels, with a threshold on 'r1' shown
          above in the _Usage_ section that should be set by the user.

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

     For each plate and replicate of a two-color experiment, the
     function defined in 'fun' is applied to relate the intensity
     values in the two channels of the 'cellHTS' object. The default is
     to  take the ratio between the second and first channels, with a
     threshold on  'r1' (see the _Usage_ section). This threshold
     should be adjusted by the  user according to the data. For an
     example, see the _Examples_ section. This function uses the
     content of slot 'assayData' of 'object' and can be applied either
     to raw data or after per-plate correction of the intensity values
     in each channel using function 'normalizePlates'. This choice
     depends on channel summarization method that one intends to apply
     (i.e., the function given by argument 'fun').

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

     An object of class 'cellHTS' with the summarized dual-channel
     intensities stored in slot 'assayData'. This is an object of class
     'assayData' containing one matrix with the summarized channel data
     (dimensions nrFeatures x nrSamples).

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

     Ligia Bras ligia@ebi.ac.uk, Wolfgang Huber huber@ebi.ac.uk

_R_e_f_e_r_e_n_c_e_s:

     Boutros, M., Bras, L.P. and Huber, W. (2006) Analysis of
     cell-based RNAi screens, _Genome Biology_ *7*, R66.

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

     'normalizePlates', 'scoreReplicates', 'summarizeReplicates'.

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

         data(dualCh)
         x <- dualCh
         table(wellAnno(x))

         ## Define the controls for the different channels:
         negControls=vector("character", length=dim(Data(x))[3])

         ## channel 1 - gene A
         ## case-insensitive and match the empty string at the beginning and end of a line (to distinguish between "geneA" and "geneAB", for example, although this is not a problem for the well annotation in this example)

         negControls[1]= "(?i)^geneA$"  
         ## channel 2 - gene A and geneB
         negControls[2]= "(?i)^geneA$|^geneB$" 
         posControls = vector("character", length=dim(Data(x))[3])
         ## channel 1 - no controls
         ## channel 2 - geneC and geneD
         posControls[2]="(?i)^geneC$|^geneD$"
      ## Not run: 
         writeReport(cellHTSlist=list("raw"=x), map=TRUE, plotPlateArgs=TRUE, posControls=posControls, negControls=negControls)
      
     ## End(Not run)
         ## In this example, we first normalize each channel separately by 
         ## plate median scaling (no variance adjustment), since we need to make the measurements 
         ## comparable across plates for the next step of channel summarization:
             xn = normalizePlates(x, scale="multiplicative", log=FALSE, method="median", varianceAdjust="none") 
         ## Then, we define a low intensity threshold for the measurements in the constitutive channel R1, 
         ## which will be set to the 5
         ## and take the ratio R2/R1.
             xn = summarizeChannels(xn, fun = function(r1, r2, 
                  thresh=quantile(r1, probs=0.05, na.rm=TRUE)) ifelse(r1>thresh, r2/r1, as.numeric(NA))) 
         ## After channel summarization, we take the log2 and apply plate median normalization, 
         ## and opt to not adjust the variance:
         xn = normalizePlates(xn, scale="multiplicative", log=TRUE, method="median", varianceAdjust="none") 
         ## Define the controls for the normalized and summarized intensities (only one channel):
         negControls = vector("character", length=dim(Data(xn))[3])
         ## For the single channel, the negative controls are geneA and geneB 
         negControls[1]= "(?i)^geneA$|^geneB$" 
         posControls = vector("character", length=dim(Data(xn))[3])
         ## For the single channel, the negative controls are geneC and geneD 
         posControls[1]="(?i)^geneC$|^geneD$"
      ## Not run: 
         writeReport(cellHTSlist=list("raw"=x, "normalized"=xn), force=TRUE, map=TRUE, plotPlateArgs=list(xrange=c(-3,3)), 
              posControls=posControls, negControls=negControls)
      
     ## End(Not run)

         ## Another option could be to just take the log2 of the ratio between R2 and R1 raw intensities:
         xn1 = summarizeChannels(x, fun = function(r1, r2) log2(r2/r1)) 

