RT Journal Article SR Electronic T1 Solving the spike sorting problem with Kilosort JF bioRxiv FD Cold Spring Harbor Laboratory SP 2023.01.07.523036 DO 10.1101/2023.01.07.523036 A1 Pachitariu, Marius A1 Sridhar, Shashwat A1 Stringer, Carsen YR 2023 UL http://biorxiv.org/content/early/2023/01/07/2023.01.07.523036.abstract AB Spike sorting is the computational process of extracting the firing times of single neurons from recordings of local electrical fields. This is an important but hard problem in neuroscience, complicated by the non-stationarity of the recordings and the dense overlap in electrical fields between nearby neurons. To solve the spike sorting problem, we have continuously developed over the past eight years a framework known as Kilosort. This paper describes the various algorithmic steps introduced in different versions of Kilosort. We also report the development of Kilosort4, a new version with substantially improved performance due to new clustering algorithms inspired by graph-based approaches. To test the performance of Kilosort, we developed a realistic simulation framework which uses densely sampled electrical fields from real experiments to generate non-stationary spike waveforms and realistic noise. We find that nearly all versions of Kilosort outperform other algorithms on a variety of simulated conditions, and Kilosort4 performs best in all cases, correctly identifying even neurons with low amplitudes and small spatial extents in high drift conditions.Competing Interest StatementThe authors have declared no competing interest.