findPeakWidth {tofsims} | R Documentation |
method findPeakWidth
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, ... )
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 |
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 'alsace'.
object of class PeakList with updated peaks
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')