detectReplicas          package:arrayMagic          R Documentation

_d_e_t_e_c_t_R_e_p_l_i_c_a_s

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

     The function returns for each unique item all corresponding
     indexes.

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

     detectReplicas(arrayDescription, spotIdentifier = "ID", identifiersToBeSkipped = NULL, verbose = TRUE)

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

arrayDescription: an object of class 'data.frame' which contains a
          column named as 'spotIdentifier'; required; default missing 

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

identifiersToBeSkipped: vector of character strings; required; default:
          'NULL'; items of the column 'spotIdentifier' for which no
          replica detection takes place

 verbose: logical; required; default: 'TRUE'

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

     A list which contains 'nrOfReplicas' and 'spotReplicas'. 
     'nrOfReplicas': one integer characterizing the number of spot
     replicas given for each identifier if existing or otherwise  'NA'.
     'spotReplicas': a list of the length of the unique identifiers
     where each element contains a vector of indexes corresponding to
     the given identifier (i.e. the name of the list element) otherwise
     'NA'.

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

     Andreas Buness <a.buness@dkfz.de>

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

     aD <- data.frame(ID=c("z", "x", "x", "x", "y", "z", "z", "y", "y"))
     re <- detectReplicas(aD, identifiersToBeSkipped = c("Blank", "Control1", "Control2"))
     stopifnot(re[["nrOfReplicas"]] == 3 )
     stopifnot( re$spotReplicas[["z"]] == c(1,6,7) )
     stopifnot( re$spotReplicas[["x"]] == c(2,3,4) )
     stopifnot( re$spotReplicas[["y"]] == c(5,8,9) )

     aD <- data.frame(ID=c("Blank", "Control1", "Blank", "Control2"))
     re <- detectReplicas(aD, identifiersToBeSkipped = c("Blank", "Control1", "Control2"))
     stopifnot(is.na(re[["nrOfReplicas"]]))

      
       

