createPureLibrary: Create a pure library

Description Usage Arguments Value Examples

View source: R/load_data.R

Description

Create a new pure library from a data frame containing different spectra of pure metabolites. The noise is removed by thresholding each spectrum during the creation of a new pure library.

Usage

1
createPureLibrary(spectra, nb.protons, threshold = 1)

Arguments

spectra

Data frame with spectra in columns and chemical shifts in rows. Colnames of this data frame correspond to pure metabolite names and rownames to chemical shift grid (in ppm).

nb.protons

Numeric vector of the number of protons for each pure metabolite spectrum contained in spectra data frame.

threshold

Numeric value or numeric vector of length ncol(spectra) below which pure spectrum values are considered to be zero. Default to 1.

Value

A PureLibrary object with the newly created library.

Examples

1
2
3
4
5
pure_spectra <- importSpectraBruker(system.file("extdata",
                                                "example_library",
                                                package = "ASICS"))
new_pure_library <- createPureLibrary(pure_spectra,
                                      nb.protons = c(5, 4))

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