-
Download the package from https://github.com/CINVESTAV-LABI/julia_mzML_imzML.
-
Download and Install the following libraries:
Libz
,Plots
package running the following script. this code only needs to be run the first time you run this exampleimport Pkg; Pkg.add("Libz") import Pkg; Pkg.add("Plots")
-
Activate
julia_mzML_imzML
package running the following scriptusing Libz using Pkg Pkg.activate( "C:/your/dowwnload/folder/julia_mzML_imzML" ) using julia_mzML_imzML
C:/your/dowwnload/folder
is the path on your computer, where the Github repository was downloaded. Now your are able to execute the test scripts.
-
Make sure you have a mzML file. In this example, we provide a script for downloading available public mzML files.
samplesDir = "C:/some/data/folder/" # LC-ESI MS: Arabidopsis download( "https://zenodo.org/record/8185092/files/Col_1.mzML?download=1", joinpath( samplesDir, "Col_1.mzML" ) ) # Replace Col_1 with Cytochrome_C to download ESI-MS Cytochrome C file # Replace Col_1 with T9_A1 to downloadw LTP-MS Arabidopsis file
-
Load your data in Julia
# Load mzML file spectra = LoadMzml( joinpath( samplesDir, "Col_1.mzML" ) )
Now the scans are loaded in the vector
spectra
. Each row corresponds to a single scan, the first column contains a vector with the x-axis and its corresponding y-axis is stored in the second column. -
Plot a scan. In the following example we plot the fourth scan of
Col_1.mzML
file# Plot scan using Plots plot( spectra[1,4], spectra[2,4] )
-
The following example loads the DESI_MSI Carcinoma imzML file from a public repository.
samplesDir = "C:/some/data/folder/" # DESI_MSI: Carcinoma download( "https://ftp.cngb.org/pub/gigadb/pub/10.5524/100001_101000/100131/ColAd_Individual/ColAd_Individual.zip", joinpath( samplesDir, "ColAd_Individual.zip" ) )
-
Extract the imzML & ibd files
80TopL, 50TopR, 70BottomL, 60BottomR-centroid.imzML
is located inside the folder80TopL, 50TopR, 70BottomL, 60BottomR
Note: There are many other samples and subfolders in the dataset -
Load the imzML file in memory
# AP_SMALDI: Mouse Bladder fileName = "80TopL, 50TopR, 70BottomL, 60BottomR-centroid.imzML" spectra = LoadImzml( joinpath( samplesDir, fileName ) )
-
Extract a mz slice
# Extract image slice slice = GetSlice( spectra, 885.55, 0.005 )
-
Render the image as bitmap
# Save slice as bitmap with Zero-Memory quantizier SaveBitmap( joinpath( samplesDir, "Slice.bmp" ), IntQuant( slice ), ViridisPalette )
-
You can improve the dynamic range of the image using the TrIQ algorithm.
# Improve dynamic range with TrIQ alorithm SaveBitmap( joinpath( samplesDir, "TrIQ.bmp" ), TrIQ( slice, 256, 0.95 ), ViridisPalette )
Robert Winkler. (2023). mzML mass spectrometry and imzML mass spectrometry imaging test data [Data set]. Zenodo. https://doi.org/10.5281/zenodo.10084132
Technical Note: mzML and imzML Libraries for Processing Mass Spectrometry Data with the High-Performance Programming Language Julia
Ignacio Rosas-Román, Héctor Guillén-Alonso, Abigail Moreno-Pedraza, and Robert Winkler
Analytical Chemistry Article ASAP
DOI: 10.1021/acs.analchem.3c05853