Faculty of Computer Science, Mannheim University of Applied Sciences, Mannheim 68163, Germany.
Medical Faculty Mannheim, Heidelberg University, Mannheim 68167, Germany.
Bioinformatics. 2024 Mar 4;40(3). doi: 10.1093/bioinformatics/btae133.
Python is the most commonly used language for deep learning (DL). Existing Python packages for mass spectrometry imaging (MSI) data are not optimized for DL tasks. We, therefore, introduce pyM2aia, a Python package for MSI data analysis with a focus on memory-efficient handling, processing and convenient data-access for DL applications. pyM2aia provides interfaces to its parent application M2aia, which offers interactive capabilities for exploring and annotating MSI data in imzML format. pyM2aia utilizes the image input and output routines, data formats, and processing functions of M2aia, ensures data interchangeability, and enables the writing of readable and easy-to-maintain DL pipelines by providing batch generators for typical MSI data access strategies. We showcase the package in several examples, including imzML metadata parsing, signal processing, ion-image generation, and, in particular, DL model training and inference for spectrum-wise approaches, ion-image-based approaches, and approaches that use spectral and spatial information simultaneously.
Python package, code and examples are available at (https://m2aia.github.io/m2aia).
Python 是深度学习(DL)中最常用的语言。现有的用于质谱成像(MSI)数据的 Python 包并未针对 DL 任务进行优化。因此,我们引入了 pyM2aia,这是一个专注于内存高效处理、DL 应用程序的便捷数据访问的 MSI 数据分析的 Python 包。pyM2aia 提供了到其父应用程序 M2aia 的接口,该应用程序提供了用于交互式探索和注释 imzML 格式的 MSI 数据的功能。pyM2aia 利用了 M2aia 的图像输入和输出例程、数据格式和处理函数,确保了数据的可交换性,并通过为典型的 MSI 数据访问策略提供批生成器,使得编写可读且易于维护的 DL 管道成为可能。我们通过几个示例展示了该包,包括 imzML 元数据解析、信号处理、离子图像生成,特别是用于谱方法、基于离子图像的方法以及同时使用谱和空间信息的方法的 DL 模型训练和推理。
Python 包、代码和示例可在 (https://m2aia.github.io/m2aia) 获得。