SlideShare a Scribd company logo
Spike sor t ing
  Tut or ial igo Quian Quir oga
          Rodr
Problem: detect and separate spikes
corresponding to different neurons
Goals:
• Algorithm for automatic detection and sorting of
  spikes.
• Suitable for on-line analysis.
• Improve both detection and sorting in comparison
  with previous approaches.
Outline of the method:
I - Spike detection: amplitude threshold.
II - Feature extraction: wavelets.
III - Sorting: Superparamagnetic clustering.
This tutorial will show you how to
      do spike sorting using:


 The wave_ clus graphic user
 interface.

 The batch files Get_spikes and
 Do_clustering.
Getting started…

• Add the directory wave_clus with subfolders in your
  matlab path (using the matlab File/Set Path menu)


• Type wave_clus in matlab to call the GUI.


• Choose DataType simulator and load the file
  C_Easy1_noise01_short (in the subdir
  wave_clus/Sample_data/Simulator) using the Load
  button.
It should look like this…
Now you are ready to start playing with                wave_ clus …
•   This is a 10 sec. segment of simulated data.

•   First, choose the option plot_average to plot the average spike shapes (+/- 1
    std). Then choose to plot the spike features.

•   There may be some spikes unassigned in cluster 0. Go back to plot_all and use
    the Force button to assign them to any of the clusters. Better?

•   Now change the temperature. At t=0 you will get a single cluster, for large t’s
    you may get many clusters (if the parameter min_clus allows it).

•   Save the results using the Save clusters button. Load the output file
    times_C_Easy1_noise01.mat. Cluster membership is saved in the first column
    of the variable cluster_class. The second column gives the spike times.

•   You can also change the isi histogram plots using the max and step options.

•   Finally check the parameters used in the Set_parameters_simulation file in
    the wave_clus/Parametes_files (just type ‘open set_parameters_simulation’ in
    matlab).
Playing with the spike features…


• Load the file C_Difficult1_noise015
  using again the DataType: Simulator.


• Use the Spike features option
You should get something like this…
Seeing the clusters…
• You may, however, get something different cause SPC
  is a stochastic clustering method. If you don’t get the
  3 clusters, you may have to change the temperature.

• The are 3 different spike shapes, but you don’t see
  three clear clusters. That’s because wave_clus plots in
  the main window the first 2 wavelet coefficients.

• You can see the rest of the projections by clicking the
  Plot all projections button
It would look like this…




                           Clusters separate clearly
                           in some projections
Using Principal ComponentAnalysis

• Now do the same using PCA. Open set_parameters_simulation
  and select features = ‘pca’ instead of features = ‘wav’ (don’t
  forget to set it back to ‘wav’ when you are done!).

• Load again the data C_Difficult1_noise015.
You should get something like this…
Why PCA does so bad here?
•   As you see, there’s now only one single cluster (and for no temperature
    you can split it into 3!). You have just replicated the results of Fig. 8 of
    the Neural Computation paper (see reference at the end).



•   In this dataset the spike shapes are very similar, and their differences
    are localized in time. Do to its excellent time-frequency resolution,
    wavelets does much better.

•   Also, don’t forget that PCA looks for directions of maximum variance,
    which are not necessarily the ones offering the best separation
    between the clusters. Wavelets combined with the KS test (see paper)
    looks for the coefficients with multimodal distribution, which are very
    likely the ones offering the best separation between the clusters.

•   As a summary, in the Neural Computation paper it is shown for several
    different examples of simulated data a better performance of wavelets
    in comparison to PCA.
You are now ready for real data!
•   You will now load a ~30’ multiunit recording from a human epilepsy
    patient. The data was collected at Itzhak Fried’s lab at UCLA.

•   Intracranial recordings in these patients (refractory to medication) are
    done for clinical reasons in order to evaluate the feasibility of epilepsy
    surgery.

•   Load the file CSC4 using the DataType: CSC (pre-clustered). Using the
    (pre-clustered) option you will load data that has already been
    clustered using the batch file Do_clustering_CSC. If you want to start
    from scratch use the CSC option.

•   Check the settings in the Set_parameters_CSC file. If you have a
    Neuralynx system you can already use the CSC and Sc options for your
    own data.

•   BTW, there should be a few cool publications coming up using these
    human data. If you’re interested check
    www.vis.caltech.edu/~rodri/publications in the near future or email me.
