extractPrecSpectra-methods {MSnbase} | R Documentation

## Extracts precursor-specific spectra from an 'MSnExp' object

### Description

Extracts the MSMS spectra that originate from the precursor(s) having the same MZ value as defined in the`prec` argument.

A warning will be issued of one or several of the precursor MZ values in `prec` are absent in the experiment precursor MZ values (i.e in `precursorMz(object)`).

### Methods

`signature(object = "MSnExp", prec = "numeric")`

  Returns an `"MSnExp"` containing MSMS spectra whose precursor MZ values are in `prec`.

### Author(s)

Laurent Gatto <lg390@cam.ac.uk>

### Examples

    file <- dir(system.file(package="MSnbase",dir="extdata"),
                full.name=TRUE,pattern="mzXML$")
    aa <- readMSData(file,verbose=FALSE)
    my.prec <- precursorMz(aa)[1]
    my.prec
    bb <- extractPrecSpectra(aa,my.prec)
    precursorMz(bb)
    processingData(bb)

[Package MSnbase version 2.15.7 Index]