Convert an object to a Metabodecon class.
Usage
as_spectrum(x, sf = c(1000, 1e+06))
as_ispec(x, sf = c(1000, 1e+06))
as_idecon(x)
as_decon0(x, sf = NULL, spectrum = NULL, optional = TRUE)
as_decon1(
x,
sf = c(1000, 1e+06),
spectrum = NULL,
sfr = NULL,
wshw = NULL,
bwc = 2
)
as_decon2(
x,
sf = c(1000, 1e+06),
spectrum = NULL,
sfr = NULL,
wshw = NULL,
bwc = 2
)
as_spectra(
x,
file_format = "bruker",
expno = 10,
procno = 10,
raw = FALSE,
silent = TRUE,
force = FALSE
)
as_ispecs(x, sf = c(1000, 1e+06))
as_idecons(x)
as_decons0(x, sfs = list(c(1000, 1e+06)), spectra = list(NULL), nworkers = 1)
as_decons1(
x,
sfs = list(c(1000, 1e+06)),
spectra = list(NULL),
sfrs = list(NULL),
wshws = list(NULL),
bwc = 2,
nworkers = 1
)
as_decons2(
x,
sfs = list(c(1000, 1e+06)),
spectra = list(NULL),
sfrs = list(NULL),
wshws = list(NULL),
bwc = 2,
nworkers = 1
)
Arguments
- x
The object to convert.
- sf
Scale factor. Only required if
x
is a decon0 object.- spectrum, spectra
The
spectrum
/spectra
object corresponding tox
as returned byread_spectrum()
/ read_spectra. Only required ifx
is a decon0 object.- optional
Logical. If
TRUE
, the two optional elementssignal_free_region
andrange_water_signal_ppm
are included in the returneddecon0
object.- sfr, sfrs
sfr
should be a vector specifying the borders of the signal free region.sfrs
should be a list of such vectors. Only required ifx
is adecon0
object where elementsignal_free_region
is missing (or adecons0
objected containing suchdecon0
objects).- wshw, wshws
wshw
should specify the half width of the water signal region.wshws
should be a list of such values. Only required ifx
is adecon0
object where elementrange_water_signal_ppm
is missing (or adecons0
objected containing suchdecon0
objects).- bwc
Level of backwards compatibility. If
bwc == 0
, bug fixes introduced after version 0.2.2 of Metabodecon are not used. Ifbwc == 1
, new features introduced after version 0.2.2 of Metabodecon (e.g. faster algorithms) are not used. Ifbwc == 2
, all bug fixes and features introduced after version 0.2.2 are used. Support forbwc == 0
will be removed in 'metabodecon v2.0'.- file_format
The file_format of the spectrum file. E.g.
"bruker"
or"jcampdx"
.- expno, procno
The experiment/processing number for the file. E.g.
"10"
. Only relevant iffile_format
equals"bruker"
. For details see section File Structure in the metabodecon FAQ.- raw
If
FALSE
, scales the returned signal intensities based on information available in the spectrum metadata, in particularNC_proc
. For details seeprocessing-reference.pdf
, available at https://www.bruker.com/en.html at section 'Services & Support > Documentation & Manuals > Magnetic Resonance > Acquisition & Processing > TopSpin Processing Commands and Parameters' (requires login).- silent
If
TRUE
, no output will be printed to the console.- force
If
TRUE
, try to continue when encountering errors and print info messages instead. To hide these messages as well, setsilent = TRUE
.- sfs
List of scale factors. Only required if
x
is a list of decon0 objects.- nworkers
Number of workers for parallel processing.
Examples
dirpath <- metabodecon_file("sim_subset")
spectra <- read_spectra(dirpath)
spectrum <- spectra[[1]]
decons1 <- generate_lorentz_curves_sim(spectra)
decon1 <- generate_lorentz_curves_sim(spectrum)
decon2 <- as_decon2(decon1)