The goal of unsupervised analysis of mass spectrometry (MS) imaging experiments is to discover regions in the data with distinct chemical profiles, and to select the m/z-values that uniquely distinguish these different regions from each other.
Algorithmically, this means clustering the data. In imaging experiments, the resulting cluster configurations are called spatial segmentations, and the clusters are called segments.
In this vignette, we present an example segmentation workflow using Cardinal.
We begin by loading the package:
library(Cardinal)
This example uses the PIGII_206 dataset: a cross section of a pig fetus captured using a Thermo LTQ instrument using desorption electrospray ionization (DESI).
First, we load the dataset from the CardinalWorkflows package. The data is stored in an older format, so we need to coerce it to an MSImagingExperiment
.
data(pig206, package="CardinalWorkflows")
pig206 <- as(pig206, "MSImagingExperiment")
The dataset contains 4,959 spectra with 10,200 m/z-values.
pig206
## An object of class 'MSContinuousImagingExperiment'
## <10200 feature, 4959 pixel> imaging dataset
## imageData(1): intensity
## featureData(0):
## pixelData(0):
## run(1): PIGII_206
## raster dimensions: 111 x 66
## coord(2): x = 10..120, y = 1..66
## mass range: 150.0833 to 1000.0000
## centroided: FALSE