It should look like this (if you use the Force button)…
Playing with it…

• Again, you can change the temperature, force the
  clustering, see the spike features, etc. Remember
  that everything is much faster is you use
  Plot_average instead of Plot_all.

• You can also zoom into the data using the Tools menu.

• You may also want to fix a given cluster by using the
  fix button. This option is useful for choosing clusters
  at different temperatures or for not forcing all the
  clusters together.
One further example:

• Sometimes clusters appear at different
  temperatures
• In the following example we give a step-
  by-step example of a clustering
  procedure using the fix button
Step 1: Fix cluster 2 at low T       Step 3: Check features




Step 2: Change to T2             Step 4: Fix clusters 2 and 3
Step 5: Change to T3           Step 6: Re-check features




Step 7: Push the Force button


                                    This is how the final clustering
                                    looks like!

                                    Note that after forcing the
                                    green cluster is not as clean as
                                    before.
Clustering your own data…
•   Most likely you’ll end up using the ASCII DataType option for your data.

•   If you have continuous data, it should be stored as a single vector in a
    variable data, which is saved in a .mat file. Look for the file test.mat for an
    example. This data should be loaded using the ASCII option or the ASCII
    (pre-clustered) if you have already clustered it with the Do_clustering
    batch file.

•   If you have spikes that have already been detected, you should use the
    ASCII spikes option. The spikes should be stored in a matrix named spikes
    in a .mat file. The file test1_spikes.mat gives an example of the format.

•   You can set the optimal parameters for you data in the corresponding
    Set_parameters_ascii (or ascii_spikes) file. Most important, don’t forget to
    set the sampling rate sr!

•   Important note: To save computational time, if you have more than 30000
    spikes in your dataset, by default these will be assigned by template
    matching with the batch clustering code (this can be changed in the
    set_parameters file). With the GUI, they will stay in cluster 0 and they
    should be assigned to the other clusters using the Force button. Note that
Using the batch files…

• There are two main batch files: Get_spikes (for spike detection)
  and Do_clustering (for spike sorting). Parameters are set in the
  first lines.They both go through all the files set in Files.txt.

• Unsupervised results will be saved and printed (either in the
  printer or in a file), but can be later changed with the GUI. For
  changing results, you have to load the file with the (pre-
  clustered) option. The nice thing is that results for all
  temperatures are stored, so changing things with the GUI
  mainly implies storing a different set of results rather than
  doing the clustering again. Note that using the GUI for
  clustering (e.g. with the ASCII option) does not store the
  clustering results for future uses.
You are now a clustering expert!
• If you want further details on the method, check:
   Unsupervised spike sorting with wavelets and superparamagnetic clustering
   R. Quian Quiroga, Z. Nadasdy and Y. Ben-Shaul.
   Neural Computation 16, 1661-1687; 2004.




• If you want to keep updated on new versions, give me
  some comments or feedback on how wave_ clus
  works with your data (I would love to hear about it),
  etc. please email me at: rodri@vis.caltech.edu


• Good luck and hope it’s useful!
Spike sorting gallery…
Spike sorting-tutorial
Ad

More Related Content

What's hot (20)

Global Illumination
Global IlluminationGlobal Illumination
Global Illumination
Masafumi Noda
 
【メタサーベイ】Neural Fields
【メタサーベイ】Neural Fields【メタサーベイ】Neural Fields
【メタサーベイ】Neural Fields
cvpaper. challenge
 
Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2
Guerrilla
 
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
Preferred Networks
 
シェーダだけで世界を創る!three.jsによるレイマーチング
シェーダだけで世界を創る!three.jsによるレイマーチングシェーダだけで世界を創る!three.jsによるレイマーチング
シェーダだけで世界を創る!three.jsによるレイマーチング
Sho Hosoda
 
Light prepass
Light prepassLight prepass
Light prepass
changehee lee
 
Pynqでカメラ画像をリアルタイムfastx コーナー検出
Pynqでカメラ画像をリアルタイムfastx コーナー検出Pynqでカメラ画像をリアルタイムfastx コーナー検出
Pynqでカメラ画像をリアルタイムfastx コーナー検出
marsee101
 
3D Gaussian Splatting
3D Gaussian Splatting3D Gaussian Splatting
3D Gaussian Splatting
taeseon ryu
 
