Full text 2026

PyFgsea: a Rust-powered, fgseaMultilevel-aligned GSEA framework with rolling-window enrichment along single-cell trajectories

Wang K, Shi H.

Full text

Loading PDF… Expand reader Download

Abstract

<h4>Summary</h4>GSEA is a standard approach for pathway interpretation, yet Python ecosystems lack a high-performance implementation aligned with the fgseaMultilevel rare-event estimator target, especially for trajectory-aware rolling-window analysis. Under matched inputs, PyFgsea remains near-identical for normalized enrichment scores (NES; Pearson r>0.999), machine-precision identical for enrichment scores (ES), and statistically faithful for nominal P values relative to the R fgseaMultilevel reference. Its stateful rolling-window engine further reduces repeated trajectory-analysis overhead, yielding ∼1.9-fold end-to-end wall-time speedup in a conservative stress test and, in a narrower 100-window component benchmark, up to 7.47-fold acceleration. Rolling-window significance is controlled only by within-window Benjamini-Hochberg correction across pathways rather than by trajectory-wide global error control, so these profiles are intended primarily for local trend exploration and candidate-pathway prioritization.<h4>Availability and implementation</h4>Source code is available at https://github.com/shayuanxukuang/pyfgsea and via PyPI (pip install pyfgsea). An archival snapshot of the code and benchmark data is available on Zenodo (DOI: 10.5281/zenodo.19446446).