ZeroOrderPhaseCorrection: Zero Order Phase Correction

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ZeroOrderPhaseCorrection.R

Description

The function corrects the spectra in order to have their real part in an absorptive mode.

Usage

1
2
3
4
ZeroOrderPhaseCorrection(Spectrum_data, type.zopc = c("rms", "manual", "max"), 
                        plot_rms = NULL, returnAngle = FALSE, 
                        createWindow = TRUE, angle = NULL, plot_spectra = FALSE,  
                        ppm.zopc = TRUE, exclude.zopc = list(c(5.1,4.5)), verbose = FALSE)

Arguments

Spectrum_data

Matrix containing the spectra in ppm, one row per spectrum.

type.zopc

Method used to select the angles to rotate the spectra. See details.

plot_rms

Contains a vector of row names for which a debug plot should be made showing the value of the function we try to minimize as a function of the phase.

returnAngle

If TRUE, will return the rotation angle used for phase correction.

createWindow

If TRUE, will open a new window to draw the rms or spectra plots, if FALSE, plots are drawn in the current device.

angle

If not NULL, a numeric vector with angles specified in radian to manually rotate the spectra, one angle per spectrum. By convention, the spectra are rotated with the correction angle - angle.

plot_spectra

If TRUE, will draw real and imaginary parts of the rotated spectra.

ppm.zopc

If TRUE, the values in exclude.zopc represent frequencies in ppm value (column names of spectra), if FALSE these values are column indices.

exclude.zopc

If not NULL, a list containing the extremities of the intervals excluded for the computation of the positiveness criterion, either expressed in ppm (decreasing values) OR in column indices (increasing values), e.g. exclude.zopc = list(c(0,10000)) if ppm.zopc == FALSE or exclude.zopc = list(c(1,-1)) if ppm.zopc == TRUE.

verbose

If "TRUE", will print processing information.

Details

We focus our optimization on the positiveness of the real part which should be in an absoptive mode.

When type.zopc is "rms", a positiveness criterion is measured for each spectrum. "manual" is used when a vector of angles are specified in angle and "max" will optimize the maximum spectral intensity in the non-excluded window(s). Beware that if exclude.zopc is not NULL, the optimization will only consider the non-excluded spectral window(s).

By default the water region (5.1 - 4.5) is ignored.

BaselineCorrection and NegativeValuesZeroing will take care of the last negative values of the real part of the spectra. See the reference for more details.

Value

Spectrum_data

The matrix of rotated spectra.

Author(s)

Benoît Legat & Manon Martin

References

Martin, M., Legat, B., Leenders, J., Vanwinsberghe, J., Rousseau, R., Boulanger, B., & Govaerts, B. (2018). PepsNMR for 1H NMR metabolomic data pre-processing. Analytica chimica acta, 1019, 1-13.

Rousseau, R. (2011). Statistical contribution to the analysis of metabonomics data in 1H NMR spectroscopy (Doctoral dissertation, PhD thesis. Institut de statistique, biostatistique et sciences actuarielles, Université catholique de Louvain, Belgium).

Examples

1
2
3
require(PepsNMRData)
Zopc.res <- ZeroOrderPhaseCorrection(Data_HS_sp$Spectrum_data_HS_4, 
            ppm.zopc = FALSE, exclude.zopc = list(c(5000,15000)))

PepsNMR documentation built on Jan. 16, 2021, 2:07 a.m.