2018.12.22 깊이 버퍼 그림자 매핑
2018.12.22 깊이 버퍼 그림자 매핑2018.12.22 깊이 버퍼 그림자 매핑
2018.12.22 깊이 버퍼 그림자 매핑
Sukwoo Lee
 
Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666
Tiago Sousa
 
【DL輪読会】"Instant Neural Graphics Primitives with a Multiresolution Hash Encoding"
【DL輪読会】"Instant Neural Graphics Primitives with a Multiresolution Hash Encoding"【DL輪読会】"Instant Neural Graphics Primitives with a Multiresolution Hash Encoding"
【DL輪読会】"Instant Neural Graphics Primitives with a Multiresolution Hash Encoding"
Deep Learning JP
 
[DL輪読会]Adversarial Feature Matching for Text Generation
[DL輪読会]Adversarial Feature Matching for Text Generation[DL輪読会]Adversarial Feature Matching for Text Generation
[DL輪読会]Adversarial Feature Matching for Text Generation
Deep Learning JP
 
UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~
UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~
UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~
historia_Inc
 
Beyond porting
Beyond portingBeyond porting
Beyond porting
Cass Everitt
 
DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3
Electronic Arts / DICE
 
【DL輪読会】Factory: Fast Contact for Robotic Assembly
【DL輪読会】Factory: Fast Contact for Robotic Assembly【DL輪読会】Factory: Fast Contact for Robotic Assembly
【DL輪読会】Factory: Fast Contact for Robotic Assembly
Deep Learning JP
 
[NDC19] 모바일에서 사용가능한 유니티 커스텀 섭스턴스 PBR 셰이더 만들기
[NDC19] 모바일에서 사용가능한 유니티 커스텀 섭스턴스 PBR 셰이더 만들기[NDC19] 모바일에서 사용가능한 유니티 커스텀 섭스턴스 PBR 셰이더 만들기
[NDC19] 모바일에서 사용가능한 유니티 커스텀 섭스턴스 PBR 셰이더 만들기
Madumpa Park
 
Hair animation by vertex shader
Hair animation by vertex shaderHair animation by vertex shader
Hair animation by vertex shader
동석 김
 
VPNについて
VPNについてVPNについて
VPNについて
Nomura Yusuke
 
【メタサーベイ】Neural Fields
【メタサーベイ】Neural Fields【メタサーベイ】Neural Fields
【メタサーベイ】Neural Fields
cvpaper. challenge
 
Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2
Guerrilla
 
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
Preferred Networks
 
シェーダだけで世界を創る!three.jsによるレイマーチング
シェーダだけで世界を創る!three.jsによるレイマーチングシェーダだけで世界を創る!three.jsによるレイマーチング
シェーダだけで世界を創る!three.jsによるレイマーチング
Sho Hosoda
 
Pynqでカメラ画像をリアルタイムfastx コーナー検出
Pynqでカメラ画像をリアルタイムfastx コーナー検出Pynqでカメラ画像をリアルタイムfastx コーナー検出
Pynqでカメラ画像をリアルタイムfastx コーナー検出
marsee101
 
3D Gaussian Splatting
3D Gaussian Splatting3D Gaussian Splatting
3D Gaussian Splatting
taeseon ryu
 
2018.12.22 깊이 버퍼 그림자 매핑
2018.12.22 깊이 버퍼 그림자 매핑2018.12.22 깊이 버퍼 그림자 매핑
2018.12.22 깊이 버퍼 그림자 매핑
Sukwoo Lee
 
Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666
Tiago Sousa
 
【DL輪読会】"Instant Neural Graphics Primitives with a Multiresolution Hash Encoding"
【DL輪読会】"Instant Neural Graphics Primitives with a Multiresolution Hash Encoding"【DL輪読会】"Instant Neural Graphics Primitives with a Multiresolution Hash Encoding"
【DL輪読会】"Instant Neural Graphics Primitives with a Multiresolution Hash Encoding"
Deep Learning JP
 
[DL輪読会]Adversarial Feature Matching for Text Generation
[DL輪読会]Adversarial Feature Matching for Text Generation[DL輪読会]Adversarial Feature Matching for Text Generation
[DL輪読会]Adversarial Feature Matching for Text Generation
Deep Learning JP
 
UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~
UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~
UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~
historia_Inc
 
