Heart Rate Fragmentation Analyzer (Python GUI)

AWK-faithful metrics with GUI, plots, batch processing

Heart Rate Fragmentation (HRF) is a dynamical biomarker of sinoatrial-cardioautonomic dysfunction, introduced by Costa and Goldberger to address limitations in traditional heart rate variability (HRV) analysis. While HRV conflates healthy respiratory sinus arrhythmia with pathologic high-frequency fluctuations, HRF specifically quantifies excess reversals in heart rate acceleration—a signature of impaired vagal control often seen with aging, cardiovascular disease, and cognitive decline [Costa et al., 2017].

This software is a Python/Tkinter re-implementation of the original AWK-based Heart Rate Fragmentation (HRF) analysis tool available on PhysioNet [Costa, 2024]. It faithfully reproduces the core metrics—PIP (Percentage of Inflection Points), PNNSS, and PNNLS—while adding modern usability features for research and validation.

Features

Comparison to Original AWK Version

Metrics have been validated against the original AWK code, showing identical results.

Download & Source Code

GitHub Repository

Access the full source code, validation scripts, and sample datasets:

https://github.com/attilaasghari/Heart-Rate-Fragmentation-HRF

Direct Source Code Download

Download ZIP

Precompiled Binary (Windows)

Standalone executable for Windows (no Python required):

Download HRF GUI Windows

        sha256:301d4944e2f0ca441ae1d401d2bb3823ba152f2add8d425d6e7013632b9656d9
        

Sample Datasets (Original HRF Sources)

These validation datasets are derived directly from the original PhysioNet Heart Rate Fragmentation software. They reproduce the timing, annotations, and variability of true ECG R-peak sequences used in the foundational HRF study. All metrics shown below were computed with this Python GUI implementation and verified to match the original AWK results.

Usage Instructions

  1. Open one or more R-peak files using the "Open R-peak File(s)" button.
  2. Click "Run Analysis" to compute metrics and generate plots.
  3. Export results using "Export Results (CSV + Plot)" for research or publication purposes.
  4. View your recently used files via the dropdown menu for quick access.
  5. Optional: Customize NN_min, NN_max, or sampling frequency in the settings file.

Visual Overview

NN intervals are plotted with inflection points marked as red dashed lines, enabling rapid identification of fragmentation events.

NN intervals plot

[View full-size screenshot]

Heart Rate Fragmentation Analyzer in action: metrics computed from timeseries_1PVC.txt with NN interval plot showing inflection points (red dashed lines).

HRF Analyzer GUI showing results and plot

[View full-size screenshot]