Skip to contents

Plot a set of deconvoluted spectra.

Usage

plot_spectra(
  obj,
  ...,
  sfy = 1e+06,
  xlab = "Chemical Shift [ppm]",
  ylab = paste("Signal Intensity [au] /", sfy),
  mar = c(4.1, 4.1, 1.1, 0.1),
  lgd = TRUE
)

Arguments

obj

An object of type decons0, decons1 or decons2. For details see Metabodecon Classes.

...

Additional arguments passed to the conversion function.

sfy

Scaling factor for the y-axis.

xlab

Label for the x-axis.

ylab

Label for the y-axis.

mar

A numeric vector of length 4, which specifies the margins of the plot.

lgd

Logical. If TRUE, a legend is drawn.

Value

A plot of the deconvoluted spectra.

See also

plot_spectrum() for a much more sophisticated plotting routine suitable for plotting a single spectrum.

Author

2024-2025 Tobias Schmidt: initial version.

Examples

obj <- deconvolute(sim[1:4], sfr = c(3.55, 3.35))
#> 2025-04-17 14:52:02.36 Starting deconvolution of 4 spectra using 1 worker
#> 2025-04-17 14:52:02.36 Starting deconvolution of sim_01
#> 2025-04-17 14:52:02.36 Removing water signal
#> 2025-04-17 14:52:02.36 Removing negative signals
#> 2025-04-17 14:52:02.36 Smoothing signals
#> 2025-04-17 14:52:02.37 Starting peak selection
#> 2025-04-17 14:52:02.38 Detected 314 peaks
#> 2025-04-17 14:52:02.38 Removing peaks with low pscores
#> 2025-04-17 14:52:02.38 Removed 287 peaks
#> 2025-04-17 14:52:02.38 Initializing Lorentz curves
#> 2025-04-17 14:52:02.38 MSE at peak tiplet positions: 4.0838805770844048836921
#> 2025-04-17 14:52:02.38 Refining Lorentz Curves
#> 2025-04-17 14:52:02.39 MSE at peak tiplet positions: 0.1609359876216345797140
#> 2025-04-17 14:52:02.39 MSE at peak tiplet positions: 0.0228015051613790313556
#> 2025-04-17 14:52:02.39 MSE at peak tiplet positions: 0.0071638016610617799920
#> 2025-04-17 14:52:02.40 Formatting return object as decon2
#> 2025-04-17 14:52:02.40 Finished deconvolution of sim_01
#> 2025-04-17 14:52:02.40 Starting deconvolution of sim_02
#> 2025-04-17 14:52:02.40 Removing water signal
#> 2025-04-17 14:52:02.40 Removing negative signals
#> 2025-04-17 14:52:02.40 Smoothing signals
#> 2025-04-17 14:52:02.41 Starting peak selection
#> 2025-04-17 14:52:02.42 Detected 316 peaks
#> 2025-04-17 14:52:02.42 Removing peaks with low pscores
#> 2025-04-17 14:52:02.42 Removed 286 peaks
#> 2025-04-17 14:52:02.42 Initializing Lorentz curves
#> 2025-04-17 14:52:02.42 MSE at peak tiplet positions: 3.8338943428876719465848
#> 2025-04-17 14:52:02.42 Refining Lorentz Curves
#> 2025-04-17 14:52:02.42 MSE at peak tiplet positions: 0.1289481941626757499630
#> 2025-04-17 14:52:02.42 MSE at peak tiplet positions: 0.0135651899090413786964
#> 2025-04-17 14:52:02.43 MSE at peak tiplet positions: 0.0025556755331531087749
#> 2025-04-17 14:52:02.43 Formatting return object as decon2
#> 2025-04-17 14:52:02.43 Finished deconvolution of sim_02
#> 2025-04-17 14:52:02.43 Starting deconvolution of sim_03
#> 2025-04-17 14:52:02.43 Removing water signal
#> 2025-04-17 14:52:02.43 Removing negative signals
#> 2025-04-17 14:52:02.43 Smoothing signals
#> 2025-04-17 14:52:02.44 Starting peak selection
#> 2025-04-17 14:52:02.45 Detected 333 peaks
#> 2025-04-17 14:52:02.45 Removing peaks with low pscores
#> 2025-04-17 14:52:02.45 Removed 308 peaks
#> 2025-04-17 14:52:02.45 Initializing Lorentz curves
#> 2025-04-17 14:52:02.45 MSE at peak tiplet positions: 1.4917065120183623516681
#> 2025-04-17 14:52:02.45 Refining Lorentz Curves
#> 2025-04-17 14:52:02.45 MSE at peak tiplet positions: 0.0569971157280155932279
#> 2025-04-17 14:52:02.45 MSE at peak tiplet positions: 0.0065629979536274852397
#> 2025-04-17 14:52:02.46 MSE at peak tiplet positions: 0.0013913916281140725414
#> 2025-04-17 14:52:02.46 Formatting return object as decon2
#> 2025-04-17 14:52:02.46 Finished deconvolution of sim_03
#> 2025-04-17 14:52:02.46 Starting deconvolution of sim_04
#> 2025-04-17 14:52:02.46 Removing water signal
#> 2025-04-17 14:52:02.46 Removing negative signals
#> 2025-04-17 14:52:02.46 Smoothing signals
#> 2025-04-17 14:52:02.47 Starting peak selection
#> 2025-04-17 14:52:02.49 Detected 325 peaks
#> 2025-04-17 14:52:02.49 Removing peaks with low pscores
#> 2025-04-17 14:52:02.49 Removed 299 peaks
#> 2025-04-17 14:52:02.49 Initializing Lorentz curves
#> 2025-04-17 14:52:02.49 MSE at peak tiplet positions: 2.2382155282476525748336
#> 2025-04-17 14:52:02.49 Refining Lorentz Curves
#> 2025-04-17 14:52:02.49 MSE at peak tiplet positions: 0.0843491698981613247099
#> 2025-04-17 14:52:02.49 MSE at peak tiplet positions: 0.0101688144550079444944
#> 2025-04-17 14:52:02.49 MSE at peak tiplet positions: 0.0031861616084395915326
#> 2025-04-17 14:52:02.50 Formatting return object as decon2
#> 2025-04-17 14:52:02.50 Finished deconvolution of sim_04
#> 2025-04-17 14:52:02.50 Finished deconvolution of 4 spectra in 0.137 secs
plot_spectra(obj)