【DL輪読会】Factory: Fast Contact for Robotic Assembly
【DL輪読会】Factory: Fast Contact for Robotic Assembly【DL輪読会】Factory: Fast Contact for Robotic Assembly
【DL輪読会】Factory: Fast Contact for Robotic Assembly
Deep Learning JP
 
[NDC19] 모바일에서 사용가능한 유니티 커스텀 섭스턴스 PBR 셰이더 만들기
[NDC19] 모바일에서 사용가능한 유니티 커스텀 섭스턴스 PBR 셰이더 만들기[NDC19] 모바일에서 사용가능한 유니티 커스텀 섭스턴스 PBR 셰이더 만들기
[NDC19] 모바일에서 사용가능한 유니티 커스텀 섭스턴스 PBR 셰이더 만들기
Madumpa Park
 
Hair animation by vertex shader
Hair animation by vertex shaderHair animation by vertex shader
Hair animation by vertex shader
동석 김
 

Viewers also liked (13)

3rd class dr.ali boresliy
3rd class dr.ali boresliy3rd class dr.ali boresliy
3rd class dr.ali boresliy
AHS_Physio
 
Compressively Sensing Action Potentials (Neural Spikes) - Presented at BSN 2011
Compressively Sensing Action Potentials  (Neural Spikes) - Presented at BSN 2011Compressively Sensing Action Potentials  (Neural Spikes) - Presented at BSN 2011
Compressively Sensing Action Potentials (Neural Spikes) - Presented at BSN 2011
Zainul Charbiwala
 
Cognition
CognitionCognition
Cognition
vacagodx
 
Vision Lucky
Vision  LuckyVision  Lucky
Vision Lucky
vacagodx
 
Chemical Senses
Chemical SensesChemical Senses
Chemical Senses
vacagodx
 
Language
LanguageLanguage
Language
vacagodx
 
Emotions 2
Emotions 2Emotions 2
Emotions 2
vacagodx
 
Chemical Senses
Chemical SensesChemical Senses
Chemical Senses
vacagodx
 
Memory2
Memory2Memory2
Memory2
vacagodx
 
Opiates
OpiatesOpiates
Opiates
vacagodx
 
Vestibular System
Vestibular SystemVestibular System
Vestibular System
vacagodx
 
Auditory System
Auditory SystemAuditory System
Auditory System
vacagodx
 
Infant Brain Development
Infant Brain DevelopmentInfant Brain Development
Infant Brain Development
vacagodx
 
3rd class dr.ali boresliy
3rd class dr.ali boresliy3rd class dr.ali boresliy
3rd class dr.ali boresliy
AHS_Physio
 
Compressively Sensing Action Potentials (Neural Spikes) - Presented at BSN 2011
Compressively Sensing Action Potentials  (Neural Spikes) - Presented at BSN 2011Compressively Sensing Action Potentials  (Neural Spikes) - Presented at BSN 2011
Compressively Sensing Action Potentials (Neural Spikes) - Presented at BSN 2011
Zainul Charbiwala
 
Vision Lucky
Vision  LuckyVision  Lucky
Vision Lucky
vacagodx
 
Chemical Senses
Chemical SensesChemical Senses
Chemical Senses
vacagodx
 
Emotions 2
Emotions 2Emotions 2
Emotions 2
vacagodx
 
Chemical Senses
Chemical SensesChemical Senses
Chemical Senses
vacagodx
 
Vestibular System
Vestibular SystemVestibular System
Vestibular System
vacagodx
 
Auditory System
Auditory SystemAuditory System
Auditory System
vacagodx
 
Infant Brain Development
Infant Brain DevelopmentInfant Brain Development
Infant Brain Development
vacagodx
 
Ad

Similar to Spike sorting-tutorial (20)

Cubesat challenge considerations deep dive
Cubesat challenge considerations deep diveCubesat challenge considerations deep dive
Cubesat challenge considerations deep dive
clintonbeye
 
Machine Learning Guide maXbox Starter62
Machine Learning Guide maXbox Starter62Machine Learning Guide maXbox Starter62
Machine Learning Guide maXbox Starter62
Max Kleiner
 
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Universitat Politècnica de Catalunya
 
Birth 1
Birth 1Birth 1
Birth 1
chougulesushant
 
Ot performance webinar
Ot performance webinarOt performance webinar
Ot performance webinar
Suite Solutions
 
Clustering
ClusteringClustering
Clustering
Meme Hei
 
