Issue 14, 2025

PyFasma: an open-source, modular Python package for preprocessing and multivariate analysis of Raman spectroscopy data

Abstract

Raman spectroscopy is a versatile, label-free technique for probing molecular composition in biological samples. However, the detection of subtle biochemical traits in high-throughput spectral datasets requires careful preprocessing, dimensionality reduction, and statistically sound analytical strategies. We present PyFasma, an open-source Python package for Raman spectroscopy, integrating essential preprocessing tools (e.g., spike removal, smoothing, baseline correction, normalization), multivariate techniques (PCA, PLS-DA), and spectral deconvolution within a modular, Jupyter Notebook-friendly framework. In addition to describing the software, we demonstrate PyFasma's capabilities through a practical biomedical case study comparing Raman spectra from healthy and osteoporotic cortical bone samples. The results revealed statistically significant differences in mineral-to-matrix ratio and crystallinity between assigned groups, with PCA and PLS-DA successfully distinguishing pathological from normal bone spectra. PyFasma encourages best practices in model validation, including the powerful but often overlooked, repeated stratified cross-validation, enhancing the generalizability of multivariate analyses. It also offers an easy-to-use, extensible solution for Raman data analysis, enabling the reproducible and robust interpretation of complex spectra of biological samples.

Graphical abstract: PyFasma: an open-source, modular Python package for preprocessing and multivariate analysis of Raman spectroscopy data

Article information

Article type
Paper
Submitted
23 Apr 2025
Accepted
04 Jun 2025
First published
09 Jun 2025
This article is Open Access
Creative Commons BY license

Analyst, 2025,150, 3112-3122

PyFasma: an open-source, modular Python package for preprocessing and multivariate analysis of Raman spectroscopy data

E. Pavlou and N. Kourkoumelis, Analyst, 2025, 150, 3112 DOI: 10.1039/D5AN00452G

This article is licensed under a Creative Commons Attribution 3.0 Unported Licence. You can use material from this article in other publications without requesting further permissions from the RSC, provided that the correct acknowledgement is given.

Read more about how to correctly acknowledge RSC content.

Social activity

Spotlight

Advertisements