LOB_plotMS2: Find and plot MS2 spectra in a rawSpec object using lipid...

View source: R/LOB_plotMS2.R

LOB_plotMS2R Documentation

Find and plot MS2 spectra in a rawSpec object using lipid annotations.

Description

This function allows the user to quickly search and plot a MS2 spectra from a rawSpec object cooresponding to either an inputed m/z and retention time or search with multiple MS1 peaks at once by inputing a peaklist.

Usage

LOB_plotMS2(XCMSnExp, peakdata = NULL, plot_file = "closest_scan", mz = NULL, rt = NULL, rtspan = 175, ppm_pre = 100, ppm = 2.5, window = 1, diagnostic = NULL, diagnostic_ppm = 15, NL = NULL)

Arguments

XCMSnExp

A XCMSnExp object to be searched contianing both MS1 and MS2 spectra.

peakdata

A LOBSTAHS peaklist data.frame containing info for multiple peaks for which coresponding MS2 spectra will be searched. The input 'peakdata' must have columns 'peakgroup_rt', 'LOBdbase_mz', and 'compound_name' with rows for each lipid.

plot_file

A charactor vector reading either 'most_scans','highest_int', or 'closest_scan' controlling which file is chosen for plotting (defaults to 'closest_scans'). To use a specific file, a character string exactly matching a sample name from the XCMSnExp object can be used (use sampleNames(XCMSnExp) to see files included in the object). Value 'most_scans' plots spectra from the file with the most MS2 scans found, 'highest_int' selects the file that contains the scan with the highest precursor intensity, 'closest_scan' plots spectra from the file with a scan closest to the specified rt.

mz

A single numeric equal to the m/z of a peak.

rt

A single numeric equal to the rt of a peak.

rtspan

A single numeric equal setting the retention time window around the peak 'rt' (defaults to ±175 seconds).

ppm_pre

A single numeric equal setting the mass range around the peak 'm/z' for which to search for scans (defaults to ±100 ppm).

ppm

A single numeric equal setting the mass tolerence for the plotted chromatogram (defaults to ±2.5 ppm).

window

A single numeric equal setting the zoom of the MS1 chromatogram window plotted with 1 equalling 100

diagnostic

A named numeric list of fragment masses to be highlighted in the plotted spectra.

diagnostic_ppm

A single numeric equal setting the mass tolerence for the highlighted fragments (defaults to ±15 ppm).

NL

A named numeric list of NL masses to be highlighted in the plotted spectra.

Details

Using the 'peakdata' argumnet overides the 'mz' and 'rt' arguments. Use 'peakdata' to search for multipule features spectra at once. Use 'mz' and 'rt' to search for a single features spectra.

Value

Returns a data.frame or a list of data.frame if multipule peaks were searched with at once.

Note

Currently in development.

Author(s)

Henry Holm, hholm@mit.edu
Dan Lowenstien, dlowenstein@whoi.edu
Max Jahns, mjahns@mit.edu
Shavonna Bent, sbent@mit.edu

Examples

#Example - find MS2 of DNPPE
DNPPE_ms2 <- LOB_findMS2(rawSpec = rawSpec,
                         mz = 875.550487,
                         rt = 1000,
                         ppm = 2.5)

hholm/LOB_tools documentation built on Jan. 28, 2024, 12:08 p.m.