Abstract
The current treatment for drug-resistant epilepsy is surgical intervention, which relies on accurate identification of the seizure onset zone (SOZ) using intracranial EEG (iEEG) data. iEEG analysis with computational epileptogenic zone identification algorithms (CEZIAs) is a promising step towards better SOZ localization and surgical outcomes. A key step in validation and adoption of CEZIAs is to allow for widespread shared development and validation of code and data. We describe a set of three R packages to achieve this goal. Our ecosystem of seizure localization methods involves a straightforward analysis pipeline, standardized data formatting and storage, and completely documented and open-source code. The TableContainer package allows for easy storage and manipulation of table data, serving as groundwork for the Epoch package, which is specifically geared towards iEEG data. The Epoch package allows for cropping, resampling, and visualization of iEEG data and provides publicly downloadable iEEG data for reproducibility. The public iEEG dataset includes 8 females and 6 males, with a total of 47 iEEG recordings. Finally, the EZFragility package uses these two foundational packages to analyze iEEGs for SOZ localization using the Neural Fragility method described by (Li et al., 2021). EZFragility was built using the same core principles as the original method but included several enhancements in computational efficiency and user experience. It accurately reproduces neural fragility results for both sample patients used in the original paper. This project serves as the first step towards building an open-source, reproducible ecosystem of seizure localization methods in R. Future steps include the addition of other CEZIAs using the framework and sample data already made available by these packages.
Significance Statement Localization of the seizure onset zone (SOZ) is a critical step in surgical treatment of drug-resistant epilepsy. Computational epileptogenic zone identification algorithms (CEZIAs) are promising potential tools to aid in clinical decision-making. However, shared development and verification of CEZIAs is difficult due to limitations in packaging, accessibility, and reproducibility. The EZFragility software package (Wang et al., 2025a) is the first step toward building a collaborative ecosystem of CEZIAs by providing an open, standardized, and reproducible software framework. EZFragility and its dependent packages TableContainer (Wang, 2025a) and Epoch (Wang et al., 2025b) are freely available on the Comprehensive R Archive Network (CRAN), with source code viewable on GitHub. They provide an open-source framework for CEZIA code, data formatting, and data access, all with extensive documentation. Our primary development goal is to support epilepsy research with open-source software, and our overarching mission is to aid clinical decision-making by providing more accurate predictions of surgical outcomes.
Footnotes
A. No (State ‘Authors report no conflict of interest’)
This work was supported by the American Society for Stereotactic and Functional Neurosurgery Research Fellowship, and Grant #BHI2024 - 16 from the Moody Brain Health Institute at UTMB.
This is an open-access article distributed under the terms of the Creative Commons Attribution 4.0 International license, which permits unrestricted use, distribution and reproduction in any medium provided that the original work is properly attributed.





