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 GCIMSSample
estimateBaseline(
  object,
  dt_peak_fwhm_ms,
  dt_region_multiplier,
  rt_length_s,
  remove = TRUE
)

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

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

Arguments

object

A GCIMSSample 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

rt_length_s

The length of the baseline region. It should be comparable or longer than the peak width

remove

A boolean, if TRUE it removes the baseline from the intensity

dt_range

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

rt_range

The minimum and maximum retention 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)

rt_idx

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

.error_if_missing

A logical. If TRUE, raise error if baseline has not been estimated. If FALSE returns NULL instead.

value

A matrix with the sample baseline of the same dimensions as dim(object)

Value

The modified GCIMSSample

Functions

  • baseline(GCIMSSample): Get the baseline

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