peaks2Spectra {tofsims} | R Documentation

## generic method peaks2Spectra

### Description

peaks2Spectra allows to transfer the peaks from a PeakList object onto a MassSpectra object. By this, the MassSpectra object is promoted into a PeakList object

### Usage

    peaks2Spectra(objectPeaks, objectSpectra)

    ## S4 method for signature 'PeakList,MassSpectra'
    peaks2Spectra(objectPeaks, objectSpectra)

### Arguments

`objectPeaks` | object object of class PeakList
`objectSpectra` | object object of class MassSpectra

### Value

object of class PeakList

### Examples

    library(tofsimsData)
    data(tofsimsData)
    testSpectra<-reduceSpectrumResolution(testSpectra,everyN = 4, mode = 'keep')
    peakPickSpectra<-testSpectra
    peakPickSpectra<-calibPointNew(peakPickSpectra, mz = 15, value = 15.01551)
    peakPickSpectra<-calibPointNew(peakPickSpectra, mz = 181, value = 181.0228)
    peakPickSpectra<-recalibrate(peakPickSpectra)
    peakPickSpectra<-unitMassPeaks(peakPickSpectra, mzRange = c(1,200), widthAt = c(15, 181),
    factor = c(0.4, 0.6), lower = c(14.97, 15.05), upper = c(180.84, 181.43))
    par(mfcol = c(1,2))
    plot(testSpectra, mzRange = c(38.5, 40.5), type = 'l')
    testSpectra<-peaks2Spectra(peakPickSpectra, testSpectra)
    plot(testSpectra, mzRange = c(38.5, 40.5), type = 'l')

[Package tofsims version 1.10.1 Index]