hmNorm: Histogram Matching

View source: R/hmNorm.R

hmNormR Documentation

Histogram Matching

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

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

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.

Value

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

Author(s)

kylebario1@gmail.com

See Also

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

Examples

# 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/concentr8r documentation built on Nov. 9, 2022, 12:47 a.m.