frag4feature-purityA-method: Using a purityA object, link MS/MS data to XCMS features

Description Usage Arguments Value Examples

Description

General

Assign fragmentation spectra (MS/MS) stored within a purityA class object to grouped features within an XCMS xset object.

XCMS calculates individual chromatographic peaks for each mzML file (saved in xset@peaks), these are then grouped together (using xcms.group). Ideally the mzML files that contain the MS/MS spectra also contain sufficient MS1 scans for XCMS to detect MS1 chromatographic features. If this is the case, to determine if a MS2 spectra is to be linked to an XCMS grouped feature, the associated acquisition time of the MS/MS event has to be within the retention time window defined for the individual peaks associated for each file. The precursor m/z value also has to be within the user ppm tolerance to XCMS feature.

See below for representation of the linking (the * —— * represent a many-to-many relationship) e.g. 1 or more MS/MS events can be linked to 1 or more individual feature and an individual XCMS feature can be linked to 1 or more grouped XCMS features

Alternatively, if the "useGroup" argument is set to TRUE, the full width of the grouped peak (determined as the minimum rtmin and maximum rtmax of the all associated individual peaks) will be used. This option should be used if the mzML file with MS/MS has very limited MS1 data and so individual chromatographic peaks might not be detected with the mzML files containing the MS/MS data. However, it should be noted this may lead to potential inaccurate linking.

Example LC-MS/MS processing workflow

The purityA object can be used for further processing including linking the fragmentation spectra to XCMS features, averaging fragmentation, database creation and spectral matching (from the created database). See below for an example workflow

Additional notes

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S4 method for signature 'purityA'
frag4feature(
  pa,
  xset,
  ppm = 5,
  plim = NA,
  intense = TRUE,
  convert2RawRT = TRUE,
  useGroup = FALSE,
  create_db = FALSE,
  out_dir = ".",
  db_name = NA,
  grp_peaklist = NA,
  use_group = NA
)

Arguments

pa

object; purityA object

xset

object; xcmsSet object derived from the same files as those used to create the purityA object

ppm

numeric; ppm tolerance between precursor mz and XCMS feature mz

plim

numeric; minimum purity of precursor to be included

intense

boolean; If TRUE the most intense precursor will be used. If FALSE the precursor closest to the center of the isolation window will be used

convert2RawRT

boolean; If retention time correction has been used in XCMS set this to TRUE

useGroup

boolean; Ignore individual peaks and just find matching fragmentation spectra within the (full) rtmin rtmax of each grouped feature

create_db

boolean; (Deprecated, to be removed - use createDatabase function) SQLite database will be created of the results

out_dir

character; (Deprecated, to be removed - use createDatabase function) Path where database will be created

db_name

character; (Deprecated, to be removed - use createDatabase function) If create_db is TRUE, a custom database name can be used, default is a time stamp

grp_peaklist

dataframe; (Deprecated, to be removed - use createDatabase function) Can use any peak dataframe to add to databse. Still needs to be derived from the xset object though

use_group

boolean; (Deprecated, to be removed - replaced with useGroup argument for style consistency)

Value

Returns a purityA object (pa) with the following slots populated:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
msmsPths <- list.files(system.file("extdata", "lcms",
                       "mzML", package="msPurityData"), full.names = TRUE,
                       pattern = "MSMS")
xset <- xcms::xcmsSet(msmsPths, nSlaves = 1)
xset <- xcms::group(xset)
xset <- xcms::retcor(xset)
xset <- xcms::group(xset)

pa  <- purityA(msmsPths)
pa <- frag4feature(pa, xset)

msPurity documentation built on Jan. 14, 2021, 2:44 a.m.