Tools for creating chemical images from mass spectra
Before running this script, please make sure that you have Python3.6 or higher installed on your system. Make sure that all the required libraries are installed by running:
$ pip install -r requirements.txt
Before using the tool, mass spectrometric data has to be converted to an HDF5 file with the following internal structure.
The Images dataset is not mandatory but will be created automatically when a new image is added. For convenience, a tool for converting text files to HDF5 is included:
$ python convert_to_hdf5.py
The input text file should have the following structure:
time mass spectrum_0 spectrum_1 ... spectrum_n
... ... ... ... ...
The coordinates file should contain the x, y, and z coordinates for each of the recorded spectra.
After converting the data to HDF5 you can run the RASTERer tool:
$ python rasterer.py
After loading a file (Ctrl+O) you will see the average mass spectrum. Al the comments and saved images will be displayed in the File Info docked widget. You can plot a saved image by either double clicking on it or from the contextual menu. To plot a new image, select one or several regions on the average mass spectrum (right click and drag) and then click Plot Image. The obtained picture will appear in a separate window.
In the image window you are able to apply several transformations (α, β, γ, rotation, and mirroring) to the obtained figure and change the color map. The image can be then saved to HDF5, text or image file.