paradigma 1.0.2__tar.gz → 1.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {paradigma-1.0.2 → paradigma-1.0.4}/LICENSE +0 -1
  2. {paradigma-1.0.2 → paradigma-1.0.4}/PKG-INFO +39 -36
  3. {paradigma-1.0.2 → paradigma-1.0.4}/README.md +34 -34
  4. {paradigma-1.0.2 → paradigma-1.0.4}/pyproject.toml +13 -3
  5. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/classification.py +28 -11
  6. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/config.py +158 -101
  7. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/constants.py +39 -34
  8. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/feature_extraction.py +270 -211
  9. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/pipelines/gait_pipeline.py +286 -190
  10. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/pipelines/pulse_rate_pipeline.py +202 -133
  11. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/pipelines/pulse_rate_utils.py +144 -142
  12. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/pipelines/tremor_pipeline.py +139 -95
  13. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/preprocessing.py +179 -110
  14. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/segmenting.py +138 -113
  15. paradigma-1.0.4/src/paradigma/testing.py +617 -0
  16. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/util.py +171 -80
  17. paradigma-1.0.2/src/paradigma/testing.py +0 -430
  18. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/__init__.py +0 -0
  19. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/assets/gait_detection_clf_package.pkl +0 -0
  20. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/assets/gait_filtering_clf_package.pkl +0 -0
  21. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/assets/ppg_quality_clf_package.pkl +0 -0
  22. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/assets/tremor_detection_clf_package.pkl +0 -0
  23. {paradigma-1.0.2 → paradigma-1.0.4}/src/paradigma/pipelines/__init__.py +0 -0
@@ -189,4 +189,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
189
189
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
190
  See the License for the specific language governing permissions and
191
191
  limitations under the License.
192
-
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: paradigma
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: ParaDigMa - A toolbox for deriving Parkinson's disease Digital Markers from real-life wrist sensor data
5
5
  License: Apache-2.0
6
+ License-File: LICENSE
6
7
  Author: Erik Post
7
8
  Author-email: erik.post@radboudumc.nl
8
9
  Requires-Python: >=3.11,<4.0
@@ -11,6 +12,8 @@ Classifier: Programming Language :: Python :: 3
11
12
  Classifier: Programming Language :: Python :: 3.11
12
13
  Classifier: Programming Language :: Python :: 3.12
13
14
  Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Requires-Dist: nbconvert (>=7.16.6,<8.0.0)
14
17
  Requires-Dist: pandas (>=2.1.4,<3.0.0)
15
18
  Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
16
19
  Requires-Dist: pytype (>=2024.4.11,<2025.0.0)
@@ -28,25 +31,25 @@ Description-Content-Type: text/markdown
28
31
  | **DOI** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13838392.svg)](https://doi.org/10.5281/zenodo.13838392) |
29
32
  | **Build Status** | [![](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![Build and test](https://github.com/biomarkersParkinson/paradigma/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/biomarkersParkinson/paradigma/actions/workflows/build-and-test.yml) [![pages-build-deployment](https://github.com/biomarkersParkinson/paradigma/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/biomarkersParkinson/paradigma/actions/workflows/pages/pages-build-deployment) |
30
33
  | **License** | [![GitHub license](https://img.shields.io/github/license/biomarkersParkinson/paradigma)](https://github.com/biomarkersparkinson/paradigma/blob/main/LICENSE) |
31
- <!-- | **Fairness** | [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8083/badge)](https://www.bestpractices.dev/projects/8083) | -->
34
+ <!-- | **Fairness** | [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8083/badge)](https://www.bestpractices.dev/projects/8083) | -->
32
35
 
33
36
  ## Overview
34
37
  The Parkinson's disease Digital Markers (ParaDigMa) toolbox is a Python
35
38
  software package designed for processing real-life wrist sensor data
36
- to extract digital measures of motor and non-motor signs of Parkinson's disease (PD).
37
-
38
- Specifically, the toolbox is designed to process accelerometer, gyroscope and
39
- photoplethysmography (PPG) signals, collected during passive monitoring in daily life.
40
- It contains three data processing pipelines: (1) arm swing during gait, (2) tremor,
41
- and (3) pulse rate. These pipelines are scientifically validated for their
42
- use in persons with PD. Furthermore, the toolbox contains general functionalities for
43
- signal processing and feature extraction, such as filtering, peak detection, and
44
- spectral analysis.
45
-
46
- The toolbox is accompanied by a set of example scripts and notebooks for
47
- each processing pipeline that demonstrate how to use the toolbox for extracting
39
+ to extract digital measures of motor and non-motor signs of Parkinson's disease (PD).
40
+
41
+ Specifically, the toolbox is designed to process accelerometer, gyroscope and
42
+ photoplethysmography (PPG) signals, collected during passive monitoring in daily life.
43
+ It contains three data processing pipelines: (1) arm swing during gait, (2) tremor,
44
+ and (3) pulse rate. These pipelines are scientifically validated for their
45
+ use in persons with PD. Furthermore, the toolbox contains general functionalities for
46
+ signal processing and feature extraction, such as filtering, peak detection, and
47
+ spectral analysis.
48
+
49
+ The toolbox is accompanied by a set of example scripts and notebooks for
50
+ each processing pipeline that demonstrate how to use the toolbox for extracting
48
51
  digital measures. In addition, the toolbox is designed to be modular, enabling
49
- researchers to easily extend the toolbox with new algorithms and functionalities.
52
+ researchers to easily extend the toolbox with new algorithms and functionalities.
50
53
 
51
54
  ## Features
52
55
  The components of ParaDigMa are shown in the diagram below.
@@ -59,20 +62,20 @@ ParaDigMa can best be understood by categorizing the sequential processes:
59
62
 
60
63
  | Process | Description |
61
64
  | ---- | ---- |
62
- | Preprocessing | Preparing raw sensor signals for further processing |
65
+ | Preprocessing | Preparing raw sensor signals for further processing |
63
66
  | Feature extraction | Extracting features based on windowed sensor signals |
64
- | Classification | Detecting segments of interest using validated classifiers (e.g., gait segments) |
67
+ | Classification | Detecting segments of interest using validated classifiers (e.g., gait segments) |
65
68
  | Quantification | Extracting specific measures from the detected segments (e.g., arm swing measures) |
66
69
  | Aggregation | Aggregating the measures over a specific time period (e.g., week-level aggregates) |
67
70
 
68
71
  <br/>
69
- ParaDigMa contains the following validated processing pipelines (each using the processes described above):
72
+ ParaDigMa contains the following validated processing pipelines (each using the processes described above):
70
73
 
71
- | Pipeline | Input | Output classification | Output quantification | Output week-level aggregation |
74
+ | Pipeline | Input | Output classification | Output quantification | Output week-level aggregation |
72
75
  | ---- | ---- | ---- | ---- | ---- |
73
- | **Arm swing during gait** | Wrist accelerometer and gyroscope data | Gait probability, gait without other arm activities probability | Arm swing range of motion (RoM) | Typical & maximum arm swing RoM |
74
- | **Tremor** | Wrist gyroscope data | Tremor probability | Tremor power | % tremor time, typical & maximum tremor power |
75
- | **Pulse rate** | Wrist PPG and accelerometer data | PPG signal quality | Pulse rate | Resting & maximum pulse rate |
76
+ | **Arm swing during gait** | Wrist accelerometer and gyroscope data | Gait probability, gait without other arm activities probability | Arm swing range of motion (RoM) | Typical & maximum arm swing RoM |
77
+ | **Tremor** | Wrist gyroscope data | Tremor probability | Tremor power | % tremor time, typical & maximum tremor power |
78
+ | **Pulse rate** | Wrist PPG and accelerometer data | PPG signal quality | Pulse rate | Resting & maximum pulse rate |
76
79
 
77
80
  ## Installation
78
81
 
@@ -90,9 +93,9 @@ The API reference contains detailed documentation of all toolbox modules and fun
90
93
  The user guides provide additional information about specific topics (e.g. the required orientation of the wrist sensor).
91
94
 
92
95
  ### Sensor data requirements
93
- The ParaDigMa toolbox is designed for the analysis of passive monitoring data collected using a wrist sensor in persons with PD.
96
+ The ParaDigMa toolbox is designed for the analysis of passive monitoring data collected using a wrist sensor in persons with PD.
94
97
 
95
- Specific requirements include:
98
+ Specific requirements include:
96
99
  | Pipeline | Sensor Configuration | Context of Use |
97
100
  |------------------------|--------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
98
101
  | **All** | - Sensor position: wrist-band on most or least affected side (validated for both, but different sensitivity for measuring disease progression for tremor and arm swing during gait). <br> - Sensor orientation: orientation as described in [Coordinate System](https://biomarkersparkinson.github.io/paradigma/guides/coordinate_system.html). <br> - Timeframe: contiguous, strictly increasing timestamps. | - Population: persons with PD. <br> - Data collection protocol: passive monitoring in daily life. |
@@ -100,25 +103,25 @@ Specific requirements include:
100
103
  | **Tremor** | - Gyroscope: minimum sampling rate of 100 Hz, minimum range of ± 1000 degrees/sec. | - Compliance: for weekly measures: at least three compliant days (with ≥10 hours of data between 8 am and 10 pm). |
101
104
  | **Pulse rate** | - PPG*: minimum sampling rate of 30 Hz, green LED. <br> - Accelerometer: minimum sampling rate of 100 Hz, minimum range of ± 4 g. | - Population: no rhythm disorders (e.g. atrial fibrillation, atrial flutter). <br> - Compliance: for weekly measures: minimum average of 12 hours of data per day. |
102
105
 
103
- \* The processing of PPG signals is currently based on the blood volume pulse (arbitrary units) obtained from the Verily Study Watch, and we are currently testing the applicability of the pipeline to other PPG devices.
106
+ \* The processing of PPG signals is currently based on the blood volume pulse (arbitrary units) obtained from the Verily Study Watch. [This](https://biomarkersparkinson.github.io/paradigma/tutorials/_static/pulse_rate_analysis.html#step-3-signal-quality-classification) part of the PPG tutorial provides code and documentation on how to use the pipeline with other PPG devices.
104
107
 
105
108
  > [!WARNING]
106
- > While the toolbox is designed to work on any wrist sensor device which fulfills the requirements,
107
- we have currently verified its performance on data from the Gait-up Physilog 4 (arm swing during gait & tremor) and the Verily Study Watch (all pipelines). Furthermore, the specifications above are the minimally validated requirements. For example, while ParaDigMa works with accelerometer and gyroscope data sampled at 50 Hz, its effect on subsequent processes has not been empirically validated.
109
+ > While the toolbox is designed to work on any wrist sensor device which fulfills the requirements,
110
+ we have currently verified its performance on data from the Gait-up Physilog 4 (arm swing during gait & tremor) and the Verily Study Watch (all pipelines). Furthermore, the specifications above are the minimally validated requirements. For example, while ParaDigMa works with accelerometer and gyroscope data sampled at 50 Hz, its effect on subsequent processes has not been empirically validated.
108
111
  <br/>
109
112
 
110
113
  We have included support for [TSDF](https://biomarkersparkinson.github.io/tsdf/) as format for loading and storing sensor data. TSDF enables efficient data storage with added metadata. However, ParaDigMa does not require a particular method of data storage and retrieval. Please see our tutorial [Data preparation](https://biomarkersparkinson.github.io/paradigma/tutorials/data_preparation.html) for examples of loading TSDF and other data formats into memory, and for preparing raw sensor data as input for the processing pipelines.
111
114
 
112
115
  ## Scientific validation
113
116
 
114
- The pipelines were developed and validated using data from the Parkinson@Home Validation study [[Evers et al. 2020]](https://pmc.ncbi.nlm.nih.gov/articles/PMC7584982/) and the Personalized Parkinson Project [[Bloem et al. 2019]](https://pubmed.ncbi.nlm.nih.gov/31315608/). The following publication contains the details and validation of the arm swing during gait pipeline:
115
- * [Post, E. et al. - Quantifying arm swing in Parkinson's disease: a method account for arm activities during free-living gait](https://doi.org/10.1186/s12984-025-01578-z)
116
-
117
- Details and validation of the other pipelines shall be shared in upcoming scientific publications.
117
+ The pipelines were developed and validated using data from the Parkinson@Home Validation study [[Evers et al. (2020)]](https://pmc.ncbi.nlm.nih.gov/articles/PMC7584982/) and the Personalized Parkinson Project [[Bloem et al. (2019)]](https://pubmed.ncbi.nlm.nih.gov/31315608/). The following publications contain details and validation of the pipelines:
118
+ * [Post, E. et al. (2025) - Quantifying arm swing in Parkinson's disease: a method account for arm activities during free-living gait](https://doi.org/10.1186/s12984-025-01578-z)
119
+ * [Timmermans, N.A. et al. (2025) - A generalizable and open-source algorithm for real-life monitoring of tremor in Parkinson's disease](https://doi.org/10.1038/s41531-025-01056-2)
120
+ * [Veldkamp, K.I. et al. (2025) - Heart rate monitoring using wrist photoplethysmography in Parkinson disease: feasibility and relation with autonomic dysfunction](https://doi.org/10.1101/2025.08.15.25333751)
118
121
 
119
122
  ## Contributing
120
123
 
121
- We welcome contributions! Please check out our [contributing guidelines](https://biomarkersparkinson.github.io/paradigma/contributing.html).
124
+ We welcome contributions! Please check out our [contributing guidelines](https://biomarkersparkinson.github.io/paradigma/contributing.html).
122
125
  Please note that this project is released with a [Code of Conduct](https://biomarkersparkinson.github.io/paradigma/conduct.html). By contributing to this project, you agree to abide by its terms.
123
126
 
124
127
  ## License
@@ -127,11 +130,11 @@ It is licensed under the terms of the Apache License 2.0 license. See [License](
127
130
 
128
131
  ## Acknowledgements
129
132
 
130
- The core team of ParaDigMa consists of Erik Post, Kars Veldkamp, Nienke Timmermans, Diogo Coutinho Soriano, Peter Kok, Vedran Kasalica and Luc Evers.
131
- Advisors to the project are Max Little, Jordan Raykov, Twan van Laarhoven, Hayriye Cagnan, and Bas Bloem.
133
+ The core team of ParaDigMa consists of Erik Post, Kars Veldkamp, Nienke Timmermans, Diogo Coutinho Soriano, Peter Kok, Vedran Kasalica and Luc Evers.
134
+ Advisors to the project are Max Little, Jordan Raykov, Twan van Laarhoven, Hayriye Cagnan, and Bas Bloem.
132
135
  The initial release of ParaDigMa was funded by the Michael J Fox Foundation (grant #020425) and the Dutch Research Council (grant #ASDI.2020.060 & grant #2023.010).
133
136
  ParaDigMa was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).
134
137
 
135
138
  ## Contact
136
- Questions, issues or suggestions about ParaDigMa? Please reach out to erik.post@radboudumc.nl, or open an issue in the GitHub repository.
139
+ Questions, issues or suggestions about ParaDigMa? Please reach out to paradigma@radboudumc.nl, or open an issue in the GitHub repository.
137
140
 
@@ -8,25 +8,25 @@
8
8
  | **DOI** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13838392.svg)](https://doi.org/10.5281/zenodo.13838392) |
9
9
  | **Build Status** | [![](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![Build and test](https://github.com/biomarkersParkinson/paradigma/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/biomarkersParkinson/paradigma/actions/workflows/build-and-test.yml) [![pages-build-deployment](https://github.com/biomarkersParkinson/paradigma/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/biomarkersParkinson/paradigma/actions/workflows/pages/pages-build-deployment) |
10
10
  | **License** | [![GitHub license](https://img.shields.io/github/license/biomarkersParkinson/paradigma)](https://github.com/biomarkersparkinson/paradigma/blob/main/LICENSE) |
11
- <!-- | **Fairness** | [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8083/badge)](https://www.bestpractices.dev/projects/8083) | -->
11
+ <!-- | **Fairness** | [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8083/badge)](https://www.bestpractices.dev/projects/8083) | -->
12
12
 
13
13
  ## Overview
14
14
  The Parkinson's disease Digital Markers (ParaDigMa) toolbox is a Python
15
15
  software package designed for processing real-life wrist sensor data
16
- to extract digital measures of motor and non-motor signs of Parkinson's disease (PD).
17
-
18
- Specifically, the toolbox is designed to process accelerometer, gyroscope and
19
- photoplethysmography (PPG) signals, collected during passive monitoring in daily life.
20
- It contains three data processing pipelines: (1) arm swing during gait, (2) tremor,
21
- and (3) pulse rate. These pipelines are scientifically validated for their
22
- use in persons with PD. Furthermore, the toolbox contains general functionalities for
23
- signal processing and feature extraction, such as filtering, peak detection, and
24
- spectral analysis.
25
-
26
- The toolbox is accompanied by a set of example scripts and notebooks for
27
- each processing pipeline that demonstrate how to use the toolbox for extracting
16
+ to extract digital measures of motor and non-motor signs of Parkinson's disease (PD).
17
+
18
+ Specifically, the toolbox is designed to process accelerometer, gyroscope and
19
+ photoplethysmography (PPG) signals, collected during passive monitoring in daily life.
20
+ It contains three data processing pipelines: (1) arm swing during gait, (2) tremor,
21
+ and (3) pulse rate. These pipelines are scientifically validated for their
22
+ use in persons with PD. Furthermore, the toolbox contains general functionalities for
23
+ signal processing and feature extraction, such as filtering, peak detection, and
24
+ spectral analysis.
25
+
26
+ The toolbox is accompanied by a set of example scripts and notebooks for
27
+ each processing pipeline that demonstrate how to use the toolbox for extracting
28
28
  digital measures. In addition, the toolbox is designed to be modular, enabling
29
- researchers to easily extend the toolbox with new algorithms and functionalities.
29
+ researchers to easily extend the toolbox with new algorithms and functionalities.
30
30
 
31
31
  ## Features
32
32
  The components of ParaDigMa are shown in the diagram below.
@@ -39,20 +39,20 @@ ParaDigMa can best be understood by categorizing the sequential processes:
39
39
 
40
40
  | Process | Description |
41
41
  | ---- | ---- |
42
- | Preprocessing | Preparing raw sensor signals for further processing |
42
+ | Preprocessing | Preparing raw sensor signals for further processing |
43
43
  | Feature extraction | Extracting features based on windowed sensor signals |
44
- | Classification | Detecting segments of interest using validated classifiers (e.g., gait segments) |
44
+ | Classification | Detecting segments of interest using validated classifiers (e.g., gait segments) |
45
45
  | Quantification | Extracting specific measures from the detected segments (e.g., arm swing measures) |
46
46
  | Aggregation | Aggregating the measures over a specific time period (e.g., week-level aggregates) |
47
47
 
48
48
  <br/>
49
- ParaDigMa contains the following validated processing pipelines (each using the processes described above):
49
+ ParaDigMa contains the following validated processing pipelines (each using the processes described above):
50
50
 
51
- | Pipeline | Input | Output classification | Output quantification | Output week-level aggregation |
51
+ | Pipeline | Input | Output classification | Output quantification | Output week-level aggregation |
52
52
  | ---- | ---- | ---- | ---- | ---- |
53
- | **Arm swing during gait** | Wrist accelerometer and gyroscope data | Gait probability, gait without other arm activities probability | Arm swing range of motion (RoM) | Typical & maximum arm swing RoM |
54
- | **Tremor** | Wrist gyroscope data | Tremor probability | Tremor power | % tremor time, typical & maximum tremor power |
55
- | **Pulse rate** | Wrist PPG and accelerometer data | PPG signal quality | Pulse rate | Resting & maximum pulse rate |
53
+ | **Arm swing during gait** | Wrist accelerometer and gyroscope data | Gait probability, gait without other arm activities probability | Arm swing range of motion (RoM) | Typical & maximum arm swing RoM |
54
+ | **Tremor** | Wrist gyroscope data | Tremor probability | Tremor power | % tremor time, typical & maximum tremor power |
55
+ | **Pulse rate** | Wrist PPG and accelerometer data | PPG signal quality | Pulse rate | Resting & maximum pulse rate |
56
56
 
57
57
  ## Installation
58
58
 
@@ -70,9 +70,9 @@ The API reference contains detailed documentation of all toolbox modules and fun
70
70
  The user guides provide additional information about specific topics (e.g. the required orientation of the wrist sensor).
71
71
 
72
72
  ### Sensor data requirements
73
- The ParaDigMa toolbox is designed for the analysis of passive monitoring data collected using a wrist sensor in persons with PD.
73
+ The ParaDigMa toolbox is designed for the analysis of passive monitoring data collected using a wrist sensor in persons with PD.
74
74
 
75
- Specific requirements include:
75
+ Specific requirements include:
76
76
  | Pipeline | Sensor Configuration | Context of Use |
77
77
  |------------------------|--------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
78
78
  | **All** | - Sensor position: wrist-band on most or least affected side (validated for both, but different sensitivity for measuring disease progression for tremor and arm swing during gait). <br> - Sensor orientation: orientation as described in [Coordinate System](https://biomarkersparkinson.github.io/paradigma/guides/coordinate_system.html). <br> - Timeframe: contiguous, strictly increasing timestamps. | - Population: persons with PD. <br> - Data collection protocol: passive monitoring in daily life. |
@@ -80,25 +80,25 @@ Specific requirements include:
80
80
  | **Tremor** | - Gyroscope: minimum sampling rate of 100 Hz, minimum range of ± 1000 degrees/sec. | - Compliance: for weekly measures: at least three compliant days (with ≥10 hours of data between 8 am and 10 pm). |
81
81
  | **Pulse rate** | - PPG*: minimum sampling rate of 30 Hz, green LED. <br> - Accelerometer: minimum sampling rate of 100 Hz, minimum range of ± 4 g. | - Population: no rhythm disorders (e.g. atrial fibrillation, atrial flutter). <br> - Compliance: for weekly measures: minimum average of 12 hours of data per day. |
82
82
 
83
- \* The processing of PPG signals is currently based on the blood volume pulse (arbitrary units) obtained from the Verily Study Watch, and we are currently testing the applicability of the pipeline to other PPG devices.
83
+ \* The processing of PPG signals is currently based on the blood volume pulse (arbitrary units) obtained from the Verily Study Watch. [This](https://biomarkersparkinson.github.io/paradigma/tutorials/_static/pulse_rate_analysis.html#step-3-signal-quality-classification) part of the PPG tutorial provides code and documentation on how to use the pipeline with other PPG devices.
84
84
 
85
85
  > [!WARNING]
86
- > While the toolbox is designed to work on any wrist sensor device which fulfills the requirements,
87
- we have currently verified its performance on data from the Gait-up Physilog 4 (arm swing during gait & tremor) and the Verily Study Watch (all pipelines). Furthermore, the specifications above are the minimally validated requirements. For example, while ParaDigMa works with accelerometer and gyroscope data sampled at 50 Hz, its effect on subsequent processes has not been empirically validated.
86
+ > While the toolbox is designed to work on any wrist sensor device which fulfills the requirements,
87
+ we have currently verified its performance on data from the Gait-up Physilog 4 (arm swing during gait & tremor) and the Verily Study Watch (all pipelines). Furthermore, the specifications above are the minimally validated requirements. For example, while ParaDigMa works with accelerometer and gyroscope data sampled at 50 Hz, its effect on subsequent processes has not been empirically validated.
88
88
  <br/>
89
89
 
90
90
  We have included support for [TSDF](https://biomarkersparkinson.github.io/tsdf/) as format for loading and storing sensor data. TSDF enables efficient data storage with added metadata. However, ParaDigMa does not require a particular method of data storage and retrieval. Please see our tutorial [Data preparation](https://biomarkersparkinson.github.io/paradigma/tutorials/data_preparation.html) for examples of loading TSDF and other data formats into memory, and for preparing raw sensor data as input for the processing pipelines.
91
91
 
92
92
  ## Scientific validation
93
93
 
94
- The pipelines were developed and validated using data from the Parkinson@Home Validation study [[Evers et al. 2020]](https://pmc.ncbi.nlm.nih.gov/articles/PMC7584982/) and the Personalized Parkinson Project [[Bloem et al. 2019]](https://pubmed.ncbi.nlm.nih.gov/31315608/). The following publication contains the details and validation of the arm swing during gait pipeline:
95
- * [Post, E. et al. - Quantifying arm swing in Parkinson's disease: a method account for arm activities during free-living gait](https://doi.org/10.1186/s12984-025-01578-z)
96
-
97
- Details and validation of the other pipelines shall be shared in upcoming scientific publications.
94
+ The pipelines were developed and validated using data from the Parkinson@Home Validation study [[Evers et al. (2020)]](https://pmc.ncbi.nlm.nih.gov/articles/PMC7584982/) and the Personalized Parkinson Project [[Bloem et al. (2019)]](https://pubmed.ncbi.nlm.nih.gov/31315608/). The following publications contain details and validation of the pipelines:
95
+ * [Post, E. et al. (2025) - Quantifying arm swing in Parkinson's disease: a method account for arm activities during free-living gait](https://doi.org/10.1186/s12984-025-01578-z)
96
+ * [Timmermans, N.A. et al. (2025) - A generalizable and open-source algorithm for real-life monitoring of tremor in Parkinson's disease](https://doi.org/10.1038/s41531-025-01056-2)
97
+ * [Veldkamp, K.I. et al. (2025) - Heart rate monitoring using wrist photoplethysmography in Parkinson disease: feasibility and relation with autonomic dysfunction](https://doi.org/10.1101/2025.08.15.25333751)
98
98
 
99
99
  ## Contributing
100
100
 
101
- We welcome contributions! Please check out our [contributing guidelines](https://biomarkersparkinson.github.io/paradigma/contributing.html).
101
+ We welcome contributions! Please check out our [contributing guidelines](https://biomarkersparkinson.github.io/paradigma/contributing.html).
102
102
  Please note that this project is released with a [Code of Conduct](https://biomarkersparkinson.github.io/paradigma/conduct.html). By contributing to this project, you agree to abide by its terms.
103
103
 
104
104
  ## License
@@ -107,10 +107,10 @@ It is licensed under the terms of the Apache License 2.0 license. See [License](
107
107
 
108
108
  ## Acknowledgements
109
109
 
110
- The core team of ParaDigMa consists of Erik Post, Kars Veldkamp, Nienke Timmermans, Diogo Coutinho Soriano, Peter Kok, Vedran Kasalica and Luc Evers.
111
- Advisors to the project are Max Little, Jordan Raykov, Twan van Laarhoven, Hayriye Cagnan, and Bas Bloem.
110
+ The core team of ParaDigMa consists of Erik Post, Kars Veldkamp, Nienke Timmermans, Diogo Coutinho Soriano, Peter Kok, Vedran Kasalica and Luc Evers.
111
+ Advisors to the project are Max Little, Jordan Raykov, Twan van Laarhoven, Hayriye Cagnan, and Bas Bloem.
112
112
  The initial release of ParaDigMa was funded by the Michael J Fox Foundation (grant #020425) and the Dutch Research Council (grant #ASDI.2020.060 & grant #2023.010).
113
113
  ParaDigMa was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).
114
114
 
115
115
  ## Contact
116
- Questions, issues or suggestions about ParaDigMa? Please reach out to erik.post@radboudumc.nl, or open an issue in the GitHub repository.
116
+ Questions, issues or suggestions about ParaDigMa? Please reach out to paradigma@radboudumc.nl, or open an issue in the GitHub repository.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "paradigma"
3
- version = "1.0.2"
3
+ version = "1.0.4"
4
4
  description = "ParaDigMa - A toolbox for deriving Parkinson's disease Digital Markers from real-life wrist sensor data"
5
5
  authors = [ "Erik Post <erik.post@radboudumc.nl>",
6
6
  "Kars Veldkamp <kars.veldkamp@radboudumc.nl>",
@@ -19,9 +19,8 @@ pandas = "^2.1.4"
19
19
  scikit-learn = ">=1.3.2,<1.6.1"
20
20
  tsdf = "^0.5.2"
21
21
  pytype = "^2024.4.11"
22
- # for the record: pytype was installed directly with pip (in the poetry environment),
23
- # because poetry didn't handle the install for different CPU architectures
24
22
  python-dateutil = "^2.9.0.post0"
23
+ nbconvert = "^7.16.6"
25
24
 
26
25
  [tool.poetry.group.testing.dependencies]
27
26
  ipykernel = "^6.27.1"
@@ -41,6 +40,17 @@ nbsphinx = "^0.9.6"
41
40
 
42
41
  [tool.poetry.group.dev.dependencies]
43
42
  pytype = "^2024.10.11"
43
+ notebook = "^7.4.5"
44
+ ipykernel = "^6.30.1"
45
+ pre-commit = "^4.3.0"
46
+ jupyter-client = "^8.6.3"
47
+ nbstripout = "^0.8.1"
48
+ nb-clean = "^4.0.1"
49
+ jupyter = "^1.1.1"
50
+
51
+ [tool.poetry.scripts]
52
+ build-docs = "scripts.build_docs:main"
53
+ serve-docs = "scripts.serve_docs:main"
44
54
 
45
55
  [build-system]
46
56
  requires = ["poetry-core>=1.0.0"]
@@ -1,14 +1,19 @@
1
- import numpy as np
2
1
  import pickle
3
-
4
2
  from pathlib import Path
5
- from sklearn.base import BaseEstimator
6
3
  from typing import Any, Optional
7
4
 
5
+ import numpy as np
6
+ from sklearn.base import BaseEstimator
7
+ from sklearn.preprocessing import StandardScaler
8
+
9
+
8
10
  class ClassifierPackage:
9
- def __init__(self, classifier: Optional[BaseEstimator] = None,
10
- threshold: Optional[float] = None,
11
- scaler: Optional[Any] = None):
11
+ def __init__(
12
+ self,
13
+ classifier: Optional[BaseEstimator] = None,
14
+ threshold: Optional[float] = None,
15
+ scaler: Optional[Any] = None,
16
+ ):
12
17
  """
13
18
  Initialize the ClassifierPackage with a classifier, threshold, and scaler.
14
19
 
@@ -43,6 +48,18 @@ class ClassifierPackage:
43
48
  return X
44
49
  return self.scaler.transform(X)
45
50
 
51
+ def update_scaler(self, x_train: np.ndarray) -> None:
52
+ """
53
+ Update the scaler used for feature transformation.
54
+
55
+ Parameters
56
+ ----------
57
+ x_train : np.ndarray
58
+ The training data to fit the scaler.
59
+ """
60
+ scaler = StandardScaler()
61
+ self.scaler = scaler.fit(x_train)
62
+
46
63
  def predict_proba(self, X) -> float:
47
64
  """
48
65
  Make predictions using the classifier and apply the threshold.
@@ -61,7 +78,7 @@ class ClassifierPackage:
61
78
  if not self.classifier:
62
79
  raise ValueError("Classifier is not loaded.")
63
80
  return self.classifier.predict_proba(X)[:, 1]
64
-
81
+
65
82
  def predict(self, X) -> int:
66
83
  """
67
84
  Make predictions using the classifier and apply the threshold.
@@ -80,7 +97,7 @@ class ClassifierPackage:
80
97
  if not self.classifier:
81
98
  raise ValueError("Classifier is not loaded.")
82
99
  return int(self.predict_proba(X) >= self.threshold)
83
-
100
+
84
101
  def save(self, filepath: str | Path) -> None:
85
102
  """
86
103
  Save the ClassifierPackage to a file.
@@ -90,7 +107,7 @@ class ClassifierPackage:
90
107
  filepath : str
91
108
  The path to the file.
92
109
  """
93
- with open(filepath, 'wb') as f:
110
+ with open(filepath, "wb") as f:
94
111
  pickle.dump(self, f)
95
112
 
96
113
  @classmethod
@@ -109,7 +126,7 @@ class ClassifierPackage:
109
126
  The loaded classifier package.
110
127
  """
111
128
  try:
112
- with open(filepath, 'rb') as f:
129
+ with open(filepath, "rb") as f:
113
130
  return pickle.load(f)
114
131
  except Exception as e:
115
- raise ValueError(f"Failed to load classifier package: {e}") from e
132
+ raise ValueError(f"Failed to load classifier package: {e}") from e