There have been recent work to develop methods for long-term tracking of neurons over recordings sessions \cite{Fraser_2012,Tolias_2007,Emondi_2004,Eleryan_2014,Dickey_2009}, over consecutive blocks of spikes or time \cite{Niediek_2016,Bar_Hillel_2006,Wolf_2009,Shalchyan_2014,Shan_2017,Dhawale_2017}, or gradually over the whole recording \cite{Calabrese_2011,Pouzat_2004,Franke_2009}. All these approaches can handle different degrees of recording stability, but in general their performance is very poor when tracking neurons during epochs with high noise levels, sparse-firing neurons, or a variable number of detectable neurons (neurons appearing or disappearing).
To handle these difficulties, we present a general framework to track drifting neurons over long periods of time that does not rely on a specific spike sorting approach, i.e. the user can choose the spike sorter that will be used in the core of the tracking algorithm \cite{Chaure_2018,Yger_2018,Jun_2017,Chung_2017,Hilgen_2017}

Method

The method presented here, that will be called Spikes_Link, requires an initial detection of spikes and their separation in consecutive blocks of \(N_{\max}=20,000\) spikes. When the length of a resulting block exceeds \(T_{max}=30\) minutes, a smaller 30-minutes block is selected as long as the number of spikes is larger than \(N_{\min}=10,000\). Otherwise, a block with \(N_{min}\) spikes is selected. Still, it would be possible to adapt the algorithm to support blocks defined by a given duration instead of the number of spikes, where spike detection could be done within each block by the specific sorter chosen. 
Each block with \(N_{t_i}\) spikes will be labelled \(t_i\) with i=1,2...; given the variability of the firing rates the duration of each block will be, in general, variable. These blocks will be sequentially examined to track the previously detected putative neurons. As we track the activity of a putative neuron that is associated to class \(j\), we define \(C_{j}^{t_i}\) as the collection of spikes up to \(t_i\) that were assigned to class \(j\). At the same time, when sorting is performed on block \(t_i\), spikes are separated into clusters \(\tilde C_k^{t_i}\). To track the neurons' activity, the spikes from each cluster will be assigned to one of the available classes; although they could also be assigned to a new class if necessary, or even discarded.