createPureLibrary {ASICS} | R Documentation

## Create a pure library

### 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

    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

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

[Package ASICS version 2.2.0 Index]