Learn R Programming

tofsims (version 1.0.2)

changePeakWidth: method changePeakWidth

Description

method changePeakWidth

Usage

changePeakWidth(object, selectMz, lowerWidth, upperWidth, ...)

## S3 method for class 'PeakList,missing,missing,missing': changePeakWidth(object, selectMz, lowerWidth, upperWidth, ...)

## S3 method for class 'PeakList,numeric,numeric,numeric': changePeakWidth(object, selectMz, lowerWidth, upperWidth, ...)

Arguments

object
PeakList object
selectMz
numeric change width of peak closest to selectMz
lowerWidth
numeric lower width value in mass units
upperWidth
numeric upper width value in mass units
...
additional args

Value

  • PeakList object with upated peak widths

Details

method changePeakWidth is used to modify the peak width of an individual peak it should be called with the argument mzRange to zoom into the region of interest for choosing the peak. Then two further clicks for choosing the (new) lower and upper peak widths.

Examples

Run this code
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))
testPeakList<-addPeaks(testPeakList, mzs=26:31, width=0.4)
peakWidths(testPeakList)
testPeakList<-changePeakWidth(testPeakList, selectMz = 27, lowerWidth = 0.2, upperWidth = 0.3)
peakWidths(testPeakList)

Run the code above in your browser using DataLab