createMSP-purityA-method: Using a purityA object, create an MSP file of fragmentation...

Description Usage Arguments Value Examples

Description

General

Create an MSP file for all the fragmentation spectra that has been linked to an XCMS feature via frag4feature. Can export all the associated scans individually or the averaged fragmentation spectra can be exported.

Additional metadata can be included in a dataframe (each column will be added to metadata of the MSP spectra). The dataframe must contain the column "grpid" corresponding to the XCMS grouped feature.

Example LC-MS/MS processing workflow

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S4 method for signature 'purityA'
createMSP(
  pa,
  msp_file_pth = NULL,
  metadata = NULL,
  metadata_cols = NULL,
  xcms_groupids = NULL,
  method = "all",
  adduct_split = TRUE,
  filter = TRUE,
  msp_schema = "massbank",
  intensity_ra = "intensity_ra",
  include_adducts = ""
)

Arguments

pa

object; purityA object

msp_file_pth

character; Name of the output msp file, if NULL the file "frag_spectra_time stamp.msp" will be created in the current directory

metadata

data.frame; Data frame with additional coumpound infomation to include in msp output

metadata_cols

vector; Column names of meta data to incorporate into name

xcms_groupids

vector; XCMS group id's to extract ms/ms data for

method

character; "all" will export all matching ms/ms spectra to xcms features, "max" will use spectra with the highest inensity, "av_intra" will use the intra file averaged spectra (within file), "av_inter" will use the inter file (across file) averaged spectra, "av_all" will use the averaged spectra (ignoring inter and intra)

adduct_split

boolean; If either "adduct" or MS$FOCUSED_ION: PRECURSOR_TYPE column is in metadata then each adduct will have it's own MSP spectra. (Useful, if the MSP file will be used for further annotation)

filter

boolean; TRUE if filtered peaks are to be removed

msp_schema

character; Either MassBank (Europe) or MoNA style of MSP file format to be used ('massbank' or 'mona')

intensity_ra

character; Either 'intensity', 'ra' (relative abundance) or 'intensity_ra' (intensity and relative abundance) to be written to the MSP file

include_adducts

character; Additional adducts to include as a string seperated by white a space (e.g. [M+H]+ [M+Na]+)

Value

Returns a MSP file with the selected spectra and metadata

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#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)
#pa <- averageAllFragSpectra(pa)
pa <- readRDS(system.file("extdata", "tests", "purityA",
                          "9_averageAllFragSpectra_with_filter_pa.rds",
                          package="msPurity"))
createMSP(pa)

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