Nuts and Bolts of Transfer Learning.pptx
Nuts and Bolts of Transfer Learning.pptxNuts and Bolts of Transfer Learning.pptx
Nuts and Bolts of Transfer Learning.pptx
vmanjusundertamil21
 
Optimization in essbase
Optimization in essbaseOptimization in essbase
Optimization in essbase
Ajay singh chouhan
 
Cell Profiler
Cell ProfilerCell Profiler
Cell Profiler
university of education,Lahore
 
OverviewUsing the C-struct feature, design, implement and .docx
OverviewUsing the C-struct feature, design, implement and .docxOverviewUsing the C-struct feature, design, implement and .docx
OverviewUsing the C-struct feature, design, implement and .docx
alfred4lewis58146
 
Lecture 01 variables scripts and operations
Lecture 01   variables scripts and operationsLecture 01   variables scripts and operations
Lecture 01 variables scripts and operations
Smee Kaem Chann
 
Assignment2 A
Assignment2 AAssignment2 A
Assignment2 A
Mahmoud
 
Kaggle Otto Challenge: How we achieved 85th out of 3,514 and what we learnt
Kaggle Otto Challenge: How we achieved 85th out of 3,514 and what we learntKaggle Otto Challenge: How we achieved 85th out of 3,514 and what we learnt
Kaggle Otto Challenge: How we achieved 85th out of 3,514 and what we learnt
Eugene Yan Ziyou
 
Stacks
StacksStacks
Stacks
Acad
 
Machine learning Experiments report
Machine learning Experiments report Machine learning Experiments report
Machine learning Experiments report
AlmkdadAli
 
08 neural networks
08 neural networks08 neural networks
08 neural networks
ankit_ppt
 
Stata time-series-fall-2011
Stata time-series-fall-2011Stata time-series-fall-2011
Stata time-series-fall-2011
Feryanto W K
 
Unsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptxUnsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptx
FaridAliMousa1
 
17_00-Dima-Panchenko-cnn-tips-and-tricks.pptx
17_00-Dima-Panchenko-cnn-tips-and-tricks.pptx17_00-Dima-Panchenko-cnn-tips-and-tricks.pptx
17_00-Dima-Panchenko-cnn-tips-and-tricks.pptx
MahmoudAbuGhali
 
Stata Training_EEA.ppt
Stata Training_EEA.pptStata Training_EEA.ppt
Stata Training_EEA.ppt
selam49
 
Cubesat challenge considerations deep dive
Cubesat challenge considerations deep diveCubesat challenge considerations deep dive
Cubesat challenge considerations deep dive
clintonbeye
 
Machine Learning Guide maXbox Starter62
Machine Learning Guide maXbox Starter62Machine Learning Guide maXbox Starter62
Machine Learning Guide maXbox Starter62
Max Kleiner
 
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Universitat Politècnica de Catalunya
 
Clustering
ClusteringClustering
Clustering
Meme Hei
 
Nuts and Bolts of Transfer Learning.pptx
Nuts and Bolts of Transfer Learning.pptxNuts and Bolts of Transfer Learning.pptx
Nuts and Bolts of Transfer Learning.pptx
vmanjusundertamil21
 
OverviewUsing the C-struct feature, design, implement and .docx
OverviewUsing the C-struct feature, design, implement and .docxOverviewUsing the C-struct feature, design, implement and .docx
OverviewUsing the C-struct feature, design, implement and .docx
alfred4lewis58146
 
Lecture 01 variables scripts and operations
Lecture 01   variables scripts and operationsLecture 01   variables scripts and operations
Lecture 01 variables scripts and operations
Smee Kaem Chann
 
Assignment2 A
Assignment2 AAssignment2 A
Assignment2 A
Mahmoud
 
Kaggle Otto Challenge: How we achieved 85th out of 3,514 and what we learnt
Kaggle Otto Challenge: How we achieved 85th out of 3,514 and what we learntKaggle Otto Challenge: How we achieved 85th out of 3,514 and what we learnt
Kaggle Otto Challenge: How we achieved 85th out of 3,514 and what we learnt
Eugene Yan Ziyou
 
Stacks
StacksStacks
Stacks
Acad
 
Machine learning Experiments report
Machine learning Experiments report Machine learning Experiments report
Machine learning Experiments report
AlmkdadAli
 
08 neural networks
08 neural networks08 neural networks
08 neural networks
ankit_ppt
 
