Skip to contents

Generate binned intensity matrix based on reference peaks generated via Cardinal

Usage

bin_SpectralImagingExperiment(
  x,
  ref,
  spectra = "intensity",
  index = NULL,
  method = c("sum", "mean", "max", "min", "linear", "cubic", "gaussian", "lanczos"),
  resolution = NA,
  tolerance = NA,
  units = c("relative", "absolute"),
  verbose = getCardinalVerbose()
)

Arguments

x

The spectral data to be binned, typically a matrix or data frame.

ref

A vector of reference mass-to-charge (m/z) values for binning. If left unspecified, mass range will be used to generate reference peaks.

spectra

Character string specifying the column name for spectral intensity values (default = "intensity").

index

Character string specifying the column name for the m/z values (default = "mz").

method

A character vector specifying the binning method. Options include "sum", "mean", "max", "min", "linear", "cubic", "gaussian", and "lanczos". If not specified default method used is "sum".

resolution

Numeric value specifying the resolution for binning. If assigned as NA, the resolution will be automatically caculated based on the data (default = NA).

tolerance

Numeric value specifying the tolerance for m/z matching (default = NA).

units

Character string specifying the units for resolution. Options are "ppm" or "mz" (default = "ppm").

verbose

Boolean indicating whether to show the message. If TRUE the message will be show, else the message will be suppressed.

Value

Matrix object which has binned intensity values.

Examples

#Helper function for binning data in Matrix format