NetCDFPeakFinding        package:TargetSearch        R Documentation

_P_e_a_k _p_i_c_k_i_n_g _a_l_g_o_r_i_t_h_m _f_r_o_m _C_D_F _f_i_l_e_s

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

     This function reads a netcdf chromatogram file, finds the apex
     intensities and returns a list containing the retention time and
     the intensity matrices.

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

     NetCDFPeakFinding(cdfFile, massRange = c(85, 500), Window = 5, IntThreshold = 10,
                       pp.method = "smoothing")

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

 cdfFile: A character string naming a netcdf file.

massRange: A two component numeric vector with the scan mass range to
          extract.

  Window: The window used by peak picking method. 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: The pick picking method to be used. Options are
          '"smoothing"' and '"ppc"'.

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

     The function expects the following NetCDF variables:
     'intensity_values', 'mass_values', 'scan_index', 'point_count' and
     'scan_acquisition_time'. Otherwise, an error will be displayed.

     The 'massRange' parameter is a numeric vector with two components:
     lower and higher masses. All masses in that range will be
     extracted. Note that it is not possible to extract a discontinuous
     mass range.

     There are two peak picking algorithms that can be used. The
     '"smoothing"' method smooths the m/z curves and then looks for a
     change of sign of the intensity difference between two consecutive
     points. The '"ppc"' uses a sliding window and looks for the local
     maxima. This method is based on R-package 'ppc'.

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

     A two component list. 

    Time: The retention time vector.

   Peaks: The intensity matrix. Rows are the retention times and
          columns are masses. The first column is the lower mass value
          and the last one is the higher mass. 

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

     Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

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

     'peakCDFextraction'

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

     require(TargetSearchData)
     data(TargetSearchData)
     CDFpath <- file.path(.find.package("TargetSearchData"), "gc-ms-data")
     CDFfiles <- dir(CDFpath, pattern = "\.cdf$", full.names = TRUE)
     CDFfiles

     # extrac peaks of first chromatogram
     peaks.1 <- NetCDFPeakFinding(CDFfiles[1], massRange = c(85, 320), Window = 15,
                              IntThreshold = 10, pp.method = "smoothing")
     # scan acquisition times
     head(peaks.1$Time)
     # peaks in matrix form. first column is mass 85, last one is mass 320.
     head(peaks.1$Peaks)

