addPeaks: generic method to add peaks

Description Usage Arguments Value Examples

Description

This method will allow user to plot and add peaks manually. This method will take all parameters of PeakList plot method.

Usage

1
2
3
4
5
6
7
addPeaks(object, mzs, width, ...)

## S4 method for signature 'PeakList,missing,numeric'
addPeaks(object, mzs, width, ...)

## S4 method for signature 'PeakList,numeric,numeric'
addPeaks(object, mzs, width, ...)

Arguments

object

PeakList object

mzs

numeric vector M/z's where peaks shall be added

width

fixed value to add (m/z)

...

further args

Value

object updated PeakList object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(tofsimsData)
data(tofsimsData)
testPeakList<-PeakList(analysisName = analysisName(testSpectra),
instrument = instrument(testSpectra),
nz = nz(testSpectra),
calibration = calibration(testSpectra),
calibPoints = calibPoints(testSpectra),
mz = mz(testSpectra),
peakIDs = NULL,
peakMzs = NULL)
par(mfcol=c(1,2))
plot(testPeakList, mzRange=c(25,32), type = 'l')
testPeakList<-addPeaks(testPeakList, mzs=26:31, width=0.4)
plot(testPeakList, mzRange=c(25,32), type = 'l')

tofsims documentation built on Nov. 8, 2020, 5:10 p.m.