recalibrate.addMS1data {RMassBank} | R Documentation

## Return MS1 peaks to be used for recalibration

### Description

Returns the precursor peaks for all MS1 spectra in the `spec` dataset with annotated formula to be used in recalibration.

For all spectra in `spec$specFound`, the precursor ion is extracted from the MS1 precursor spectrum. All found ions are returned in a data frame with a format matching `spec$peaksMatched` and therefore suitable for `rbind`ing to the `spec$peaksMatched` table. However, only minimal information needed for recalibration is returned.

### Usage

    recalibrate.addMS1data(spec,mode="pH", recalibrateMS1Window =
    				getOption("RMassBank")$recalibrateMS1Window)

### Arguments

`spec` | A `msmsWorkspace` or `RmbSpectraSetList` containing spectra for which MS1 "peaks" should be "constructed".
`mode` | `"pH", "pNa", "pM", "pNH4", "mH", "mM", "mFA"` for different ions ([M+H]+, [M+Na]+, [M]+, [M+NH4]+, [M-H]-, [M]-, [M+FA]-).
`recalibrateMS1Window` | Window width to look for MS1 peaks to recalibrate (in ppm).

### Value

A dataframe with columns `mzFound, formula, mzCalc, dppm, dbe, int, dppmBest, formulaCount, good, cpdID, scan, parentScan, dppmRc`. However, columns `dbe, int, formulaCount, good, scan, parentScan` do not contain real information and are provided only as fillers.

### Author(s)

Michael Stravs, EAWAG <michael.stravs@eawag.ch>

### Examples

    ## Not run:
    # More or less as used in recalibrateSpectra:
    		rcdata <- peaksMatched(w)
    		rcdata <- rcdata[rcdata$formulaCount == 1, ,drop=FALSE]
    		ms1data <- recalibrate.addMS1data(w, "pH", 15)
    		rcdata <- rbind(rcdata, ms1data)
     # ... continue constructing recalibration curve with rcdata

    ## End(Not run)

[Package RMassBank version 2.8.0 Index]