hmNorm: Histogram Matching

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/hmNorm.R

Description

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.

Usage

1
2
3
4
5
6
7
8
hmNorm(
  X,
  noi,
  int_binwid = 0.1,
  alpha = c(0.1, 2),
  use_median = NULL,
  tol = 1e-05
)

Arguments

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 noise() or provided by the user. Must match X rows.

int_binwid

This argument dictates the width of the bins. The average span of intensities is from 10-30, meaning that an intensity_binwidth of 0.1 would give you 200 bins.

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 FALSE, the first sample will be used as the reference. This practice is outlined in the methods paper (see 'See also')

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 tol distance apart)

Details

How It Works:

  1. A more complex normalisation method compared to others in this package, HM creates a histogram of the intensities of an experimental spectrum.

  2. This area of this histogram subtracted from that of a reference histogram, calculated from a median spectrum.

  3. The experimental spectra is scaled by a factor alpha which alters the intensities and a new histogram is made and step 2. is repeated.

  4. The aim is to minimise the difference between the reference histogram and the experiment histogram and the alpha value that acheives this minimum is the dilution coefficient.

  5. This is iterated over for all experimetal spectra

Advantages:

Limitations:

Value

A list with:

  1. The normalised X matrix in the first list element, and

  2. An array of the corresponding dilution factors.

Author(s)

kylebario1@gmail.com

See Also

Other Reference-Based: pqNorm(), qNorm2(), xfNorm()

Examples

1
2
3
4
# 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))
cat(dilf_hm)

kylebario/unorm documentation built on Dec. 21, 2021, 8:45 a.m.