Stata time-series-fall-2011
Stata time-series-fall-2011Stata time-series-fall-2011
Stata time-series-fall-2011
Feryanto W K
 
Unsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptxUnsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptx
FaridAliMousa1
 
17_00-Dima-Panchenko-cnn-tips-and-tricks.pptx
17_00-Dima-Panchenko-cnn-tips-and-tricks.pptx17_00-Dima-Panchenko-cnn-tips-and-tricks.pptx
17_00-Dima-Panchenko-cnn-tips-and-tricks.pptx
MahmoudAbuGhali
 
Stata Training_EEA.ppt
Stata Training_EEA.pptStata Training_EEA.ppt
Stata Training_EEA.ppt
selam49
 
Ad

More from vacagodx (19)

Emotion
EmotionEmotion
Emotion
vacagodx
 
Memory Games
Memory GamesMemory Games
Memory Games
vacagodx
 
Memory
MemoryMemory
Memory
vacagodx
 
Pain presentation
Pain presentationPain presentation
Pain presentation
vacagodx
 
Movement I
Movement IMovement I
Movement I
vacagodx
 
Movement II
Movement IIMovement II
Movement II
vacagodx
 
Animal Senses
Animal SensesAnimal Senses
Animal Senses
vacagodx
 
Brain Bee Facts
Brain Bee FactsBrain Bee Facts
Brain Bee Facts
vacagodx
 
The Teenage Brain
The Teenage BrainThe Teenage Brain
The Teenage Brain
vacagodx
 
Development
DevelopmentDevelopment
Development
vacagodx
 
Sex And The Brain
Sex And The BrainSex And The Brain
Sex And The Brain
vacagodx
 
The Aging Brain
The Aging BrainThe Aging Brain
The Aging Brain
vacagodx
 
Endocrine Control
Endocrine ControlEndocrine Control
Endocrine Control
vacagodx
 
Motivation
MotivationMotivation
Motivation
vacagodx
 
Evolution Of The Nervous System
Evolution Of The Nervous SystemEvolution Of The Nervous System
Evolution Of The Nervous System
vacagodx
 
Neuroanatomy (Chapter 7)
Neuroanatomy (Chapter 7)Neuroanatomy (Chapter 7)
Neuroanatomy (Chapter 7)
vacagodx
 
Neurotransmitters
NeurotransmittersNeurotransmitters
Neurotransmitters
vacagodx
 
Drugsandthe Brain Part5 Antianxiety Drugs
Drugsandthe Brain Part5 Antianxiety DrugsDrugsandthe Brain Part5 Antianxiety Drugs
Drugsandthe Brain Part5 Antianxiety Drugs
vacagodx
 
Drugsandthe Brain Part6 Stimulants
Drugsandthe Brain Part6 StimulantsDrugsandthe Brain Part6 Stimulants
Drugsandthe Brain Part6 Stimulants
vacagodx
 
Memory Games
Memory GamesMemory Games
Memory Games
vacagodx
 
Pain presentation
Pain presentationPain presentation
Pain presentation
vacagodx
 
Movement I
Movement IMovement I
Movement I
vacagodx
 
Movement II
Movement IIMovement II
Movement II
vacagodx
 
Animal Senses
Animal SensesAnimal Senses
Animal Senses
vacagodx
 
Brain Bee Facts
Brain Bee FactsBrain Bee Facts
Brain Bee Facts
vacagodx
 
The Teenage Brain
The Teenage BrainThe Teenage Brain
The Teenage Brain
vacagodx
 
Development
DevelopmentDevelopment
Development
vacagodx
 
Sex And The Brain
Sex And The BrainSex And The Brain
Sex And The Brain
vacagodx
 
The Aging Brain
The Aging BrainThe Aging Brain
The Aging Brain
vacagodx
 
Endocrine Control
Endocrine ControlEndocrine Control
Endocrine Control
vacagodx
 
Motivation
MotivationMotivation
Motivation
vacagodx
 
Evolution Of The Nervous System
Evolution Of The Nervous SystemEvolution Of The Nervous System
Evolution Of The Nervous System
vacagodx
 
Neuroanatomy (Chapter 7)
Neuroanatomy (Chapter 7)Neuroanatomy (Chapter 7)
Neuroanatomy (Chapter 7)
vacagodx
 
Neurotransmitters
NeurotransmittersNeurotransmitters
Neurotransmitters
vacagodx
 
