tsLib-class           package:TargetSearch           R Documentation

_C_l_a_s_s _f_o_r _r_e_p_r_e_s_e_n_t_i_n_g _a _r_e_f_e_r_e_n_c_e _l_i_b_r_a_r_y

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

     This is a class representation of a reference library.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by the function 'ImportLibrary'.

_S_l_o_t_s:


     '_N_a_m_e': '"character"', the metabolite or analyte names.

     '_R_I': '"numeric"', the expected retention time indices (RI) of the
          metabolites/analytes.

     '_m_e_d_R_I': '"numeric"', the median RI calculated from the samples.

     '_R_I_d_e_v': '"matrix"', the RI deviation windows, k = 1,2,3. A three
          column matrix

     '_s_e_l_M_a_s_s': '"list"', every component is a numeric vector
          containing the selective masses. 

     '_t_o_p_M_a_s_s': '"list"', every component is a numeric vector
          containing the top masses. 

     '_l_i_b_D_a_t_a': '"data.frame"', additional library information. 

     '_s_p_e_c_t_r_a': '"list"', the metabolite spectra. Each component is a
          two column matrix: m/z and intensity. 

_M_e_t_h_o_d_s:


     '[' 'signature(x = "tsLib")': Selects a subset of metabolites from
          the library.

     '$_n_a_m_e' 'signature(x = "tsLib")': Access column 'name' of
          'libData' slot. 

     '_l_i_b_I_d' 'signature(obj = "tsLib")': Returns a vector of indices. 

     '_l_e_n_g_t_h' 'signature(x = "tsLib")': returns the length of the
          library. i.e., number of metabolites.

     '_l_i_b_D_a_t_a' 'signature(obj = "tsLib")': gets the 'libData' slot.

     '_l_i_b_N_a_m_e' 'signature(obj = "tsLib")': gets the 'Name' slot. 

     '_l_i_b_R_I' 'signature(obj = "tsLib")': gets the 'RI' slot.  

     '_m_e_d_R_I' 'signature(obj = "tsLib")': gets the 'medRI' slot.  

     '_r_e_f_L_i_b' 'signature(obj = "tsLib")': Low level method to create a
          matrix representation of the library.

     '_R_I_d_e_v' 'signature(obj = "tsLib")': gets the RI deviations. 

     '_R_I_d_e_v<-' 'signature(obj = "tsLib")': sets the RI deviations. 

     '_s_e_l_M_a_s_s' 'signature(obj = "tsLib")': gets the selective masses. 

     '_s_h_o_w' 'signature(object = "tsLib")': show method. 

     '_s_p_e_c_t_r_a' 'signature(obj = "tsLib")': gets the spectra. 

     '_t_o_p_M_a_s_s' 'signature(obj = "tsLib")': gets the top masses. 

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

     Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

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

     'ImportLibrary'

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

     showClass("tsLib")

     # define some metabolite names
     libNames   <- c("Metab1", "Metab2", "Metab3")
     # the expected retention index
     RI         <- c(100,200,300)
     # selective masses to search for. A list of vectors.
     selMasses  <- list(c(95,204,361), c(87,116,190), c(158,201,219))
     # define the retention time windows to look for the given selective masses.
     RIdev      <- matrix(rep(c(10,5,2), length(libNames)), ncol = 3, byrow = TRUE)
     # Set the mass spectra. A list object of two-column matrices, or set to 
     # an empty list if the spectra is not available
     spectra    <- list()
     # some extra information about the library
     libData    <- data.frame(Name = libNames, Lib_RI = RI)
     # create a reference library object
     refLibrary <- new("tsLib", Name = libNames, RI = RI, medRI = RI, RIdev = RIdev,
                             selMass = selMasses, topMass = selMasses, spectra = spectra, libData = libData) 

     # get the metabolite names
     libName(refLibrary)
     # set new names
     libName(refLibrary) <- c("Metab01", "Metab02", "Metab03")

     # get the expected retention times
     libRI(refLibrary)
     # set the retention time index for metabolite 3 to 310 seconds
     libRI(refLibrary)[3] <- 310
     # change the seleccion and top masses of metabolite 3
     selMass(refLibrary)[[3]] <- c(158,201,219,220,323)
     topMass(refLibrary)[[3]] <- c(158,201,219,220,323)
     # change the retention time deviations
     RIdev(refLibrary)[3,] <- c(8,4,1)

