medianRILib           package:TargetSearch           R Documentation

_M_e_d_i_a_n _R_I _l_i_b_r_a_r_y _c_o_r_r_e_c_t_i_o_n

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

     Return a 'tsLib' object with the median RI of the selective masses
     across samples.

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

     medianRILib(samples, Lib, makeReport = FALSE, pdfFile = "medianLibRep.pdf",
             columns = c("SPECTRUM", "RETENTION_TIME_INDEX"), showProgressBar = FALSE)

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

 samples: A 'tsSample' object created by 'ImportSamples' function. 

     Lib: A 'tsLib' object created by 'ImportLibrary' function. 

makeReport: Logical. If 'TRUE' will report the RI deviations for every
          metabolite in the library. 

 pdfFile: The file name where the report will be saved. 

 columns: A numeric vector with the positions of the columns 'SPECTRUM'
          and 'RETENTION_TIME_INDEX' or a character vector with the
          header names of those columns. 

showProgressBar: Logical. Should the progress bar be displayed?

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

     A 'tsLib' object. It will update the slot 'med_RI' which contains
     the median RI of every searched metabolite.

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

     Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

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

     'ImportSamples', 'ImportLibrary', 'tsLib-class'

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

     require(TargetSearchData)
     data(TargetSearchData)

     # get RI file path
     RI.path <- file.path(.find.package("TargetSearchData"), "gc-ms-data")
     # update RI file path
     RIpath(sampleDescription) <- RI.path
     # update median RI
     refLibrary        <- medianRILib(sampleDescription, refLibrary)

     # perhaps you need to adjust the library RI of one metabolite and the allowed time
     # deviation (first time deviation window)
     libRI(refLibrary)[5] <- 306500
     RIdev(refLibrary)[5,1] <- 2000

     refLibrary        <- medianRILib(sampleDescription, refLibrary)

