Spike Sorting Animation

jeu. 17 janvier 2019 by Martin Deudon

Github link : https://github.com/tinmarD/SpikeSortingAnimation

These scripts illustrate the spike-sorting process using Python and pygame.

  • spikesorting_game_1.py shows the raw signal on 1 tetrode
  • spikesorting_game_1_2.py shows both the raw and filtered signal (~300-3000Hz)
  • spikesorting_game_2.py shows the raw signal on top and the action potential after spike detection
  • spikesorting_game_3.py shows the results of the spike sorting, i.e. each action potential is colored differently depending on the neuron having emitted the spike.

The scripts works with the spike sorting results from Spyking Circus.

For all the scripts, you can press the space key to pause or play the animation, the down or up keys to slow down or increase the speed (until a certain limit)

Raw signal - spikesorting_game_1.py

This first script simply shows the raw signal on one tetrode. You can select a particular tetrode and a time period. It also writes the raw signal (first micro-wire of the selected tetrode) as a .wav file. This signal can then be listened to but it needs to be slowed down before. It can be done with Audacity.

Raw and filtered signals - spikesorting_game_2.py

The second script shows both the raw and filtered signal in the neuronal range ([300-3000Hz]). It also writes the raw and filtered signal (first micro-wire of the selected tetrode) as a .wav file.

Press 2 to hide or show the filtered signal.

Spike Detection : spikesorting_game_2.py

The third script includes the spike detection step but not the spike sorting step. Raw signal is shown on top, with each spike colored in yellow. A sound is played each time a spike reaches the middle of the screen.

Press 3 to hide or show the spikes.

Spike Sorting : spikesorting_game_3.py

This last step show the end of the spike sorting process. Each spike is associated with a neuron/unit. Spikes are colored depending on the unit which has fired. A sound is played each time a spike reaches the middle of the screen and this sound is different depending on the unit which fires.

Press 3 to hide or show the spikes.