binning: Binning/Bucketing of NMR spectra

Description Usage Arguments Value Examples

View source: R/load_data.R

Description

Apply a binning function on a spectrum.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

1
2
3
4
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")

Example output

Import spectra from txt or csv files... 
Normalisation method : CS 
Binning 

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

Normalisation method : pqn 

ASICS documentation built on Nov. 8, 2020, 8:19 p.m.