Convert a object to a Metabodecon object.
Usage
as_spectrum(x, sf = c(1000, 1e+06))
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_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 used during Only required if
xis a decon0 object.- spectrum, spectra
The
spectrum/spectraobject corresponding toxas returned byread_spectrum()/ read_spectra. Only required ifxis a decon0 object.- optional
Logical. If
TRUE, the two optional elementssignal_free_regionandrange_water_signal_ppmare included in the returneddecon0object.- sfr, sfrs
sfrshould be a vector specifying the borders of the signal free region.sfrsshould be a list of such vectors. Only required ifxis adecon0object where elementsignal_free_regionis missing (or adecons0objected containing suchdecon0objects).- wshw, wshws
wshwshould specify the half width of the water signal region.wshwsshould be a list of such values. Only required ifxis adecon0object where elementrange_water_signal_ppmis missing (or adecons0objected containing suchdecon0objects).- 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 == 0will 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_formatequals"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
xis 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)