Learn R Programming

tofsims (version 1.0.2)

removePeaks: generic method removePeaks

Description

generic method removePeaks

removePeaks for PeakList Class allows removing peaks below a certain treshhold of ioncounts. the threshhold is not calculated as area, but just from the peak height (ion count at peak center)

removePeaks for PeakList Class allows removing peaks manually

removePeaks for PeakList Class allows removing peaks manually

Usage

removePeaks(object, mzs, operator, limit, nLocator, ...)

## S3 method for class 'PeakList,missing,missing,numeric,missing': removePeaks(object, mzs, operator, limit, nLocator, ...)

## S3 method for class 'PeakList,missing,missing,missing,numeric': removePeaks(object, mzs, operator, limit, nLocator, ...)

## S3 method for class 'PeakList,numeric,missing,missing,missing': removePeaks(object, mzs, operator, limit, nLocator, ...)

## S3 method for class 'PeakList,missing,character,numeric,missing': removePeaks(object, mzs, operator, limit, nLocator, ...)

Arguments

object
object of class PeakList
mzs
M/z's of peaks to be removed
operator
Accept ">", "<", "="="," "<=", ">=", "!="
limit
numeric limit for peaks to be removed
nLocator
numeric how many peaks to remove with visual selection
...
additional args

Value

  • object of class PeakList with removed/updated peaks

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)
plot(testPeakList, mzRange = c(25,32), type = 'l')
testPeakList<-removePeaks(testPeakList, mzs = 27)
plot(testPeakList, mzRange = c(25,32), type = 'l')

Run the code above in your browser using DataLab