DOI: 10.3390/metabo16080585 ISSN: 2218-1989

PyCompound: An Open-Source Python Package for Spectral-Library Matching in Mass Spectrometry-Based Metabolomics

Hunter Dlugas, Xiang Zhang, Xun Bao, Jing Li, Ikuko Kato, Seongho Kim

Spectral-library matching is a widely used approach for compound annotation in mass spectrometry (MS)-based metabolomics, yet annotation performance is influenced by spectrum preprocessing, parameter selection, and similarity-measure choice. We present PyCompound, an open-source Python package for spectral-library matching with flexible preprocessing, parameter optimization, and diverse similarity measures for both nominal-resolution and high-resolution mass spectrometry data. PyCompound implements six preprocessing procedures, nineteen similarity measures, including the newly developed Rényi entropy similarity in this work for spectral-library matching, user-defined composite similarity scores, and automated parameter optimization using grid search and differential evolution. The software supports common spectral formats and is accessible through a Python API, command-line interface, and interactive Shiny application. The software was validated using public GNPS LC-MS/MS and WebNIST GC-MS datasets, where the newly developed Rényi entropy similarity demonstrated annotation performance comparable to that of the established Shannon and Tsallis entropy similarity measures. PyCompound provides a flexible platform for practical compound annotation through configurable preprocessing workflows, diverse similarity measures, and automated parameter optimization.

More from our Archive