plotRIdev            package:TargetSearch            R Documentation

_P_l_o_t _R_e_t_e_n_t_i_o_n _T_i_m_e _I_n_d_e_x _D_e_v_i_a_t_i_o_n

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

     'plotRIdev' plots the Retention Time Index Deviation of a given
     set of metabolites. 'plotAllRIdev' saves the plots of the RI
     deviations of all the metabolites in the library object into a PDF
     file.

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

     plotRIdev(Lib, peaks, libId = 1)

     plotAllRIdev(Lib, peaks, pdfFile, width = 8, height = 8, ...)

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

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

   peaks: A 'tsMSdata' object. See 'peakFind'.

   libId: A numeric vector providing the indices of the metabolites to
          plot.

 pdfFile: A file name where the plot will be saved. Only
          'plotAllRIdev'. 

width, height: The width and height of the plots in inches. Only
          'plotAllRIdev'. 

     ...: Further options passed to 'pdf'. 

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

     Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

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

     'ImportLibrary', 'tsLib', 'tsMSdata', 'pdf'

_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

     peakData <- peakFind(sampleDescription, refLibrary, corRI)

     # Plot RI deviation of metabolite "Valine"
     grep("Valine", libName(refLibrary)) # answer: 3
     plotRIdev(refLibrary, peakData, libId = 3)

     # Plot an RI deviation overview of the first nine metabolites
     plotRIdev(refLibrary, peakData, libId = 1:9)

     # Save all RI deviation into a pdf file
     plotAllRIdev(refLibrary, peakData, pdfFile = "RIdeviations.pdf")

