MyNixOS website logo
Description

Compute Neural Fragility for Ictal iEEG.

Provides tools to compute the neural fragility matrix from intracranial electrocorticographic (iEEG) recordings, enabling the analysis of brain dynamics during seizures. The package implements the method described by Li et al. (2017) <doi:10.23919/ACC.2017.7963378> and includes functions for data preprocessing (`Epoch`), fragility computation (`calcAdjFrag`), and visualization.

EZFragility: Epileptogenic Zone Localization Based on neural Fragility EEG marker

R-CMD-check Codecov testcoverage

Introduction

The goal of this Rpackage is to allow neuroscientists to reproduce and test the neural fragility method described in (Li et al. 2017, 2021). This method implements an intracranial EEG (iEEG) marker of the epileptogenic zone localization. In this method, seizures are conceptualized as transitions from a stable networked system to an unstable one. To quantify this, node fragility is computed from linear network models, measuring each node’s susceptibility to destabilization. There are significant details missing in (Li et al. 2017, 2021) to reproduce the neural fragility method and adjust the parameters. This Rpackage aims to identify and fill up the implementation details. It will also allow users to test the method parameters on their data.

Installation

To install the package from GitHub

devtools::install_github("Jiefei-Wang/EZFragility")

EZFragility package tutorial

To load the package

library(EZFragility)

If you are working with the source code, you can load the package with

devtools::load_all()

The package contains an example data. To see the first 5 rows and columns of the data, type

pt01EcoG[1:5, 1:5]

The package contains an example results. To see it, type

pt01Frag

For explanations on how to use the package please refer to the vignette.

vignette("Intro_to_EZFragility", package = "EZFragility")

Implementation details

The method is based on building a discrete time linear system computing a stable adjacency matrix A for the evolution of x(t).
$x(t+1)=A x(t)$ with $x_i(t)$ the iEEG signal at time $t$ for electrode $i$. A is computed for a series of time windows to derive the fragility row.
In this package, we are applying a ridge regression to solve the matrix A. In (Li et al. 2017, 2021), a regularization parameter value of 1e-4 is recommended, however testing on the data from patient pt01 from the Fragility data set (data subset available in this package) this value does not ensure that A is always stable. To tackle this issue, we have implemented a dichotomy to search for the lowest stable lambda value rendering the matrix A stable (see R function ridgeSearch in file ridge.r).

The method to compute the row perturbation is also not clear. To compute the fragility row, a minimum 2-induced norm additive row perturbation $\Delta$ is computed to destabilize the linear network placing an eigenvalue of $A+\Delta$ at $\lambda=\sigma+j\omega$. The minimum norm is a function of $\lambda$ given in (Li et al. 2017) (see function fragilityRow in the scrip fragility.r), however the paper does not describe how to choose $\lambda$ with $|\lambda|=1$. To tackle this issue, we search for the value that minimize the norm of $\Delta$.

References

Li, Adam, Chester Huynh, Zhary Fitzgerald, Iahn Cajigas, and Damina Brusko. 2021. “Neural Fragility as an EEG Marker of the Seizure Onset Zone.” Nature Neuroscience 24 (10): 1465–74. https://doi.org/10.1038/s41593-021-00901-w.

Li, Adam, Sara Inati, Kareem Zaghloul, and Srivedi Sarma. 2017. Fragility in Epileptic Networks: The Epileptogenic Zone. Lecture Notes in Computer Science. IEEE. https://doi.org/10.23919/ACC.2017.7963378.

Metadata

Version

1.0.3

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows