taNorm: Total Area Normalisation

View source: R/taNorm.R

taNormR Documentation

Total Area Normalisation

Description

Total area normalisation (TA) scales spectra so that they all have a total integral of one

Usage

taNorm(X, noi)

Arguments

X

The spectra intended to be normalised. Can either be a single spectrum in the form of a numerical array or multiple spectra in a numerical matrix with the rows being the spectra/samples and the columns being the ppm variables

noi

The noise estimation for each spectra given in an array that is row matched to the given X variable (i.e., for a single spectrum, only one noi value is required, for a matrix, the number of noi values should match the number of rows in X)

Details

taNorm() works by summing all elements of a row (spectrum) and then dividing each element by this sum

Value

This function assigns the normalised X argument (as X_ta) and the calculated dilution factors (as dilf_ta) to the global environment.

Author(s)

kylebario1@gmail.com

See Also

https://doi.org/10.1021/ac051632c

Other Attribute-Based: creNorm(), q1Norm(), roiNorm(), vecNorm()

Examples

data(X, noi, ppm)
taNorm(X, noi)
par(mfrow = c(1,2))
plot(ppm, X[2,], xlim = c(9.5,0.25), xlab = "Chemical Shift (ppm)",
     ylab = "Intensity", main = "Non-Normalised Spectra",
     type = 'l', col = 'red')
points(ppm, X[1,], type = 'l', col = 'blue')
legend("topleft", legend = c("Spectra 1", "Spectra 2"), col = c("red", "blue"), lty = 1)
plot(ppm, X_ta[1,], xlim = c(9.5,0.25), xlab = "Chemical Shift (ppm)",
     ylab = "Intensity", main = "Normalised Spectra",
     type = 'l', col = 'red')
points(ppm, X_ta[2,], type = 'l', col = 'blue')
legend("topleft", legend = c("Spectra 1", "Spectra 2"), col = c("red", "blue"), lty = 1)
cat(dilf_ta)

kylebario/concentr8r documentation built on Nov. 9, 2022, 12:47 a.m.