findPeakWidth: generic method findPeakWidth

Description Usage Arguments Details Value Examples

Description

generic method findPeakWidth

method findPeakWidth

Usage

1
2
3
4
5
6
findPeakWidth(object, p = 3, n = 5, span = 100, widthExtLower = 1.5,
  widthExtUpper = 1.75, ...)

## S4 method for signature 'PeakList'
findPeakWidth(object, p = 3, n = 199, span = 100,
  widthExtLower = 1.7, widthExtUpper = 2, ...)

Arguments

object

object of class PeakList

p

numeric value for savitzky-golay filter on first derivate

n

numeric value for savitzky-golay filter on first derivate

span

numeric smoothing for determining local minima/maxima values

widthExtLower

numeric factor to extend lower peak width

widthExtUpper

numeric factor to extend upper peak width

...

additional args

Details

This method uses signal processing to determine lower and upper peak width limits based on local max/min detection of the first derivate next to peak center values. The initial code for local min/max detection is adapted from the CRAN package 'ChemometricsWithR'.

Value

object of class PeakList with updated peaks

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)
testPeakList<-findPeakWidth(testPeakList, p = 3, n = 199, 
span = 100, widthExtLower = 2, widthExtUpper = 2)
plot(testPeakList, mzRange=c(25,32), type = 'l')

tofsims documentation built on April 29, 2020, 5:20 a.m.