Utility function to remove peaks from a peak list, e.g. because their
intensity is too low. Currently one can filter on peak height, peak
area, and width at half maximum.
A nested list of peak tables: the first level is the
sample, and the second level is the component. Every component is
described by a matrix where every row is one peak, and the columns
contain information on retention time, full width at half maximum
(FWHM), peak width, height, and area.
minHeight
Minimum peak height.
minArea
Minimum peak area.
minWHM
Minimal width at half maximum.
maxWHM
Maximum width at half maximum.
Value
A peak list similar to the input peakList, but with all rows
removed from the peak tables that are not satisfying the criteria.
Author(s)
Ron Wehrens
See Also
getAllPeaks
Examples
data(teaMerged)
pks <- getAllPeaks(teaMerged$CList, span = 11)
## only retain peaks with a peak height of at least 2
pks.filtered <- filterPeaks(pks, minHeight = 2)
plot(teaMerged, mat.idx = 3, what = "profiles", comp.idx = 2,
showWindows = FALSE, col = "blue")
abline(v = pks[[3]][[2]][,"rt"], col = "gray", lty = 2)
abline(v = pks.filtered[[3]][[2]][,"rt"])
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(alsace)
Loading required package: ALS
Loading required package: nnls
Loading required package: Iso
Iso 0.0-17
Loading required package: ptw
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/alsace/filterPeaks.Rd_%03d_medium.png", width=480, height=480)
> ### Name: filterPeaks
> ### Title: Filter peak lists
> ### Aliases: filterPeaks
> ### Keywords: manip
>
> ### ** Examples
>
> data(teaMerged)
> pks <- getAllPeaks(teaMerged$CList, span = 11)
> ## only retain peaks with a peak height of at least 2
> pks.filtered <- filterPeaks(pks, minHeight = 2)
> plot(teaMerged, mat.idx = 3, what = "profiles", comp.idx = 2,
+ showWindows = FALSE, col = "blue")
> abline(v = pks[[3]][[2]][,"rt"], col = "gray", lty = 2)
> abline(v = pks.filtered[[3]][[2]][,"rt"])
>
>
>
>
>
> dev.off()
null device
1
>