{"id":20669496,"url":"https://github.com/iitis/polar-hrv-data-analysis","last_synced_at":"2025-04-19T18:12:36.772Z","repository":{"id":227874799,"uuid":"656136090","full_name":"iitis/Polar-HRV-data-analysis","owner":"iitis","description":"Library for HRV data analysis based on measurements from Polar wearable devices","archived":false,"fork":false,"pushed_at":"2024-04-11T15:19:38.000Z","size":121,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T11:34:28.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iitis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-20T10:19:29.000Z","updated_at":"2025-02-01T00:40:34.000Z","dependencies_parsed_at":"2024-04-11T16:49:47.585Z","dependency_job_id":null,"html_url":"https://github.com/iitis/Polar-HRV-data-analysis","commit_stats":null,"previous_names":["iitis/polar-hrv-data-analysis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FPolar-HRV-data-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FPolar-HRV-data-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FPolar-HRV-data-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FPolar-HRV-data-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iitis","download_url":"https://codeload.github.com/iitis/Polar-HRV-data-analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249760126,"owners_count":21321843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T20:14:34.895Z","updated_at":"2025-04-19T18:12:36.747Z","avatar_url":"https://github.com/iitis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Polar HRV Data Analysis Library (PDAL) v 1.1\nLibrary for HRV and accelerometer data analysis based on measurements from Polar H10 wearable devices.\n\nIt is a source code related to the paper:\n\n\u003e The analysis of heart rate variability and accelerometer mobility data\nin the assessment of symptom severity in psychosis disorder patients\nusing a wearable Polar H10 sensor\n\nAuthors:\n- Kamil Książek (ITAI PAS, ORCID ID: [0000-0002-0201-6220](https://orcid.org/0000-0002-0201-6220)),\n- Wilhelm Masarczyk (FMS MUS, ORCID ID: [0000-0001-9516-0709](https://orcid.org/0000-0001-9516-0709)),\n- Przemysław Głomb (ITAI PAS, ORCID ID: [0000-0002-0215-4674](https://orcid.org/0000-0002-0215-4674)),\n- Michał Romaszewski (ITAI PAS, ORCID ID: [0000-0002-8227-929X](https://orcid.org/0000-0002-8227-929X)),\n- Iga Stokłosa (FMS UMS, ORCID ID: [0000-0002-7283-5491](https://orcid.org/0000-0002-7283-5491)),\n- Piotr Ścisło (PDMH, ORCID ID: [0000-0003-1213-2935](https://orcid.org/0000-0003-1213-2935)),\n- Paweł Dębski (FMS UMS, ORCID ID: [0000-0001-5904-6407](https://orcid.org/0000-0001-5904-6407)),\n- Robert Pudlo (FMS UMS, ORCID ID: [0000-0002-5748-0063](https://orcid.org/0000-0002-5748-0063)),\n- Krisztián Buza (BBU, SHU, ORCID ID: [0000-0002-7111-6452](https://orcid.org/0000-0002-7111-6452)),\n- Piotr Gorczyca (FMS UMS, ORCID ID: [0000-0002-9419-7988](https://orcid.org/0000-0002-9419-7988)),\n- Magdalena Piegza (FMS UMS, ORCID ID: [0000-0002-8009-7118](https://orcid.org/0000-0002-8009-7118)).\n\n*ITAI PAS* - Institute of Theoretical and Applied Informatics,\nPolish Academy of Sciences, Gliwice, Poland;  \n*FMS UMS* - Faculty of Medical Sciences in Zabrze,\nMedical University of Silesia, Tarnowskie Góry, Poland;  \n*PDMH* - Psychiatric Department of the Multidisciplinary Hospital,\nTarnowskie Góry, Poland;\n*BBU* - Budapest Business University, Hungary;\n*SHU* - Department of Mathematics-Informatics, Sapientia Hungarian University of Transylvania, Târgu Mureș, Romania.\n\n## LICENSE:\nCopyright 2023-2024\nInstitute of Theoretical and Applied Informatics,\nPolish Academy of Sciences (ITAI PAS) https://www.iitis.pl\n\nThe main author of the code:\n- Kamil Książek (ITAI PAS, ORCID ID: [0000-0002-0201-6220](https://orcid.org/0000-0002-0201-6220)).\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n## FUNCTIONALITY:\n- Loading RR intervals and accelerometer data from Polar H10 wearable devices collected through [Polar Sensor Logger](https://play.google.com/store/apps/details?id=com.j_ware.polarsensorlogger\u0026hl=pl\u0026gl=US) application.\n- Preparation of data preprocessing: identification and removal of anomalous measurements, data interpolation.\n- Calculation of HRV values using the RMSSD (Root Mean Square of the Successive Differences), SDNN (Standard Deviation of N-N intervals) or pNN50 (number of pairs of adjacent R-R intervals with a difference greater than 50 ms) approaches in sliding windows.\n- Calculation of mobility coefficient based on accelerometer data.\n- Data postprocessing: plots of results, distributions, the calculation of correlation coefficients, etc.\n\nThis library prepares a full analysis of the dataset considered in the related publication to ensure the reproducibility of the described results (including all plots).\n\n## DATASET:\n\nDownload the dataset from the following data repository:\nThe recommended path for data samples is `data` folder.\n\n## RULES AND USAGE:\n\n- Main HRV calculations are performed in the `main.py` file. Data is loaded, preprocessed, and HRV metrics are calculated in this file. Furthermore, the summary plots and calculation coefficients / statistical tests are performed. It is possible to choose one of the available HRV metrics, i.e. RMSSD, SDNN or pNN50, by setting `HRV_method` to `RMSSD`, `SDNN` or `pNN50`.\nTo reproduce detailed results for the window size of 15 minutes and the time interval between consecutive windows set as 1 minute, set `exclude_quetiapine = False` and `sensitivity_analysis = False` and run the file.\nTo reproduce sensitivity analysis for different window sizes and values of the time interval between consecutive time windows, set `exclude_quetiapine = False` and `sensitivity_analysis = True` and run the file. Then, to prepare the heatmaps of correlation, run the `utils_advanced_plots.py` file with the proper parameters according to the selected mode.\nTo reproduce results without the patients taking quetiapine, set `exclude_quetiapine = True` and `sensitivity_analysis = False`.\n\n- Main accelerometer calculations are performed in the `utils_accelerometer.py` file. Both RR interval and accelerometer data are loaded in this file. Then, accelerometer data is downsampled to achieve the same sample frequency in both data types. In the next step, the mobility coefficient for each person is calculated. Finally, a correlation coefficient between HRV and mobility value is computed. Furthermore, the dependency is presented in separate files per person and in the collective picture for all the tested persons.\nTo reproduce experiments comparing mobility and HRV data, just run the `utils_accelerometer.py` file.\n\n- To reproduce the histogram of age distribution in the two compared groups, just run the `utils_basic_plots.py` file.\n\n- To plot the collected accelerometer data, run the `utils_loading.py` file.\n\n- To perform unit tests of the code, run the `run_tests.py` file.\n\n**WARNING! Please ensure the proper paths to the dataset are set in the `main.py`, `utils_accelerometer.py` and `utils_loading.py` files.**\n\n## FILES:\n\n- `HRV_calculation.py`: contains functions for the calculation of mean HRV values according to the RMSSD approach as well as for the creation of sliding windows.\n- `main.py`: contains a mechanism for the loading and preprocessing data, calculation of HRV values and result analysis.\n- `run_tests.py`: runs tests in the `/tests/` catalogue.\n- `utils_accelerometer.py`: contains a mechanism for the loading and calculating mobility coefficient based on accelerometer data.\n- `utils_advanced_plots.py`: contains a function for heatmap plotting used in the sensitivity analysis.\n- `utils_basic_plots.py`: contains functions for preparing 1D plots of signal, scatterplots comparing HRV with the PANSS test values, box plots and plots of PANSS and age distributions.\n- `utils_loading.py`: contains functions loaded data, scores and data frames with intermediate results.\n- `utils_others.py`: contains auxiliary functions (i.e., appending rows to files, filtering patients and preparing the statistical test comparing HRV between the tested groups).\n- `utils_postprocessing.py`: functions for result saving.\n- `utils_preprocessing.py`: functions for data preprocessing, including manually selected anomalous values for removal.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiitis%2Fpolar-hrv-data-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiitis%2Fpolar-hrv-data-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiitis%2Fpolar-hrv-data-analysis/lists"}