binning {ASICS} | R Documentation

## Binning/Bucketing of NMR spectra

### Description

Apply a binning function on a spectrum.

### Usage

    binning(
      spectra,
      bin = 0.01,
      exclusion.areas = matrix(c(4.5, 5.1), ncol = 2),
      normalisation = TRUE,
      low.lim = 0.5,
      high.lim = 10,
      ncores = 1,
      verbose = TRUE,
      ...
    )

### Arguments

`spectra` | Data frame with spectra in columns and chemical shifts in rows. Colnames of this data frame correspond to sample names and rownames to chemical shift grid (in ppm).
`bin` | Numeric value specifying the bin width.
`exclusion.areas` | Definition domain of spectra that have to be excluded of the analysis (ppm). By default, the water region is excluded (4.5-5.1 ppm).
`normalisation` | Logical. If `TRUE` a normalisation is applied for each spectrum (see `normaliseSpectra` for details). Default to `TRUE`.
`low.lim, high.lim` | low and high chemical shift limits for the output bins (default values : `low.lim = 0.5` and `high.lim = 10`).
`ncores` | Number of cores used in parallel evaluation. Default to `1`.
`verbose` | A boolean value to allow print out process information.
`...` | Further arguments to be passed to the function `normaliseSpectra`

### Value

A data frame with normalised spectra in columns and buckets in rows (bucket names correspond to the center of the bucket).

### Examples

    current_path <- system.file("extdata", package = "ASICS")
    spectra_data <- importSpectra(name.dir = current_path,
                         name.file = "spectra_example.txt", type.import = "txt")
    spectra_bin <- binning(spectra_data, bin = 0.01, type.norm = "pqn")

[Package ASICS version 2.3.1 Index]