plotPeak            package:TargetSearch            R Documentation

_P_l_o_t _p_e_a_k_s

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

     Plot selected ions in a given time range.

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

     plotPeak(rawpeaks, time.range, masses, cdfFile = NULL,  useRI = FALSE,
              rimTime = NULL, standard = NULL, massRange = c(85, 500), ...)

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

rawpeaks: A two component list containing the retention time and the
          intensity matrices. See 'peakCDFextraction'. 

time.range: The time range to plot in retention time or retention time
          index units to plot. 

  masses: A vector containing the ions or masses to plot. 

 cdfFile: The name of a CDF file. If a file name is specified, the ions
          will be extracted from there instead of using 'rawpeaks'. 

   useRI: Logical. Whether to use Retention Time Indices or not.

 rimTime: A retention time matrix of the found retention time markers.
          It is only used when 'useRI' is 'TRUE'.

standard: A numeric vector with RI values of retention time markers. It
          is only used when 'useRI' is 'TRUE'.

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

     ...: Further options passed to 'matplot'. 

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

     Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

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

     'RIcorrect', 'tsMSdata', 'tsRim', 'peakCDFextraction', 'matplot'

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

     require(TargetSearchData)
     data(TargetSearchData)

     # update CDF path
     CDFpath(sampleDescription) <- file.path(.find.package("TargetSearchData"), "gc-ms-data")

     # Plot the peak "Valine" for sample number 1
     grep("Valine", libName(refLibrary)) # answer: 3
     # select the first file
     cdfFile  <- CDFfiles(sampleDescription)[1]

     # select "Valine" top masses
     top.masses <- topMass(refLibrary)[[3]]

     # plot peak from the cdf file
     plotPeak(cdfFile = cdfFile, time.range = libRI(refLibrary)[3] + c(-2000,2000),
         masses = top.masses, useRI = TRUE, rimTime = RImatrix[,1],
         standard = rimStandard(rimLimits), massRange = c(85, 500))

     # the same, but extracting the peaks into a list first. This may be better if
     # you intend to loop through several peaks.
     rawpeaks <- peakCDFextraction(cdfFile, massRange = c(85,500))
     plotPeak(rawpeaks, time.range = libRI(refLibrary)[3] + c(-2000,2000),
         masses = top.masses, useRI = TRUE, rimTime = RImatrix[,1],
         standard = rimStandard(rimLimits), massRange = c(85, 500))

