Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

msiSlices-functions

Turn a list of AbstractMassObjects into a mass spectrometry imaging slice.


Description

This function turns a mass spectrometry imaging dataset represented by a list of AbstractMassObject objects into an intensityMatrix for each slice (stored in an array).

Usage

msiSlices(x, center, tolerance, method=c("sum", "mean", "median"), adjust=TRUE)

Arguments

x

a list of MassSpectrum/ MassPeaks objects.

center

double, the center mas value of each slice.

tolerance

double, specifies the thickness of the slices (center + c(-tolerance, tolerance)).

method

used aggregation function.

adjust

logical, if TRUE the lowest coordinates of the mass spectrometry imaging dataset are set to c(x=1, y=1) to avoid NA values at the borders.

Details

Each MassSpectrum/MassPeaks object in x must contain a list named imaging with an element pos that stores the x and y value of the spectrum, e.g.:

> metaData(spectra[[1]])$imaging$pos
x y
1 5

Value

Returns an array of three dimensions. The first and second dimensions contains the x and y coordinates of the image. The third dimension represents the index of the center of each slice. There are two additional attributes, namely "center" and "tolerance" which store the original center and tolerance information.

Author(s)

Sebastian Gibb mail@sebastiangibb.de

See Also

Please find real examples on:

Examples

## load package
library("MALDIquant")

## load example data
data("fiedler2009subset", package="MALDIquant")

## please note: this is NOT a MSI data set
## we just add some coordinates for demonstration
coordinates(fiedler2009subset) <- cbind(x=rep(1:4, 2), y=rep(1:2, each=4))

slices <- msiSlices(fiedler2009subset, center=c(5864.49, 8936.97),
                    tolerance=0.25)

slices

MALDIquant

Quantitative Analysis of Mass Spectrometry Data

v1.19.3
GPL (>= 3)
Authors
Sebastian Gibb [aut, cre] (<https://orcid.org/0000-0001-7406-4443>), Korbinian Strimmer [ths] (<https://orcid.org/0000-0001-7917-2056>)
Initial release
2019-05-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.