Drugsandthe Brain Part5 Antianxiety Drugs
Drugsandthe Brain Part5 Antianxiety DrugsDrugsandthe Brain Part5 Antianxiety Drugs
Drugsandthe Brain Part5 Antianxiety Drugs
vacagodx
 
Drugsandthe Brain Part6 Stimulants
Drugsandthe Brain Part6 StimulantsDrugsandthe Brain Part6 Stimulants
Drugsandthe Brain Part6 Stimulants
vacagodx
 

Recently uploaded (20)

AI You Can Trust: The Critical Role of Governance and Quality.pdf
AI You Can Trust: The Critical Role of Governance and Quality.pdfAI You Can Trust: The Critical Role of Governance and Quality.pdf
AI You Can Trust: The Critical Role of Governance and Quality.pdf
Precisely
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Raffi Khatchadourian
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Financial Services Technology Summit 2025
Financial Services Technology Summit 2025Financial Services Technology Summit 2025
Financial Services Technology Summit 2025
Ray Bugg
 
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and MLGyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
Gyrus AI
 
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptxWebinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
MSP360
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
AI You Can Trust: The Critical Role of Governance and Quality.pdf
AI You Can Trust: The Critical Role of Governance and Quality.pdfAI You Can Trust: The Critical Role of Governance and Quality.pdf
AI You Can Trust: The Critical Role of Governance and Quality.pdf
Precisely
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Raffi Khatchadourian
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Financial Services Technology Summit 2025
Financial Services Technology Summit 2025Financial Services Technology Summit 2025
Financial Services Technology Summit 2025
Ray Bugg
 
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and MLGyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
Gyrus AI
 
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptxWebinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
MSP360
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 

