hmNorm.Rd
Histogram Matching (HM) is a reference based normalisation that aims to match the histogram created from a experimental spectra with that made from a reference spectra.
hmNorm( X, noi, int_binwid = 0.1, alpha = c(0.1, 2), use_median = NULL, tol = 1e-05 )
X | A numerical matrix containing the NMR spectra to be normalised. Rows should be the spectra and columns being the chemical shift variables |
---|---|
noi | The array of maximum noise estimations produced from the function |
int_binwid | This argument dictates the width of the bins. The average span of intensities is from |
alpha | The lower and upper bounds that the golden selection search will search between |
use_median | This argument dictates whether the function will calculate the median and use that as the reference spectrum or not. If set to |
tol | This defines the tolerance or level of precision the golden selection search will search until. (i.e., it will search until the bounds are |
This function assigns the normalised X argument (as X_hm) and the calculated dilution factors (as dilf_hm) to the global environment.
hmNorm()
works by selecting range of values to scale X by and then uses a golden selection search to find the value that makes the X overlap the most with the reference spectra.
The methods paper for HM can be found here: http://dx.doi.org/10.1007/s11306-018-1400-6
The paper discussing HM limitations with noise can be found here: http://dx.doi.org/10.1007/s11306-018-1400-6
# it is mandatory to fill args X, noi, and use_median for `hmNorm()` to work. data(X, noi) hmNorm(X, noi, use_median = TRUE, alpha = c(0.1, 2.5))#> Prepping the spectra #> Using the median spectra as reference #> Calculating the dilfs... Done. #> Normalising X... Done. #>#> 2.499799 1.254311