Get a spectrum from each sample of a dataset

# S4 method for class 'GCIMSDataset'
getSpectrum(
  object,
  dt_range = NULL,
  rt_range = NULL,
  dt_idx = NULL,
  rt_idx = NULL,
  aggregate = rowSums
)

Arguments

object

A GCIMSDataset object

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)

aggregate

Function that takes the subsetted intensity matrix of each sample according to the region of interest and aggregates the retention times, returning a vector representing the spectrum intensity. rowSums by default.

Value

A GCIMSSpectrumSet, with one GCIMSSpectrum per sample (each on its own drift time axis, no interpolation across samples) and a copy of pData(object)