Skip to contents

Check if an object is an instance of a specific 'Metabodecon Class'. See Metabodecon Classes for a list of classes.

Usage

is_spectrum(x, check_class = TRUE, check_contents = FALSE)

is_decon0(x)

is_decon1(x)

is_decon2(x)

is_align(x)

is_spectra(
  x,
  check_class = TRUE,
  check_contents = FALSE,
  check_child_classes = FALSE
)

is_decons0(x)

is_decons1(x)

is_decons2(x)

is_aligns(x)

Arguments

x

The object to check.

check_class

Logical indicating whether to check the class of the object.

check_contents

Logical indicating whether to check the contents of the object.

check_child_classes

Logical indicating whether to check the class of each element of the object.

Value

TRUE if the object is an instance of the specified class, otherwise FALSE.

Author

2024-2025 Tobias Schmidt: initial version.

Examples

ss <- sim[1:2]
dd <- deconvolute(ss, sfr = c(3.55, 3.35))
#> 2025-04-17 14:52:01.28 Starting deconvolution of 2 spectra using 1 worker
#> 2025-04-17 14:52:01.28 Starting deconvolution of sim_01
#> 2025-04-17 14:52:01.28 Removing water signal
#> 2025-04-17 14:52:01.28 Removing negative signals
#> 2025-04-17 14:52:01.28 Smoothing signals
#> 2025-04-17 14:52:01.29 Starting peak selection
#> 2025-04-17 14:52:01.30 Detected 314 peaks
#> 2025-04-17 14:52:01.30 Removing peaks with low pscores
#> 2025-04-17 14:52:01.30 Removed 287 peaks
#> 2025-04-17 14:52:01.30 Initializing Lorentz curves
#> 2025-04-17 14:52:01.30 MSE at peak tiplet positions: 4.0838805770844048836921
#> 2025-04-17 14:52:01.30 Refining Lorentz Curves
#> 2025-04-17 14:52:01.30 MSE at peak tiplet positions: 0.1609359876216345797140
#> 2025-04-17 14:52:01.31 MSE at peak tiplet positions: 0.0228015051613790313556
#> 2025-04-17 14:52:01.31 MSE at peak tiplet positions: 0.0071638016610617799920
#> 2025-04-17 14:52:01.31 Formatting return object as decon2
#> 2025-04-17 14:52:01.31 Finished deconvolution of sim_01
#> 2025-04-17 14:52:01.31 Starting deconvolution of sim_02
#> 2025-04-17 14:52:01.31 Removing water signal
#> 2025-04-17 14:52:01.31 Removing negative signals
#> 2025-04-17 14:52:01.31 Smoothing signals
#> 2025-04-17 14:52:01.32 Starting peak selection
#> 2025-04-17 14:52:01.33 Detected 316 peaks
#> 2025-04-17 14:52:01.33 Removing peaks with low pscores
#> 2025-04-17 14:52:01.33 Removed 286 peaks
#> 2025-04-17 14:52:01.33 Initializing Lorentz curves
#> 2025-04-17 14:52:01.33 MSE at peak tiplet positions: 3.8338943428876719465848
#> 2025-04-17 14:52:01.33 Refining Lorentz Curves
#> 2025-04-17 14:52:01.33 MSE at peak tiplet positions: 0.1289481941626757499630
#> 2025-04-17 14:52:01.34 MSE at peak tiplet positions: 0.0135651899090413786964
#> 2025-04-17 14:52:01.34 MSE at peak tiplet positions: 0.0025556755331531087749
#> 2025-04-17 14:52:01.34 Formatting return object as decon2
#> 2025-04-17 14:52:01.35 Finished deconvolution of sim_02
#> 2025-04-17 14:52:01.35 Finished deconvolution of 2 spectra in 0.063 secs
aa <- align(dd)
#> 2025-04-17 14:52:01.35 All requested packages are already installed.
#> 
#> 
#>  --------------------------------
#>  dohCluster will run with maxShift= 50
#>  If you want dohCluster to detect the optimal maxShift automatically,
#>  use dohCluster(..., maxShift = NULL, ...)
#>  --------------------------------
#> 
#>  aligning spectrum  1
#>  Median pearson correlation of aligned spectra: 0.9976321
#>  Alignment time:  0.0001833333  minutes
s1 <- sim[[1]]
d1 <- dd[[1]]
a1 <- aa[[1]]

is_spectrum(s1) # TRUE
#> [1] TRUE
is_spectrum(s1, check_contents = TRUE) # TRUE
#> [1] TRUE
is_decon0(d1) # FALSE
#> [1] FALSE
is_decon1(d1) # FALSE
#> [1] FALSE
is_decon2(d1) # TRUE
#> [1] TRUE
is_align(a1) # TRUE
#> [1] TRUE

is_spectra(ss) # TRUE
#> [1] TRUE
is_decons0(dd) # FALSE
#> [1] FALSE
is_decons1(dd) # FALSE
#> [1] FALSE
is_decons2(dd) # TRUE
#> [1] TRUE
is_aligns(aa) # TRUE
#> [1] TRUE