The baseline is estimated by connecting local minima and interpolating from those. The local minima are identified as "the minima in each region of length x" The length of the regions are estimated as fwhm * a multiplier / 2.3482. This assumes it's several times

# S4 method for GCIMSSpectrum
estimateBaseline(object, dt_peak_fwhm_ms, dt_region_multiplier = 12)

# S4 method for GCIMSSpectrum
baseline(object, dt_range = NULL, dt_idx = NULL, .error_if_missing = TRUE)

# S4 method for GCIMSSpectrum
baseline(object) <- value

Arguments

object

A GCIMSSpectrum object

dt_peak_fwhm_ms

Full Width at Half Maximum in milliseconds. Used to determine the length of the regions where local minima are searched.

dt_region_multiplier

A multiplier to calculate the region

dt_range

The minimum and maximum drift times to extract (length 2 vector)

dt_idx

A numeric vector with the drift time indices to extract (or a logical vector of the length of drift time)

.error_if_missing

A logical. If TRUE (default) give an error if baseline is not estimated. Returns NULL otherwise.

value

A vector with a baseline of the same length as intensity(object)

Value

The modified GCIMSSpectrum

Functions

  • baseline(GCIMSSpectrum): Get the baseline

  • baseline(GCIMSSpectrum) <- value: Set the baseline