Last data update: 2014.03.03

R: Extract all peaks from the chromatographic profiles of an ALS...
getAllPeaksR Documentation

Extract all peaks from the chromatographic profiles of an ALS object

Description

Extractor function to find all peaks in the chromatographic profiles of an ALS object. Peaks are located as local maxima within the given span (function findpeaks) and at the given positions a gaussian curve is fit (function fitpeaks).

Usage

getAllPeaks(CList, span = NULL)

Arguments

CList

A list of profile matrices, each of the same dimensions (timepoints times components).

span

The span used for identifying local maxima in the individual components. If not given, the default of findpeaks is used.

Value

The result is a list, with each element corresponding to one data file, and containing data for the fitted peaks for each of the ALS components. Note that this function presents the "rt", "sd" and "FWHM" fields in real time units.

Author(s)

Ron Wehrens

Examples

data(teaMerged)
pks <- getAllPeaks(teaMerged$CList, span = 11)
## show component 2 from the second file
par(mfrow = c(2,1))
plot(teaMerged, what = "profiles", showWindows = FALSE,
     mat.idx = 2, comp.idx = 2)
## and show where the peaks are picked
abline(v = pks[[2]][[2]][,"rt"], col = "gray")

## same for component 6
plot(teaMerged, what = "profiles", showWindows = FALSE,
     mat.idx = 2, comp.idx = 6, col = "red")
abline(v = pks[[2]][[6]][,"rt"], col = "pink")

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/getAllPeaks.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getAllPeaks
> ### Title: Extract all peaks from the chromatographic profiles of an ALS
> ###   object
> ### Aliases: getAllPeaks
> ### Keywords: manip
> 
> ### ** Examples
> 
> data(teaMerged)
> pks <- getAllPeaks(teaMerged$CList, span = 11)
> ## show component 2 from the second file
> par(mfrow = c(2,1))
> plot(teaMerged, what = "profiles", showWindows = FALSE,
+      mat.idx = 2, comp.idx = 2)
> ## and show where the peaks are picked
> abline(v = pks[[2]][[2]][,"rt"], col = "gray")
> 
> ## same for component 6
> plot(teaMerged, what = "profiles", showWindows = FALSE,
+      mat.idx = 2, comp.idx = 6, col = "red")
> abline(v = pks[[2]][[6]][,"rt"], col = "pink")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>