TITLE: Supporting protocol for use-case 1: Dimensionality reduction in "M2aia - Interactive, fast and memory efficient analysis of 2D and 3D multi-modal mass spectrometry imaging data"
AUTHORS: Jonas Cordes

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block"><a href="https://jtfcordes.github.io/M2aia" style = "text-decoration:underline;color:blue;cursor:pointer;"><span style = ":;">M²aia</span></a><span> is able to apply dimensionality reduction methods to 2D/3D MSI images. To demonstrate the DR methods we load a single peptide brain slice MS image, select multiple peaks from a peak list and start a PCA and t-SNE.</span></div><br/></div>

[STEPS]
?. [Load Data into M²aia]
Open the Data view and define the signal processing:set your normalization strategy (e.g. TIC)set your smoothing strategy (e.g. Gaussian)set your baseline correction strategy (e.g. Median)Load at least one continuous profile *.imzML image file into M²aia: File > Open File  or Ctrl + O.Ensure, that the corresponding *.ibd file is available at the same directory level.
?. [Peak picking]
Open the Peak Picking view, e.g. from the menu: Window > Show View > Peak Picking.Select an overview spectrum type in the drop-down menu (e.g. Mean).Set the peak picking parameters (example):set the SNR to 2enable monoisotopic peak harvestingset the min correlation to 0.6Start the peak picking.
The peak picking utilities of the Peak Picking view are designed for handling overview spectra. Pixel-wise peak picking is not realized within the graphical user interface of M²aia.
The drop-down menu selection is not synced to the overview spectrum shown in the Spectrum view. You can change the overview spectrum shown in the Spectrum view using the right click context menu while hovering the overview spectrum.
?. [Peak selection and PCA]
Select peaks of interest (red annotations).Select the target dimensionality and start the PCA (blue annotation).The result image is now available in the Data Manager view. You can change the currently displayed projected image by using the right click menu of the "PCA"-datanode and the Component slider.
You can select/deselect all peaks by clicking on the upper left corner button (red arrow). Double click on individual rows will perform an imaging request according to the given m/z value of this row and tolerance specified in the Imaging tab of the Data view.
The image generated by the PCA serves as the input for the t-SNE.
?. [t-SNE]
Set the t-SNE parameters (example):set iterations to 200set perplexity to 10set shrink factor to 2Make sure that a "PCA" named datanode is available as derived node of the MSI datanode. Start the t-SNE.
To find good parameters for the t-SNE please check the FQA of Laurens van der Maaten's github.io page.
The calculation of the t-SNE may take some time. The status can be tracked within the console window of M²aia.
If the image has many pixels (as in the example shown >140k pixels), the calculation time can be very long. This can be reduced e.g. by decreasing the lateral resolution. For this purpose the shrinkage factor can be adjusted. The image is reduced in resolution by dividing the lateral dimensions by the specified factor. This reduces the t-SNE calculation time. After successful application of the t-SNE, the image is resampled to restore the original image geometry.