Discussion

The simplest approach that has been used to decide if clusters from different recording sessions could be associated to the same neurons is based on comparing their waveforms and other metrics (e.g. mean firing rate) and link the clusters that conserve similar proprieties \cite{Tolias_2007,Fraser_2012,Emondi_2004,Eleryan_2014,Dickey_2009}. This approach requires the recording to be stable enough so that the waveforms and the firing dynamics of the neurons do not change significantly across sessions. The main advantage of this simple cluster-comparison approach is that any spike sorting algorithm could be used to obtain the clusters on each session.
The application of a Bayesian framework to model blocks of spikes and then apply previous information and transition probabilities to track the neurons can be used to follow gradual changes across the recording \cite{Bar_Hillel_2006,Wolf_2009,Shalchyan_2014,Shan_2017}. However, some of these methods require a fixed number of neurons across the recording \cite{Shalchyan_2014,Shan_2017} and others use algorithms with high computational cost to handle a variable number of neurons \cite{Wolf_2009,Bar_Hillel_2006}. The approach has the advantage of dividing the tracking procedure in two smaller problems: a clustering on each stable block and the calculation of the transition probabilities.
Other methods allow neurons to gradually drift from an initial analyzed segment \cite{Franke_2009,Calabrese_2011,Pouzat_2004}, but they are sensitive to errors produced in the sorting of the initial segment and the change of the number of neurons throughout the recording. These methods remark the necessity of an error-correcting approach with enough flexibility to update the number of neurons being tracked. A method called FAST \cite{Dhawale_2017} is a clear example that it is possible to implement such a method, but its high computational cost and lack of intuition on the effect of some of its parameters and how to control them makes it difficult to use this method in practice.
Some well-known spike sorting methods can handle drifting waveforms \cite{Chung_2017,Jun_2017,Niediek_2016}, yet it is possible that, for long-term recordings, all the spikes with a similar waveform will be assigned to the same cluster without taking in consideration the time difference between them.
We combined all these observations and developed Spikes_Link, a general framework to fully track neurons and handle spike sorting errors and stability fluctuations using ad hoc rules. The method requires a certain spike sorting algorithm (the one preferred by the user) to sort a block of spikes and then includes on the next block subsets of the spikes of the classes being tracked. Based on these sets, we introduced a metric between clusters from a given block and classes being tracked from previous blocks. As all the classes are equally represented in the sets, this provides an advantage for tracking sparsely-firing neurons. In addition, after analyzing all the available blocks, we implement a graph reduction step to reduce the number of spurious classes.
The metric and the relationship between clusters in Spikes_Link have some similarities to the MONIC framework \cite{Spiliopoulou_2006} for modeling and tracking general cluster transitions. However, MONIC tracks the dynamics of classes without considering the possibility of clustering errors, and uses overlapping time windows instead of sets as we do, which would affect tracking over sparse neurons. Finally, the framework presented in this work can be applied to other problems, such as data streams with concept drift and class imbalance \cite{Hoens_2012}.