PyGPLA: A Python Package for Generalized Phase Locking Analysis
Spike-field couplings measure the links between neuronal spiking and local field potential (LFP) and provide a tool to study how neural populations coordinate activity across spatial and temporal scales. While modern high-density electrophysiology enables the simultaneous recording of numerous LFP channels and neuronal units, this massive scale poses significant statistical and computational challenges for conventional pairwise coupling analyses. The number of channel-unit comparisons grows rapidly, and a coherent population-level structure can be obscured by high-dimensional coupling matrices. Generalized Phase Locking Analysis (GPLA) addresses this challenge by organizing spike-triggered LFP phase information into a complex coupling matrix and extracting dominant low-rank modes. These modes summarize whether a population is coupled to the field, which channels and units contribute to the coupling, and how their relative phases are organized. Here, we present PyGPLA, an open-source Python package implementing GPLA for high-density electrophysiological recordings. Designed for straightforward integration into existing neural data analysis pipelines, PyGPLA supports multivariate spike-LFP coupling analysis, from coupling estimation and interpretation to significance assessment using analytical and surrogate-based tests.