Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets. More information on Cardinal
This tool provides three different Cardinal functions for supervised classification of mass-spectrometry imaging data.
Input data
MSI data: 3 types of input data can be used:
- imzml file (upload imzml and ibd file via the "composite" function) Introduction to the imzml format
- Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
- Cardinal "MSImageSet" or "MSImagingExperiment" saved as .RData
- NA intensities are not allowed
- duplicated coordinates will be removed
For training: tabular file with condition and fold for each pixel: Two columns for pixel coordinates (x and y values); one column with the condition for the pixel, which will be used for classification; for the cross validation (cvapply) another column with a fold is necessary, each fold must contain pixels of all response groups and is used for cross validation. Condition and fold columns are treated as factor to perform discriminant analysis (also when numeric values are provided).
x_coord y_coord condition fold 1 1 A f1 2 1 A f2 3 1 A f3 1 2 B f1 2 2 B f2 3 2 B f3 ... ...
For prediction: RData output from previous classification run is needed as input, optionally new response values can be loaded with a tabular file containing x values, y values and the response
Options
PLS-DA: partial least square discriminant analysis
O-PLS-DA: Orthogonal partial least squares discriminant analysis
Spatial shrunken centroids (more details in Bemis et al.)
training and prediction
- training can be done with cvapply that uses cross validation to find the best value for s, this requires not only a condition for each spectrum but also a fold (each fold should contain spectra of all conditions)
- training with the best value for r and s gives the top m/z features for each condition and the predicted classification group for each spectrum
- training result can be saved as RData file that can be reused for prediction of further samples
- prediction can calculate accuracies when the annotations are known and provided
Tips
Output