to_ASICS: Export data for the ASICS spectral quantification library

View source: R/utils.R

to_ASICSR Documentation

Export data for the ASICS spectral quantification library

Description

Exports the spectra matrix, sample names and chemical shift axis into an ASICS Spectra object.

Usage

to_ASICS(dataset, ...)

Arguments

dataset

An nmr_dataset_1D object

...

Arguments passed on to ASICS::createSpectra

norm.method

Character specifying the normalisation method to use on spectra ONLY if the importSpectra function was not used.

norm.params

List containing normalisation parameteres (see normaliseSpectra for details) ONLY if the importSpectra function was not used.

Value

An ASICS::Spectra object

Examples

if (requireNamespace("ASICS", quietly=TRUE)) {
  nsamp <- 3
  npoints <- 300
  metadata <- list(external = data.frame(
    NMRExperiment = paste0("Sample", seq_len(nsamp))
  ))
  dataset <- new_nmr_dataset_1D(
    ppm_axis = seq(from = 0.2, to = 10, length.out = npoints),
    data_1r = matrix(runif(nsamp * npoints), nrow = nsamp, ncol = npoints),
    metadata = metadata
  )
  forAsics <- to_ASICS(dataset)
  #ASICS::ASICS(forAsics)
}

sipss/AlpsNMR documentation built on Aug. 13, 2024, 5:11 p.m.