normSpectra {ChemoSpec}R Documentation

Normalize a Spectra Object

Description

This function carries out normalization of the spectra in a Spectra object. There are currently four options:

Usage

normSpectra(spectra, method = "PQN", RangeExpress = NULL)

Arguments

spectra

An object of S3 class Spectra to be normalized.

method

One of c("PQN", "TotInt", "Range", "zero2one") giving the method for normalization.

RangeExpress

A vector of logicals (must be of length(Spectra$freq)). This vector should be TRUE for the frequency range you want to serve as the basis for norming, and FALSE otherwise. The entire spectrum will be divided by the sum of the TRUE range. See the examples.

Value

An object of S3 class Spectra.

Author(s)

Bryan A. Hanson (DePauw University)

References

Probabalistic Quotient Normalization is reported in F. Dieterle et. al. Analytical Chemistry vol. 78 pages 4281-4290 (2006). The exact same mathematics are called "median fold change normalization" by Nicholson's group, reported in K. A. Veselkov et. al. Analytical Chemistry vol. 83 pages 5864-5872 (2011).

See Also

Additional documentation at https://bryanhanson.github.io/ChemoSpec/

Examples

# This example assumes the graphics output is set to ggplot2 (see ?GraphicsOptions).
library("ggplot2")
data(SrE.IR)

# Reference spectrum before normalization
p1 <- plotSpectra(SrE.IR) + ggtitle("Original Spectrum")
p1

# Default PQN normalization
res1 <- normSpectra(SrE.IR)
p2 <- plotSpectra(res1) + ggtitle("PQN Normalization")
p2

# Norm over carbonyl region
RE <- SrE.IR$freq > 1650 & SrE.IR$freq < 1800
res2 <- normSpectra(SrE.IR, method = "Range", RangeExpress = RE)
p3 <- plotSpectra(res2) + ggtitle("Normalized to Carbonyl Peaks")
p3

# Check numerically
rowSums(res2$data[, RE]) # compare to rowSums(SrE.IR$data[,RE])


[Package ChemoSpec version 6.0.1 Index]