linxi-tridesclous 1.0.0__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 (116) hide show
  1. linxi_tridesclous-1.0.0/LICENSE +22 -0
  2. linxi_tridesclous-1.0.0/MANIFEST.in +1 -0
  3. linxi_tridesclous-1.0.0/PKG-INFO +27 -0
  4. linxi_tridesclous-1.0.0/README.md +73 -0
  5. linxi_tridesclous-1.0.0/linxi_tridesclous.egg-info/PKG-INFO +27 -0
  6. linxi_tridesclous-1.0.0/linxi_tridesclous.egg-info/SOURCES.txt +114 -0
  7. linxi_tridesclous-1.0.0/linxi_tridesclous.egg-info/dependency_links.txt +1 -0
  8. linxi_tridesclous-1.0.0/linxi_tridesclous.egg-info/entry_points.txt +2 -0
  9. linxi_tridesclous-1.0.0/linxi_tridesclous.egg-info/requires.txt +20 -0
  10. linxi_tridesclous-1.0.0/linxi_tridesclous.egg-info/top_level.txt +1 -0
  11. linxi_tridesclous-1.0.0/setup.cfg +4 -0
  12. linxi_tridesclous-1.0.0/setup.py +44 -0
  13. linxi_tridesclous-1.0.0/tridesclous/__init__.py +43 -0
  14. linxi_tridesclous-1.0.0/tridesclous/autoparams.py +274 -0
  15. linxi_tridesclous-1.0.0/tridesclous/catalogueconstructor.py +2165 -0
  16. linxi_tridesclous-1.0.0/tridesclous/cataloguetools.py +187 -0
  17. linxi_tridesclous-1.0.0/tridesclous/cleancluster.py +710 -0
  18. linxi_tridesclous-1.0.0/tridesclous/cltools.py +75 -0
  19. linxi_tridesclous-1.0.0/tridesclous/cluster.py +194 -0
  20. linxi_tridesclous-1.0.0/tridesclous/dataio.py +904 -0
  21. linxi_tridesclous-1.0.0/tridesclous/datasets.py +101 -0
  22. linxi_tridesclous-1.0.0/tridesclous/datasource.py +277 -0
  23. linxi_tridesclous-1.0.0/tridesclous/decomposition.py +320 -0
  24. linxi_tridesclous-1.0.0/tridesclous/dip.py +138 -0
  25. linxi_tridesclous-1.0.0/tridesclous/export.py +148 -0
  26. linxi_tridesclous-1.0.0/tridesclous/gui/__init__.py +50 -0
  27. linxi_tridesclous-1.0.0/tridesclous/gui/base.py +141 -0
  28. linxi_tridesclous-1.0.0/tridesclous/gui/baselist.py +174 -0
  29. linxi_tridesclous-1.0.0/tridesclous/gui/cataloguecontroller.py +407 -0
  30. linxi_tridesclous-1.0.0/tridesclous/gui/cataloguewindow.py +331 -0
  31. linxi_tridesclous-1.0.0/tridesclous/gui/crosscorrelogramviewer.py +118 -0
  32. linxi_tridesclous-1.0.0/tridesclous/gui/featuretimeviewer.py +171 -0
  33. linxi_tridesclous-1.0.0/tridesclous/gui/gpuselector.py +53 -0
  34. linxi_tridesclous-1.0.0/tridesclous/gui/gui_params.py +345 -0
  35. linxi_tridesclous-1.0.0/tridesclous/gui/icons/__init__.py +6 -0
  36. linxi_tridesclous-1.0.0/tridesclous/gui/icons/icons_py3.py +15056 -0
  37. linxi_tridesclous-1.0.0/tridesclous/gui/icons/make_ressources.py +38 -0
  38. linxi_tridesclous-1.0.0/tridesclous/gui/icons/test_ressources.py +20 -0
  39. linxi_tridesclous-1.0.0/tridesclous/gui/initializedatasetwindow.py +383 -0
  40. linxi_tridesclous-1.0.0/tridesclous/gui/isiviewer.py +95 -0
  41. linxi_tridesclous-1.0.0/tridesclous/gui/mainwindow.py +605 -0
  42. linxi_tridesclous-1.0.0/tridesclous/gui/myqt.py +51 -0
  43. linxi_tridesclous-1.0.0/tridesclous/gui/ndscatter.py +540 -0
  44. linxi_tridesclous-1.0.0/tridesclous/gui/pairlist.py +218 -0
  45. linxi_tridesclous-1.0.0/tridesclous/gui/peaklists.py +396 -0
  46. linxi_tridesclous-1.0.0/tridesclous/gui/peelercontroller.py +249 -0
  47. linxi_tridesclous-1.0.0/tridesclous/gui/peelerwindow.py +78 -0
  48. linxi_tridesclous-1.0.0/tridesclous/gui/probegeometryview.py +93 -0
  49. linxi_tridesclous-1.0.0/tridesclous/gui/silhouette.py +147 -0
  50. linxi_tridesclous-1.0.0/tridesclous/gui/similarity.py +207 -0
  51. linxi_tridesclous-1.0.0/tridesclous/gui/spikelists.py +197 -0
  52. linxi_tridesclous-1.0.0/tridesclous/gui/test_gpuselector.py +34 -0
  53. linxi_tridesclous-1.0.0/tridesclous/gui/tools.py +223 -0
  54. linxi_tridesclous-1.0.0/tridesclous/gui/traceviewer.py +603 -0
  55. linxi_tridesclous-1.0.0/tridesclous/gui/waveformhistviewer.py +417 -0
  56. linxi_tridesclous-1.0.0/tridesclous/gui/waveformviewer.py +569 -0
  57. linxi_tridesclous-1.0.0/tridesclous/importers.py +341 -0
  58. linxi_tridesclous-1.0.0/tridesclous/iotools.py +348 -0
  59. linxi_tridesclous-1.0.0/tridesclous/jobtools.py +175 -0
  60. linxi_tridesclous-1.0.0/tridesclous/labelcodes.py +18 -0
  61. linxi_tridesclous-1.0.0/tridesclous/matplotlibplot.py +554 -0
  62. linxi_tridesclous-1.0.0/tridesclous/metrics.py +58 -0
  63. linxi_tridesclous-1.0.0/tridesclous/numba_tools.py +160 -0
  64. linxi_tridesclous-1.0.0/tridesclous/online/__init__.py +24 -0
  65. linxi_tridesclous-1.0.0/tridesclous/online/launcher.py +207 -0
  66. linxi_tridesclous-1.0.0/tridesclous/online/onlinepeeler.py +183 -0
  67. linxi_tridesclous-1.0.0/tridesclous/online/onlinetools.py +135 -0
  68. linxi_tridesclous-1.0.0/tridesclous/online/onlinetraceviewer.py +183 -0
  69. linxi_tridesclous-1.0.0/tridesclous/online/onlinewaveformhistviewer.py +325 -0
  70. linxi_tridesclous-1.0.0/tridesclous/online/onlinewindow.py +893 -0
  71. linxi_tridesclous-1.0.0/tridesclous/online/probeactivityviewer.py +462 -0
  72. linxi_tridesclous-1.0.0/tridesclous/peakdetector.py +673 -0
  73. linxi_tridesclous-1.0.0/tridesclous/peeler.py +224 -0
  74. linxi_tridesclous-1.0.0/tridesclous/peeler_cl.py +429 -0
  75. linxi_tridesclous-1.0.0/tridesclous/peeler_engine_base.py +649 -0
  76. linxi_tridesclous-1.0.0/tridesclous/peeler_engine_geometry.py +715 -0
  77. linxi_tridesclous-1.0.0/tridesclous/peeler_engine_geometry_cl.py +2087 -0
  78. linxi_tridesclous-1.0.0/tridesclous/peeler_engine_testing.py +169 -0
  79. linxi_tridesclous-1.0.0/tridesclous/peeler_tools.py +87 -0
  80. linxi_tridesclous-1.0.0/tridesclous/probe_list.py +1053 -0
  81. linxi_tridesclous-1.0.0/tridesclous/pruningshears.py +902 -0
  82. linxi_tridesclous-1.0.0/tridesclous/pythran_tools.py +31 -0
  83. linxi_tridesclous-1.0.0/tridesclous/report.py +281 -0
  84. linxi_tridesclous-1.0.0/tridesclous/sawchaincut.py +371 -0
  85. linxi_tridesclous-1.0.0/tridesclous/scripts/__init__.py +0 -0
  86. linxi_tridesclous-1.0.0/tridesclous/scripts/tdc.py +109 -0
  87. linxi_tridesclous-1.0.0/tridesclous/signalpreprocessor.py +557 -0
  88. linxi_tridesclous-1.0.0/tridesclous/tests/__init__.py +0 -0
  89. linxi_tridesclous-1.0.0/tridesclous/tests/probe_list.py +1053 -0
  90. linxi_tridesclous-1.0.0/tridesclous/tests/test_autoparams.py +36 -0
  91. linxi_tridesclous-1.0.0/tridesclous/tests/test_catalogueconstructor.py +355 -0
  92. linxi_tridesclous-1.0.0/tridesclous/tests/test_cataloguetools.py +39 -0
  93. linxi_tridesclous-1.0.0/tridesclous/tests/test_cleancluster.py +157 -0
  94. linxi_tridesclous-1.0.0/tridesclous/tests/test_cltools.py +23 -0
  95. linxi_tridesclous-1.0.0/tridesclous/tests/test_cluster.py +96 -0
  96. linxi_tridesclous-1.0.0/tridesclous/tests/test_dataio.py +122 -0
  97. linxi_tridesclous-1.0.0/tridesclous/tests/test_datasets.py +28 -0
  98. linxi_tridesclous-1.0.0/tridesclous/tests/test_datasource.py +72 -0
  99. linxi_tridesclous-1.0.0/tridesclous/tests/test_decomposition.py +83 -0
  100. linxi_tridesclous-1.0.0/tridesclous/tests/test_dip.py +40 -0
  101. linxi_tridesclous-1.0.0/tridesclous/tests/test_export.py +69 -0
  102. linxi_tridesclous-1.0.0/tridesclous/tests/test_importers.py +47 -0
  103. linxi_tridesclous-1.0.0/tridesclous/tests/test_iotools.py +118 -0
  104. linxi_tridesclous-1.0.0/tridesclous/tests/test_jobtools.py +59 -0
  105. linxi_tridesclous-1.0.0/tridesclous/tests/test_matplotlibplot.py +85 -0
  106. linxi_tridesclous-1.0.0/tridesclous/tests/test_metrics.py +77 -0
  107. linxi_tridesclous-1.0.0/tridesclous/tests/test_peakdetector.py +425 -0
  108. linxi_tridesclous-1.0.0/tridesclous/tests/test_peeler.py +398 -0
  109. linxi_tridesclous-1.0.0/tridesclous/tests/test_report.py +78 -0
  110. linxi_tridesclous-1.0.0/tridesclous/tests/test_signalpreprocessor.py +360 -0
  111. linxi_tridesclous-1.0.0/tridesclous/tests/test_tools.py +100 -0
  112. linxi_tridesclous-1.0.0/tridesclous/tests/test_waveformtools.py +68 -0
  113. linxi_tridesclous-1.0.0/tridesclous/tests/testingtools.py +105 -0
  114. linxi_tridesclous-1.0.0/tridesclous/tools.py +404 -0
  115. linxi_tridesclous-1.0.0/tridesclous/version.py +1 -0
  116. linxi_tridesclous-1.0.0/tridesclous/waveformtools.py +612 -0
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 tridesclous
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1 @@
1
+ include LICENSE
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: linxi-tridesclous
3
+ Version: 1.0.0
4
+ Summary: offline/online spike sorting with french touch that light the barbecue
5
+ License: MIT
6
+ Requires-Dist: numpy
7
+ Requires-Dist: scipy
8
+ Requires-Dist: pandas
9
+ Requires-Dist: openpyxl
10
+ Requires-Dist: scikit-learn
11
+ Requires-Dist: matplotlib
12
+ Requires-Dist: seaborn
13
+ Requires-Dist: neo
14
+ Requires-Dist: tqdm
15
+ Requires-Dist: pyqtgraph
16
+ Requires-Dist: joblib
17
+ Requires-Dist: numba
18
+ Requires-Dist: hdbscan
19
+ Requires-Dist: loky
20
+ Provides-Extra: online
21
+ Requires-Dist: pyacq; extra == "online"
22
+ Provides-Extra: opencl
23
+ Requires-Dist: pyopencl; extra == "opencl"
24
+ Dynamic: license
25
+ Dynamic: provides-extra
26
+ Dynamic: requires-dist
27
+ Dynamic: summary
@@ -0,0 +1,73 @@
1
+ # trisdesclous: spike sorting with a [French touch](https://fr.wikipedia.org/wiki/French_touch_(informatique)).
2
+
3
+
4
+ **trisdesclous is not maintenaned anymore, please user spikeinterface and treidesclous2 instead**
5
+
6
+
7
+
8
+ ![icon](tridesclous/gui/icons/png/main_icon.png)
9
+
10
+ Authors: Christophe Pouzat and Samuel Garcia
11
+
12
+ ## documentation
13
+
14
+ The documentation is here: http://tridesclous.readthedocs.io/
15
+
16
+ ## overview
17
+
18
+ **tris des clous** is a very dishonest translation of **spike sorting** to French.
19
+
20
+ Pronouce it [tree day clue] in English.
21
+
22
+ The primary goal of tridesclous was to provide a toolkit to teach good practices in spike sorting techniques.
23
+ Trideslcous is now mature and can be used to sort spike on tetrode up to neuropixel probe recorded dataset.
24
+
25
+ Tridesclous is both:
26
+
27
+ * an offline spike sorter tools able to read many file format
28
+ * a realtime spike sorting combined with [pyacq](http://pyacq.readthedocs.io)
29
+
30
+ ## Main features
31
+
32
+ * template matching based method
33
+ * several alternative methods at several processing steps of the chain
34
+ * Qt GUI for interactive exploration
35
+ * a simple python API to use in a notebook or to build a custom pipeline
36
+ * support for many data formats (Raw, Blackrock, Neuralynx, Plexon, Spike2, Tdt, OpenEphys, ...) via [neo](https://github.com/NeuralEnsemble/python-neo)
37
+ * hardware acceleration with opencl: both GPU and multicore CPU
38
+ * smaller memory footprint
39
+ * built-in sample datasets to try on
40
+ * quite fast for tetrode datasets -- expect x30 speedup over real time on a simple laptop
41
+ * multi-platform
42
+ * open source based on a true open source stack
43
+
44
+ The forest of spike sorting tools is dense and *tridesclous* is a new tree.
45
+ Be curious and try it.
46
+
47
+
48
+ # Installation
49
+
50
+ http://tridesclous.readthedocs.io/en/latest/installation.html
51
+
52
+ # Launch
53
+
54
+ http://tridesclous.readthedocs.io/en/latest/launch.html
55
+
56
+
57
+ ## Screenshots
58
+
59
+ ### Offline Catalogue Window
60
+ ![snapshot](doc/img/snapshot_cataloguewindow.png)
61
+
62
+ ### offline Peeler Window
63
+ ![snapshot](doc/img/snapshot_peelerwindow.png)
64
+
65
+ ### Online Peeler in a pyacq.Node
66
+ ![snapshot](doc/img/online_tridesclous.gif)
67
+
68
+
69
+ ## Status
70
+
71
+ [![readthedocs](https://readthedocs.org/projects/tridesclous/badge/?version=latest&style=flat)]( http://tridesclous.readthedocs.io/en/latest/?badge=latest)
72
+ [![CircleCI](https://circleci.com/gh/tridesclous/tridesclous.svg?style=svg)](https://circleci.com/gh/tridesclous/tridesclous)
73
+ [![Appveyor](https://ci.appveyor.com/api/projects/status/7cqmevwu0r3sq87e?svg=true)](https://ci.appveyor.com/project/samuelgarcia/tridesclous)
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: linxi-tridesclous
3
+ Version: 1.0.0
4
+ Summary: offline/online spike sorting with french touch that light the barbecue
5
+ License: MIT
6
+ Requires-Dist: numpy
7
+ Requires-Dist: scipy
8
+ Requires-Dist: pandas
9
+ Requires-Dist: openpyxl
10
+ Requires-Dist: scikit-learn
11
+ Requires-Dist: matplotlib
12
+ Requires-Dist: seaborn
13
+ Requires-Dist: neo
14
+ Requires-Dist: tqdm
15
+ Requires-Dist: pyqtgraph
16
+ Requires-Dist: joblib
17
+ Requires-Dist: numba
18
+ Requires-Dist: hdbscan
19
+ Requires-Dist: loky
20
+ Provides-Extra: online
21
+ Requires-Dist: pyacq; extra == "online"
22
+ Provides-Extra: opencl
23
+ Requires-Dist: pyopencl; extra == "opencl"
24
+ Dynamic: license
25
+ Dynamic: provides-extra
26
+ Dynamic: requires-dist
27
+ Dynamic: summary
@@ -0,0 +1,114 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ setup.py
5
+ linxi_tridesclous.egg-info/PKG-INFO
6
+ linxi_tridesclous.egg-info/SOURCES.txt
7
+ linxi_tridesclous.egg-info/dependency_links.txt
8
+ linxi_tridesclous.egg-info/entry_points.txt
9
+ linxi_tridesclous.egg-info/requires.txt
10
+ linxi_tridesclous.egg-info/top_level.txt
11
+ tridesclous/__init__.py
12
+ tridesclous/autoparams.py
13
+ tridesclous/catalogueconstructor.py
14
+ tridesclous/cataloguetools.py
15
+ tridesclous/cleancluster.py
16
+ tridesclous/cltools.py
17
+ tridesclous/cluster.py
18
+ tridesclous/dataio.py
19
+ tridesclous/datasets.py
20
+ tridesclous/datasource.py
21
+ tridesclous/decomposition.py
22
+ tridesclous/dip.py
23
+ tridesclous/export.py
24
+ tridesclous/importers.py
25
+ tridesclous/iotools.py
26
+ tridesclous/jobtools.py
27
+ tridesclous/labelcodes.py
28
+ tridesclous/matplotlibplot.py
29
+ tridesclous/metrics.py
30
+ tridesclous/numba_tools.py
31
+ tridesclous/peakdetector.py
32
+ tridesclous/peeler.py
33
+ tridesclous/peeler_cl.py
34
+ tridesclous/peeler_engine_base.py
35
+ tridesclous/peeler_engine_geometry.py
36
+ tridesclous/peeler_engine_geometry_cl.py
37
+ tridesclous/peeler_engine_testing.py
38
+ tridesclous/peeler_tools.py
39
+ tridesclous/probe_list.py
40
+ tridesclous/pruningshears.py
41
+ tridesclous/pythran_tools.py
42
+ tridesclous/report.py
43
+ tridesclous/sawchaincut.py
44
+ tridesclous/signalpreprocessor.py
45
+ tridesclous/tools.py
46
+ tridesclous/version.py
47
+ tridesclous/waveformtools.py
48
+ tridesclous/gui/__init__.py
49
+ tridesclous/gui/base.py
50
+ tridesclous/gui/baselist.py
51
+ tridesclous/gui/cataloguecontroller.py
52
+ tridesclous/gui/cataloguewindow.py
53
+ tridesclous/gui/crosscorrelogramviewer.py
54
+ tridesclous/gui/featuretimeviewer.py
55
+ tridesclous/gui/gpuselector.py
56
+ tridesclous/gui/gui_params.py
57
+ tridesclous/gui/initializedatasetwindow.py
58
+ tridesclous/gui/isiviewer.py
59
+ tridesclous/gui/mainwindow.py
60
+ tridesclous/gui/myqt.py
61
+ tridesclous/gui/ndscatter.py
62
+ tridesclous/gui/pairlist.py
63
+ tridesclous/gui/peaklists.py
64
+ tridesclous/gui/peelercontroller.py
65
+ tridesclous/gui/peelerwindow.py
66
+ tridesclous/gui/probegeometryview.py
67
+ tridesclous/gui/silhouette.py
68
+ tridesclous/gui/similarity.py
69
+ tridesclous/gui/spikelists.py
70
+ tridesclous/gui/test_gpuselector.py
71
+ tridesclous/gui/tools.py
72
+ tridesclous/gui/traceviewer.py
73
+ tridesclous/gui/waveformhistviewer.py
74
+ tridesclous/gui/waveformviewer.py
75
+ tridesclous/gui/icons/__init__.py
76
+ tridesclous/gui/icons/icons_py3.py
77
+ tridesclous/gui/icons/make_ressources.py
78
+ tridesclous/gui/icons/test_ressources.py
79
+ tridesclous/online/__init__.py
80
+ tridesclous/online/launcher.py
81
+ tridesclous/online/onlinepeeler.py
82
+ tridesclous/online/onlinetools.py
83
+ tridesclous/online/onlinetraceviewer.py
84
+ tridesclous/online/onlinewaveformhistviewer.py
85
+ tridesclous/online/onlinewindow.py
86
+ tridesclous/online/probeactivityviewer.py
87
+ tridesclous/scripts/__init__.py
88
+ tridesclous/scripts/tdc.py
89
+ tridesclous/tests/__init__.py
90
+ tridesclous/tests/probe_list.py
91
+ tridesclous/tests/test_autoparams.py
92
+ tridesclous/tests/test_catalogueconstructor.py
93
+ tridesclous/tests/test_cataloguetools.py
94
+ tridesclous/tests/test_cleancluster.py
95
+ tridesclous/tests/test_cltools.py
96
+ tridesclous/tests/test_cluster.py
97
+ tridesclous/tests/test_dataio.py
98
+ tridesclous/tests/test_datasets.py
99
+ tridesclous/tests/test_datasource.py
100
+ tridesclous/tests/test_decomposition.py
101
+ tridesclous/tests/test_dip.py
102
+ tridesclous/tests/test_export.py
103
+ tridesclous/tests/test_importers.py
104
+ tridesclous/tests/test_iotools.py
105
+ tridesclous/tests/test_jobtools.py
106
+ tridesclous/tests/test_matplotlibplot.py
107
+ tridesclous/tests/test_metrics.py
108
+ tridesclous/tests/test_peakdetector.py
109
+ tridesclous/tests/test_peeler.py
110
+ tridesclous/tests/test_report.py
111
+ tridesclous/tests/test_signalpreprocessor.py
112
+ tridesclous/tests/test_tools.py
113
+ tridesclous/tests/test_waveformtools.py
114
+ tridesclous/tests/testingtools.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ tdc = tridesclous.scripts.tdc:main
@@ -0,0 +1,20 @@
1
+ numpy
2
+ scipy
3
+ pandas
4
+ openpyxl
5
+ scikit-learn
6
+ matplotlib
7
+ seaborn
8
+ neo
9
+ tqdm
10
+ pyqtgraph
11
+ joblib
12
+ numba
13
+ hdbscan
14
+ loky
15
+
16
+ [online]
17
+ pyacq
18
+
19
+ [opencl]
20
+ pyopencl
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,44 @@
1
+ from setuptools import setup
2
+ import os
3
+
4
+ d = {}
5
+ exec(open("tridesclous/version.py").read(), None, d)
6
+ version = d['version']
7
+
8
+ install_requires = [
9
+ 'numpy',
10
+ 'scipy',
11
+ 'pandas',
12
+ 'openpyxl',
13
+ 'scikit-learn',
14
+ 'matplotlib',
15
+ 'seaborn',
16
+ 'neo',
17
+ 'tqdm',
18
+ # 'PyQt5', make conda buggy
19
+ 'pyqtgraph',
20
+ 'joblib',
21
+ 'numba',
22
+ 'hdbscan',
23
+ 'loky',
24
+ ]
25
+ extras_require={
26
+ 'online' : ['pyacq',],
27
+ 'opencl' : ['pyopencl'],
28
+ }
29
+
30
+ setup(
31
+ name = "linxi-tridesclous",
32
+ version = version,
33
+ packages = ['tridesclous', 'tridesclous.gui', 'tridesclous.gui.icons',
34
+ 'tridesclous.online', 'tridesclous.scripts', 'tridesclous.tests'],
35
+ install_requires=install_requires,
36
+ extras_require = extras_require,
37
+ description = "offline/online spike sorting with french touch that light the barbecue",
38
+ entry_points={
39
+ 'console_scripts': ['tdc=tridesclous.scripts.tdc:main'],
40
+ #~ 'gui_scripts': ['tdcgui=tridesclous.scripts.tdc:open_mainwindow'],
41
+ },
42
+ license = "MIT",
43
+ license_files = 'LICENSE',
44
+ )
@@ -0,0 +1,43 @@
1
+ """
2
+
3
+ .. automodule:: tridesclous.dataio
4
+
5
+ .. automodule:: tridesclous.catalogueconstructor
6
+
7
+ .. automodule:: tridesclous.peeler
8
+
9
+
10
+
11
+
12
+ """
13
+ from .version import version as __version__
14
+ import os
15
+ import warnings
16
+
17
+ from .datasets import download_dataset, get_dataset
18
+
19
+ #dynamic import
20
+ from .datasource import data_source_classes
21
+ for c in data_source_classes.values():
22
+ globals()[c.__name__] = c
23
+
24
+ from .tools import open_prb
25
+ from .dataio import DataIO
26
+ from .signalpreprocessor import offline_signal_preprocessor, estimate_medians_mads_after_preprocesing
27
+ from .catalogueconstructor import CatalogueConstructor
28
+ from .cataloguetools import apply_all_catalogue_steps
29
+ from .peeler import Peeler
30
+ from .cltools import get_cl_device_list, set_default_cl_device
31
+
32
+ from .autoparams import get_auto_params_for_catalogue, get_auto_params_for_peelers
33
+
34
+
35
+ from .importers import import_from_spykingcircus, import_from_spike_interface
36
+
37
+ # exclude because import matplotlib
38
+
39
+ # from .matplotlibplot import *
40
+ # from .report import *
41
+
42
+ # from .gui import *
43
+
@@ -0,0 +1,274 @@
1
+ import time
2
+ import copy
3
+ from pprint import pprint
4
+
5
+ import numpy as np
6
+
7
+ from .cltools import HAVE_PYOPENCL
8
+ from .cluster import HAVE_ISOSPLIT5
9
+
10
+ try:
11
+ import numba
12
+ HAVE_NUMBA = True
13
+ except ImportError:
14
+ HAVE_NUMBA = False
15
+
16
+
17
+ # nb of channel to become sparse
18
+ limit_dense_sparse = 4
19
+
20
+
21
+ _default_catalogue_params = {
22
+ 'duration': 300.,
23
+
24
+ 'chunksize': 1024,
25
+ 'mode': 'dense', # 'sparse'
26
+ 'sparse_threshold': None, # 1.5
27
+ 'memory_mode': 'memmap',
28
+ 'n_spike_for_centroid':350,
29
+ 'n_jobs' :-1,
30
+
31
+ 'preprocessor': {
32
+ 'highpass_freq': 300.,
33
+ 'lowpass_freq': 5000.,
34
+ 'smooth_size': 0,
35
+
36
+ 'pad_width': -1, # this auto
37
+ 'engine': 'numpy',
38
+ 'common_ref_removal':False,
39
+ },
40
+ 'peak_detector': {
41
+ 'method' : 'global',
42
+ 'engine': 'numpy',
43
+ 'peak_sign': '-',
44
+ 'relative_threshold': 5.,
45
+ 'peak_span_ms': .7,
46
+ 'adjacency_radius_um' : None,
47
+ 'smooth_radius_um' : None,
48
+
49
+ },
50
+ 'noise_snippet': {
51
+ 'nb_snippet': 300,
52
+ },
53
+ 'extract_waveforms': {
54
+ 'wf_left_ms': -1.,
55
+ 'wf_right_ms': 1.5,
56
+ 'wf_left_long_ms': -2.5,
57
+ 'wf_right_long_ms': 3.5,
58
+ },
59
+ 'clean_peaks': {
60
+ #~ 'alien_value_threshold': None,
61
+ 'alien_value_threshold':-1., # equivalent to None (normally)
62
+ #~ 'alien_value_threshold': np.nan,
63
+ 'mode': 'extremum_amplitude',
64
+ },
65
+ 'peak_sampler': {
66
+ 'mode': 'rand',
67
+ 'nb_max': 20000,
68
+ #~ 'nb_max_by_channel': None,
69
+ 'nb_max_by_channel': 600.,
70
+ },
71
+ #~ 'clean_waveforms': {
72
+ #~ 'alien_value_threshold': None,
73
+ #~ },
74
+ 'feature_method': 'pca_by_channel',
75
+ 'feature_kargs': {},
76
+ 'cluster_method': 'pruningshears',
77
+ 'cluster_kargs': {},
78
+
79
+
80
+ 'clean_cluster' :{
81
+ 'apply_auto_split': True,
82
+ 'apply_trash_not_aligned': True,
83
+ 'apply_auto_merge_cluster': True,
84
+ 'apply_trash_low_extremum': True,
85
+ 'apply_trash_small_cluster': True,
86
+ },
87
+
88
+
89
+ 'make_catalogue':{
90
+ 'inter_sample_oversampling':False,
91
+ 'subsample_ratio': 'auto',
92
+ 'sparse_thresh_level2': 1.5,
93
+ 'sparse_thresh_level2': 3,
94
+ }
95
+ }
96
+
97
+
98
+
99
+
100
+
101
+ def get_auto_params_for_catalogue(dataio=None, chan_grp=0,
102
+ nb_chan=None, sample_rate=None,
103
+ context='offline'):
104
+ """
105
+ Automatic selection of parameters.
106
+ This totally empiric paramerters.
107
+ """
108
+
109
+ assert context in ('offline', 'online')
110
+
111
+ params = copy.deepcopy(_default_catalogue_params)
112
+
113
+ # TODO make this more complicated
114
+ # * by detecting if dense array or not.
115
+ # * better method sleection
116
+
117
+
118
+ if dataio is None:
119
+ # case online no DataIO
120
+ assert nb_chan is not None
121
+ assert sample_rate is not None
122
+ # use less because chunksize is set outsied
123
+ params['chunksize'] = int(sample_rate * 0.05)
124
+ params['duration'] = 10. # debug
125
+ else:
126
+ # case offline with a DataIO
127
+ nb_chan = dataio.nb_channel(chan_grp=chan_grp)
128
+ sample_rate = dataio.sample_rate
129
+ total_duration = sum(dataio.get_segment_length(seg_num=seg_num) / dataio.sample_rate for seg_num in range(dataio.nb_segment))
130
+ # auto chunsize of 100 ms
131
+ params['chunksize'] = int(sample_rate * 1.0)
132
+ params['duration'] = 601.
133
+
134
+ # segment durartion is not so big then take the whole duration
135
+ # to avoid double preprocessing (catalogue+peeler)
136
+ if params['duration'] * 2 > total_duration:
137
+ params['duration'] = total_duration
138
+
139
+ #~ if nb_chan == 1:
140
+ #~ params['mode'] = 'dense'
141
+ #~ params['adjacency_radius_um'] = 0.
142
+ #~ params['sparse_threshold'] = 1.5
143
+
144
+ #~ params['peak_detector']['method'] = 'global'
145
+ #~ params['peak_detector']['engine'] = 'numpy'
146
+ #~ params['peak_detector']['smooth_radius_um' ] = None
147
+
148
+
149
+ #~ params['peak_sampler']['mode'] = 'rand'
150
+ #~ params['peak_sampler']['nb_max'] = 20000
151
+
152
+ #~ params['feature_method'] = 'global_pca'
153
+ #~ params['feature_kargs'] = {'n_components' : 4 }
154
+
155
+ #~ params['cluster_method'] = 'dbscan_with_noise'
156
+ #~ params['cluster_kargs'] = {}
157
+
158
+
159
+
160
+ #~ params['clean_cluster_kargs'] = {'too_small' : 20 }
161
+
162
+ #~ elif nb_chan <=4:
163
+ if nb_chan <= limit_dense_sparse:
164
+ #~ if nb_chan <=8:
165
+
166
+ params['mode'] = 'dense'
167
+ #~ params['adjacency_radius_um'] = 0.
168
+ params['sparse_threshold'] = 1.5
169
+
170
+ #~ params['peak_detector']['method'] = 'global'
171
+ #~ params['peak_detector']['engine'] = 'numpy'
172
+
173
+ params['peak_detector']['method'] = 'geometrical'
174
+ params['peak_detector']['engine'] = 'numba'
175
+
176
+ params['peak_detector']['adjacency_radius_um'] = 200. # useless
177
+ params['peak_detector']['smooth_radius_um' ] = None
178
+
179
+
180
+ params['peak_sampler']['mode'] = 'rand'
181
+ params['peak_sampler']['nb_max'] = 20000
182
+
183
+ params['feature_method'] = 'global_pca'
184
+ if nb_chan in (1,2):
185
+ n_components = 5
186
+ else:
187
+ n_components = int(nb_chan*2)
188
+ params['feature_kargs'] = {'n_components' : n_components }
189
+
190
+
191
+ params['cluster_method'] = 'pruningshears'
192
+ params['cluster_kargs']['max_loop'] = max(1000, nb_chan * 10)
193
+ params['cluster_kargs']['min_cluster_size'] = 20
194
+ params['cluster_kargs']['adjacency_radius_um'] = 0.
195
+ params['cluster_kargs']['high_adjacency_radius_um'] = 0.
196
+
197
+ # necessary for peeler classic
198
+ #~ params['make_catalogue']['inter_sample_oversampling'] = True
199
+
200
+
201
+
202
+
203
+ else:
204
+ params['mode'] = 'sparse'
205
+ #~ params['adjacency_radius_um'] = 200.
206
+ params['sparse_threshold'] = 1.5
207
+
208
+ if nb_chan >= 32 and HAVE_PYOPENCL:
209
+ params['preprocessor']['engine'] = 'opencl'
210
+ params['peak_detector']['method'] = 'geometrical'
211
+ params['peak_detector']['adjacency_radius_um'] = 200.
212
+ #~ params['peak_detector']['smooth_radius_um' ] = 10
213
+ params['peak_detector']['smooth_radius_um' ] = None
214
+
215
+
216
+ if HAVE_PYOPENCL:
217
+ params['peak_detector']['engine'] = 'opencl'
218
+ elif HAVE_NUMBA:
219
+ params['peak_detector']['engine'] = 'numba'
220
+ else:
221
+ print('WARNING : peakdetector will be slow install opencl or numba')
222
+ params['peak_detector']['engine'] = 'numpy'
223
+
224
+ params['peak_sampler']['mode'] = 'rand_by_channel'
225
+ #~ params['extract_waveforms']['nb_max_by_channel'] = 700
226
+ params['peak_sampler']['nb_max_by_channel'] = 1000
227
+ #~ params['peak_sampler']['nb_max_by_channel'] = 1500
228
+ #~ params['peak_sampler']['nb_max_by_channel'] = 3000
229
+
230
+
231
+ params['feature_method'] = 'pca_by_channel'
232
+ # TODO change n_components_by_channel depending on channel density
233
+ #~ params['feature_kargs'] = {'n_components_by_channel':5}
234
+ params['feature_kargs'] = {'n_components_by_channel': 3,
235
+ 'adjacency_radius_um' :50., # this should be greater than cluster 'adjacency_radius_um'
236
+ }
237
+
238
+ params['cluster_method'] = 'pruningshears'
239
+ params['cluster_kargs']['max_loop'] = max(1000, nb_chan * 20)
240
+ params['cluster_kargs']['min_cluster_size'] = 20
241
+ params['cluster_kargs']['adjacency_radius_um'] = 50.
242
+ params['cluster_kargs']['high_adjacency_radius_um'] = 30.
243
+
244
+ if context == 'online':
245
+ params['n_jobs' ] = 1
246
+
247
+ return params
248
+
249
+
250
+
251
+ def get_auto_params_for_peelers(dataio, chan_grp=0):
252
+ nb_chan = dataio.nb_channel(chan_grp=chan_grp)
253
+ params = {}
254
+
255
+ params['chunksize'] = int(dataio.sample_rate * 1)
256
+ #~ params['chunksize'] = int(dataio.sample_rate * 0.5)
257
+ #~ params['chunksize'] = int(dataio.sample_rate * 0.1)
258
+ #~ params['chunksize'] = int(dataio.sample_rate * 0.033)
259
+
260
+ if nb_chan <= limit_dense_sparse:
261
+ params['engine'] = 'geometrical'
262
+
263
+ else:
264
+ if HAVE_PYOPENCL:
265
+ params['engine'] = 'geometrical_opencl'
266
+ else:
267
+ params['engine'] = 'geometrical'
268
+
269
+
270
+ # DEBUG force 'geometrical'
271
+ params['engine'] = 'geometrical'
272
+
273
+
274
+ return params