RIcorrect            package:TargetSearch            R Documentation

_P_e_a_k _p_i_c_k_i_n_g _f_r_o_m _C_D_F _f_i_l_e_s _a_n_d _R_I _c_o_r_r_e_c_t_i_o_n

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

     This function reads from CDF files, finds the apex intensities,
     converts the retention time to retention time index (RI), and
     writes RI corrected text files.

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

     RIcorrect(samples, rimLimits = NULL, massRange, Window, IntThreshold, 
             pp.method = "smoothing", showProgressBar = FALSE)

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

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

rimLimits: A 'tsRim' object. If set to 'NULL', no retention time will
          be performed. See 'ImportFameSettings'.

massRange: A two component vector of m/z range used by the GC-MS
          machine. 

  Window: The window used for smoothing. The number of points actually
          used is '2*Window + 1'. 

IntThreshold: Apex intensities lower than this value will be removed
          from the RI files. 

pp.method: Peak picking method. Options are either "smoothing" or
          "ppc". See details. 

showProgressBar: Logical. Should the progress bar be displayed?

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

     There are two pick picking methods available: "smoothing" and
     "ppc". 

     The "smoothing" method calculates a moving average of '2*Window +
     1' points for every mass trace. Then it looks for a change of sign
     (from positive to negative) of the difference between two
     consecutive points. Those points will be returned as detected
     peaks.

     The "ppc" method implements the peak detection method described in
     the 'ppc' package. It looks for the local maxima within a
     '2*Window + 1' scans for every mass trace.

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

     A retention time matrix of the found retention time markers. Every
     column represents a sample and rows RT markers.

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

     Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

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

     'ImportSamples', 'ImportFameSettings',  'NetCDFPeakFinding',
     'FAMEoutliers', 'tsSample', 'tsRim'.

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

     require(TargetSearchData)
     # import refLibrary, rimLimits and sampleDescription.
     data(TargetSearchData)
     # get the CDF files
     cdfpath <- file.path(.find.package("TargetSearchData"), "gc-ms-data")
     cdfpath
     list.files(cdfpath)
     # update the CDF path
     CDFpath(sampleDescription) <- cdfpath
     # run RIcorrect (massScanRange = 85-320; Intensity Threshold = 50;
     # peak detection method = "ppc", window = 15)
     RImatrix <- RIcorrect(sampleDescription, rimLimits, massRange = c(85,320), 
                 Window = 15, pp.method = "ppc", IntThreshold = 50)

     # you can try other parameters and other peak picking algorithm.
     RImatrix <- RIcorrect(sampleDescription, rimLimits, massRange = c(85,320), 
                 Window = 15, pp.method = "smoothing", IntThreshold = 10)

     RImatrix <- RIcorrect(sampleDescription, rimLimits, massRange = c(85,320), 
                 Window = 15, pp.method = "ppc", IntThreshold = 100)