Spike sorting-tutorial

  • 1. Spike sor t ing Tut or ial igo Quian Quir oga Rodr
  • 2. Problem: detect and separate spikes corresponding to different neurons
  • 3. Goals: • Algorithm for automatic detection and sorting of spikes. • Suitable for on-line analysis. • Improve both detection and sorting in comparison with previous approaches. Outline of the method: I - Spike detection: amplitude threshold. II - Feature extraction: wavelets. III - Sorting: Superparamagnetic clustering.
  • 4. This tutorial will show you how to do spike sorting using:  The wave_ clus graphic user interface.  The batch files Get_spikes and Do_clustering.
  • 5. Getting started… • Add the directory wave_clus with subfolders in your matlab path (using the matlab File/Set Path menu) • Type wave_clus in matlab to call the GUI. • Choose DataType simulator and load the file C_Easy1_noise01_short (in the subdir wave_clus/Sample_data/Simulator) using the Load button.
  • 6. It should look like this…
  • 7. Now you are ready to start playing with wave_ clus … • This is a 10 sec. segment of simulated data. • First, choose the option plot_average to plot the average spike shapes (+/- 1 std). Then choose to plot the spike features. • There may be some spikes unassigned in cluster 0. Go back to plot_all and use the Force button to assign them to any of the clusters. Better? • Now change the temperature. At t=0 you will get a single cluster, for large t’s you may get many clusters (if the parameter min_clus allows it). • Save the results using the Save clusters button. Load the output file times_C_Easy1_noise01.mat. Cluster membership is saved in the first column of the variable cluster_class. The second column gives the spike times. • You can also change the isi histogram plots using the max and step options. • Finally check the parameters used in the Set_parameters_simulation file in the wave_clus/Parametes_files (just type ‘open set_parameters_simulation’ in matlab).
  • 8. Playing with the spike features… • Load the file C_Difficult1_noise015 using again the DataType: Simulator. • Use the Spike features option
  • 9. You should get something like this…
  • 10. Seeing the clusters… • You may, however, get something different cause SPC is a stochastic clustering method. If you don’t get the 3 clusters, you may have to change the temperature. • The are 3 different spike shapes, but you don’t see three clear clusters. That’s because wave_clus plots in the main window the first 2 wavelet coefficients. • You can see the rest of the projections by clicking the Plot all projections button
  • 11. It would look like this… Clusters separate clearly in some projections
  • 12. Using Principal ComponentAnalysis • Now do the same using PCA. Open set_parameters_simulation and select features = ‘pca’ instead of features = ‘wav’ (don’t forget to set it back to ‘wav’ when you are done!). • Load again the data C_Difficult1_noise015.
  • 13. You should get something like this…
  • 14. Why PCA does so bad here? • As you see, there’s now only one single cluster (and for no temperature you can split it into 3!). You have just replicated the results of Fig. 8 of the Neural Computation paper (see reference at the end). • In this dataset the spike shapes are very similar, and their differences are localized in time. Do to its excellent time-frequency resolution, wavelets does much better. • Also, don’t forget that PCA looks for directions of maximum variance, which are not necessarily the ones offering the best separation between the clusters. Wavelets combined with the KS test (see paper) looks for the coefficients with multimodal distribution, which are very likely the ones offering the best separation between the clusters. • As a summary, in the Neural Computation paper it is shown for several different examples of simulated data a better performance of wavelets in comparison to PCA.
  • 15. You are now ready for real data! • You will now load a ~30’ multiunit recording from a human epilepsy patient. The data was collected at Itzhak Fried’s lab at UCLA. • Intracranial recordings in these patients (refractory to medication) are done for clinical reasons in order to evaluate the feasibility of epilepsy surgery. • Load the file CSC4 using the DataType: CSC (pre-clustered). Using the (pre-clustered) option you will load data that has already been clustered using the batch file Do_clustering_CSC. If you want to start from scratch use the CSC option. • Check the settings in the Set_parameters_CSC file. If you have a Neuralynx system you can already use the CSC and Sc options for your own data. • BTW, there should be a few cool publications coming up using these human data. If you’re interested check www.vis.caltech.edu/~rodri/publications in the near future or email me.
  • 16. It should look like this (if you use the Force button)…
  • 17. Playing with it… • Again, you can change the temperature, force the clustering, see the spike features, etc. Remember that everything is much faster is you use Plot_average instead of Plot_all. • You can also zoom into the data using the Tools menu. • You may also want to fix a given cluster by using the fix button. This option is useful for choosing clusters at different temperatures or for not forcing all the clusters together.
  • 18. One further example: • Sometimes clusters appear at different temperatures • In the following example we give a step- by-step example of a clustering procedure using the fix button
  • 19. Step 1: Fix cluster 2 at low T Step 3: Check features Step 2: Change to T2 Step 4: Fix clusters 2 and 3
  • 20. Step 5: Change to T3 Step 6: Re-check features Step 7: Push the Force button This is how the final clustering looks like! Note that after forcing the green cluster is not as clean as before.
  • 21. Clustering your own data… • Most likely you’ll end up using the ASCII DataType option for your data. • If you have continuous data, it should be stored as a single vector in a variable data, which is saved in a .mat file. Look for the file test.mat for an example. This data should be loaded using the ASCII option or the ASCII (pre-clustered) if you have already clustered it with the Do_clustering batch file. • If you have spikes that have already been detected, you should use the ASCII spikes option. The spikes should be stored in a matrix named spikes in a .mat file. The file test1_spikes.mat gives an example of the format. • You can set the optimal parameters for you data in the corresponding Set_parameters_ascii (or ascii_spikes) file. Most important, don’t forget to set the sampling rate sr! • Important note: To save computational time, if you have more than 30000 spikes in your dataset, by default these will be assigned by template matching with the batch clustering code (this can be changed in the set_parameters file). With the GUI, they will stay in cluster 0 and they should be assigned to the other clusters using the Force button. Note that
  • 22. Using the batch files… • There are two main batch files: Get_spikes (for spike detection) and Do_clustering (for spike sorting). Parameters are set in the first lines.They both go through all the files set in Files.txt. • Unsupervised results will be saved and printed (either in the printer or in a file), but can be later changed with the GUI. For changing results, you have to load the file with the (pre- clustered) option. The nice thing is that results for all temperatures are stored, so changing things with the GUI mainly implies storing a different set of results rather than doing the clustering again. Note that using the GUI for clustering (e.g. with the ASCII option) does not store the clustering results for future uses.
  • 23. You are now a clustering expert! • If you want further details on the method, check: Unsupervised spike sorting with wavelets and superparamagnetic clustering R. Quian Quiroga, Z. Nadasdy and Y. Ben-Shaul. Neural Computation 16, 1661-1687; 2004. • If you want to keep updated on new versions, give me some comments or feedback on how wave_ clus works with your data (I would love to hear about it), etc. please email me at: rodri@vis.caltech.edu • Good luck and hope it’s useful!
  翻译: