accusleepy 0.6.0__py3-none-any.whl

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 (42) hide show
  1. accusleepy/__init__.py +0 -0
  2. accusleepy/__main__.py +4 -0
  3. accusleepy/bouts.py +142 -0
  4. accusleepy/brain_state_set.py +89 -0
  5. accusleepy/classification.py +285 -0
  6. accusleepy/config.json +24 -0
  7. accusleepy/constants.py +46 -0
  8. accusleepy/fileio.py +179 -0
  9. accusleepy/gui/__init__.py +0 -0
  10. accusleepy/gui/icons/brightness_down.png +0 -0
  11. accusleepy/gui/icons/brightness_up.png +0 -0
  12. accusleepy/gui/icons/double_down_arrow.png +0 -0
  13. accusleepy/gui/icons/double_up_arrow.png +0 -0
  14. accusleepy/gui/icons/down_arrow.png +0 -0
  15. accusleepy/gui/icons/home.png +0 -0
  16. accusleepy/gui/icons/question.png +0 -0
  17. accusleepy/gui/icons/save.png +0 -0
  18. accusleepy/gui/icons/up_arrow.png +0 -0
  19. accusleepy/gui/icons/zoom_in.png +0 -0
  20. accusleepy/gui/icons/zoom_out.png +0 -0
  21. accusleepy/gui/images/primary_window.png +0 -0
  22. accusleepy/gui/images/viewer_window.png +0 -0
  23. accusleepy/gui/images/viewer_window_annotated.png +0 -0
  24. accusleepy/gui/main.py +1494 -0
  25. accusleepy/gui/manual_scoring.py +1096 -0
  26. accusleepy/gui/mplwidget.py +386 -0
  27. accusleepy/gui/primary_window.py +2577 -0
  28. accusleepy/gui/primary_window.ui +3831 -0
  29. accusleepy/gui/resources.qrc +16 -0
  30. accusleepy/gui/resources_rc.py +6710 -0
  31. accusleepy/gui/text/config_guide.txt +27 -0
  32. accusleepy/gui/text/main_guide.md +167 -0
  33. accusleepy/gui/text/manual_scoring_guide.md +23 -0
  34. accusleepy/gui/viewer_window.py +610 -0
  35. accusleepy/gui/viewer_window.ui +926 -0
  36. accusleepy/models.py +108 -0
  37. accusleepy/multitaper.py +661 -0
  38. accusleepy/signal_processing.py +469 -0
  39. accusleepy/temperature_scaling.py +157 -0
  40. accusleepy-0.6.0.dist-info/METADATA +106 -0
  41. accusleepy-0.6.0.dist-info/RECORD +42 -0
  42. accusleepy-0.6.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.3
2
+ Name: accusleepy
3
+ Version: 0.6.0
4
+ Summary: Python implementation of AccuSleep
5
+ License: GPL-3.0-only
6
+ Author: Zeke Barger
7
+ Author-email: zekebarger@gmail.com
8
+ Requires-Python: >=3.11,<3.14
9
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Dist: fastparquet (>=2024.11.0,<2025.0.0)
15
+ Requires-Dist: joblib (>=1.4.2,<2.0.0)
16
+ Requires-Dist: matplotlib (>=3.10.1,<4.0.0)
17
+ Requires-Dist: numpy (>=2.2.4,<3.0.0)
18
+ Requires-Dist: pandas (>=2.2.3,<3.0.0)
19
+ Requires-Dist: pillow (>=11.1.0,<12.0.0)
20
+ Requires-Dist: pre-commit (>=4.2.0,<5.0.0)
21
+ Requires-Dist: pyside6 (>=6.9.0,<7.0.0)
22
+ Requires-Dist: scipy (>=1.15.2,<2.0.0)
23
+ Requires-Dist: toml (>=0.10.2,<0.11.0)
24
+ Requires-Dist: torch (>=2.6.0,<3.0.0)
25
+ Requires-Dist: torchvision (>=0.21.0,<0.22.0)
26
+ Requires-Dist: tqdm (>=4.67.1,<5.0.0)
27
+ Description-Content-Type: text/markdown
28
+
29
+ # AccuSleePy
30
+
31
+ ## Description
32
+
33
+ AccuSleePy is set of graphical user interfaces for scoring rodent sleep
34
+ using EEG and EMG recordings.
35
+ It offers the following improvements over the MATLAB version (AccuSleep):
36
+
37
+ - Up to 10 brain states can be configured through the user interface
38
+ - Classification models can be trained through the user interface
39
+ - Model files contain useful metadata (brain state configuration,
40
+ epoch length, number of epochs)
41
+ - Models optimized for real-time scoring can be trained
42
+ - Lists of recordings can be imported and exported for repeatable batch processing
43
+ - Undo/redo functionality in the manual scoring interface
44
+
45
+ If you use AccuSleep in your research, please cite our
46
+ [publication](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0224642):
47
+
48
+ Barger, Z., Frye, C. G., Liu, D., Dan, Y., & Bouchard, K. E. (2019). Robust, automated sleep scoring by a compact neural network with distributional shift correction. *PLOS ONE, 14*(12), 1–18.
49
+
50
+ The data and models associated with AccuSleep are available at https://osf.io/py5eb/
51
+
52
+ Please contact zekebarger (at) gmail (dot) com with any questions or comments about the software.
53
+
54
+
55
+ ## Installation
56
+
57
+ - (recommended) create a new virtual environment (using
58
+ [venv](https://docs.python.org/3/library/venv.html),
59
+ [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html),
60
+ etc.) with python >=3.11,<3.14
61
+ - (optional) if you have a CUDA device and want to speed up model training, [install PyTorch](https://pytorch.org/)
62
+ - `pip install accusleepy`
63
+ - (optional) download a classification model from https://osf.io/py5eb/ under /python_format/models/
64
+
65
+ Note that upgrading or reinstalling the package will overwrite any changes
66
+ to the [config file](accusleepy/config.json).
67
+
68
+ ## Usage
69
+
70
+ `python -m accusleepy` will open the primary interface.
71
+
72
+ [Guide to the primary interface](accusleepy/gui/text/main_guide.md)
73
+
74
+ [Guide to the manual scoring interface](accusleepy/gui/text/manual_scoring_guide.md)
75
+
76
+ ## Changelog
77
+
78
+ - 0.6.0: Confidence scores can now be displayed and saved. Retraining your models is recommended
79
+ since the new calibration feature will make the confidence scores more accurate.
80
+ - 0.5.0: Performance improvements
81
+ - 0.4.5: Added support for python 3.13, **removed support for python 3.10.**
82
+ - 0.4.4: Performance improvements
83
+ - 0.4.3: Improved unit tests and user manuals
84
+ - 0.4.0: Improved visuals and user manuals
85
+ - 0.1.0-0.3.1: Early development versions
86
+
87
+ ## Screenshots
88
+
89
+ Primary interface
90
+ ![AccuSleePy primary interface](accusleepy/gui/images/primary_window.png)
91
+
92
+ Manual scoring interface
93
+ ![AccuSleePy manual scoring interface](accusleepy/gui/images/viewer_window.png)
94
+
95
+ ## Acknowledgements
96
+
97
+ We would like to thank [Franz Weber](https://www.med.upenn.edu/weberlab/) for creating an
98
+ early version of the manual labeling interface. The code that
99
+ creates spectrograms comes from the
100
+ [Prerau lab](https://github.com/preraulab/multitaper_toolbox/blob/master/python/multitaper_spectrogram_python.py)
101
+ with only minor modifications.
102
+ Jim Bohnslav's [deepethogram](https://github.com/jbohnslav/deepethogram) served as an
103
+ incredibly useful reference when reimplementing this project in python.
104
+ The model calibration code added in version 0.6.0 comes from Geoff Pleiss'
105
+ [temperature scaling repo](https://github.com/gpleiss/temperature_scaling).
106
+
@@ -0,0 +1,42 @@
1
+ accusleepy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ accusleepy/__main__.py,sha256=dKzl2N2Hg9lD264CWYNxThRyDKzWwyMwHRXmJxOmMis,104
3
+ accusleepy/bouts.py,sha256=F_y6DxnpKFfImYb7vCZluZ2eD5I_33gZXmRM8mvebsg,5679
4
+ accusleepy/brain_state_set.py,sha256=fRkrArHLIbEKimub804yt_mUXoyfsjJEfiJnTjeCMkY,3233
5
+ accusleepy/classification.py,sha256=wg0EoUrXAYqdUWr6SyJDl_5Jzx7lck9ta3-dsGzD208,9180
6
+ accusleepy/config.json,sha256=n-CTGn7hljHQ7MKRMvGvwCAzcjWmUuqzAWrnXnk2pGU,501
7
+ accusleepy/constants.py,sha256=0gIzZY544Y1tL-n0HxFsCMzBdprOKNYVYlNxF45o3kw,1652
8
+ accusleepy/fileio.py,sha256=z6Cuhue__-RL7s3jjY23IjMl8nhow3P1mDx7j_rRLo4,5441
9
+ accusleepy/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ accusleepy/gui/icons/brightness_down.png,sha256=PLT1fb83RHIhSRuU7MMMx0G7oJAY7o9wUcnqM8veZfM,12432
11
+ accusleepy/gui/icons/brightness_up.png,sha256=64GnUqgPvN5xZ6Um3wOzwqvUmdAWYZT6eFmWpBsHyks,12989
12
+ accusleepy/gui/icons/double_down_arrow.png,sha256=fGiPIP7_RJ3UAonNhORFVX0emXEmtzRlHI3Tfjai064,4964
13
+ accusleepy/gui/icons/double_up_arrow.png,sha256=n7QEo0bZZDve4thwTCKghPKVjTNbQMgyQNsn46iqXbI,5435
14
+ accusleepy/gui/icons/down_arrow.png,sha256=XwS_Gq2j6PoNHRaeaAGoh5kcXJNXWAHWWbJbUsvrRPU,3075
15
+ accusleepy/gui/icons/home.png,sha256=yd3nmHlD9w2a2j3cBd-w_Cuidr-J0apryRoWJoPb66w,5662
16
+ accusleepy/gui/icons/question.png,sha256=IJcIRgQOC9KlzA4vtA5Qu-DQ1-SclhVLeovIsEfl3TU,17105
17
+ accusleepy/gui/icons/save.png,sha256=J3EA8iU1BqLYRSsrq_OdoZlqrv2yfL7oV54DklTy_DI,13555
18
+ accusleepy/gui/icons/up_arrow.png,sha256=V9yF9t1WgjPaUu-mF1YGe_DfaRHg2dUpR_sUVVcvVvY,3329
19
+ accusleepy/gui/icons/zoom_in.png,sha256=MFWnKZp7Rvh4bLPq4Cqo4sB_jQYedUUtT8-ZO8tNYyc,13589
20
+ accusleepy/gui/icons/zoom_out.png,sha256=IB8Jecb3i0U4qjWRR46ridjLpvLCSe7PozBaLqQqYSw,13055
21
+ accusleepy/gui/images/primary_window.png,sha256=rlEflF0w3IdwQKDo3tejqSmfNp8omoxgI8sVDqF3hto,600458
22
+ accusleepy/gui/images/viewer_window.png,sha256=b_B7m9WSLMAOzNjctq76SyekO1WfC6qYZVNnYfhjPe8,977197
23
+ accusleepy/gui/images/viewer_window_annotated.png,sha256=uMNUmsZIdzDlQpyoiS3lJGoWlg_T325Oj5hDZhM3Y14,146817
24
+ accusleepy/gui/main.py,sha256=npQbJ11fV3lpKaoChdjRI-KsgneM-IQRrWZkSDHBkWI,57737
25
+ accusleepy/gui/manual_scoring.py,sha256=QD3T-0vEH5E08Vw6YAzp7eBETsNTRU4BGuyzm-3oMfI,40635
26
+ accusleepy/gui/mplwidget.py,sha256=rJSTtWmLjHn8r3c9Kb23Rc4XzXl3i9B-JrjNjjlNnmQ,13492
27
+ accusleepy/gui/primary_window.py,sha256=N-hEI39lQdGSEGq1quxSPLIMuNqhTkGWKM89BL3KgVM,108377
28
+ accusleepy/gui/primary_window.ui,sha256=5bSa6c5idYCpnwWZ5Vt3ecrJsC8hiD0JTPLSf_20H2g,153744
29
+ accusleepy/gui/resources.qrc,sha256=wqPendnTLAuKfVI6v2lKHiRqAWM0oaz2ZuF5cucJdS4,803
30
+ accusleepy/gui/resources_rc.py,sha256=Z2e34h30U4snJjnYdZVV9B6yjATKxxfvgTRt5uXtQdo,329727
31
+ accusleepy/gui/text/config_guide.txt,sha256=xYnVTojDXKph13QBj7mpfjQYa-xmpLkhF19G_bz3xbA,1027
32
+ accusleepy/gui/text/main_guide.md,sha256=bl5RDSh-kD44Ch3bVo_Hl7Cn3n8dfh9xHjKKH4ORgS8,8238
33
+ accusleepy/gui/text/manual_scoring_guide.md,sha256=ow_RMSjFy05NupEDSCuJtu-V65-BPnIkrZqtssFoZCQ,999
34
+ accusleepy/gui/viewer_window.py,sha256=O4ceqLMYdahxQ9s6DYhloUnNESim-cqIZxFeXEiRjog,24444
35
+ accusleepy/gui/viewer_window.ui,sha256=jsjydsSSyN49AwJw4nVS2mEJ2JBIUTXesAJsij1JNV0,31530
36
+ accusleepy/models.py,sha256=15VjtFoWaYXblyGPbtYgp0yJdyUfGu7t3zCShdtr_7c,3799
37
+ accusleepy/multitaper.py,sha256=D5-iglwkFBRciL5tKSNcunMtcq0rM3zHwRHUVPgem1U,25679
38
+ accusleepy/signal_processing.py,sha256=sEol01SlwOVwBmKHR-saVhneAA0jr98pcZZ-02uUy2Q,16739
39
+ accusleepy/temperature_scaling.py,sha256=glvPcvxHpBdFjwjGfZdNku9L_BozycEmdqZhKKUCCNg,5749
40
+ accusleepy-0.6.0.dist-info/METADATA,sha256=D2BHcAVQmF4M7ZkCwEiBjIQ6q6aMgcEQghNNtZFb2c8,4437
41
+ accusleepy-0.6.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
42
+ accusleepy-0.6.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.1.3
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any