Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and...

33
Samuel Garcia, Nicolas Fourcaud- Trocmé l Garcia, Nicolas Fourcaud-

Transcript of Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and...

Page 1: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Samuel Garcia, Nicolas Fourcaud-TrocméSamuel Garcia, Nicolas Fourcaud-Trocmé

Page 2: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Centre de Recherche en Neuroscience de Lyon (CRNL)Centre de Recherche en Neuroscience de Lyon (CRNL)

Samuel GarciaSamuel GarciaData processing Engineer position at CNRSData processing Engineer position at CNRS

Lab thematics : olfactory and auditory system.Lab thematics : olfactory and auditory system.

Page 3: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

● Intro: electrophysiologie Intro: electrophysiologie● Neo : Data format and data representation Neo : Data format and data representation● View on OpenElectrophy project View on OpenElectrophy project● OpenElectrophy time frequency OpenElectrophy time frequency● OpenElectrophy spikesorting : framework and UI OpenElectrophy spikesorting : framework and UI

Page 4: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

breftrès trèsElectrophysiologie en Electrophysiologie en très très

bref

Page 5: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

breftrès trèsElectrophysiologie en Electrophysiologie en très très

bref

Page 6: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy
Page 7: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

NEO project:NEO project:

2 goals:2 goals:

● Data object representation for electrophysiology -> precise set of objects Data object representation for electrophysiology -> precise set of objects● File Reader (and write for some) → replacement of neuroshare in pure python File Reader (and write for some) → replacement of neuroshare in pure python

Features:Features:● Developed in neuralensemble group involving 4 labs at the moment. Developed in neuralensemble group involving 4 labs at the moment.● Python written Python written

Utility :Utility :● a common nomenclature for naming object we deal with (SpikeTrain, AnalogSignal,RecordingChannel, …) a common nomenclature for naming object we deal with (SpikeTrain, AnalogSignal,

RecordingChannel, …)● Multi platform file Reader (which neuroshare is not) Multi platform file Reader (which neuroshare is not)

Version 0.2.1 : nov 2012Version 0.2.1 : nov 2012

http://neuralensemble.org/trac/neohttp://neuralensemble.org/trac/neo

Page 8: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Liste des format defichiers:Liste des format defichiers:

●AlphaOmegaIOAlphaOmegaIO●AsciiSignalIOAsciiSignalIO●AsciiSpikeTrainIOAsciiSpikeTrainIO●AxonIOAxonIO●BlackrockIOBlackrockIO●ElanIOElanIO●HDF5IOHDF5IO●KlustakwikIOKlustakwikIO●MicromedIOMicromedIO●NeoMatlabIONeoMatlabIO●NeuroExplorerIONeuroExplorerIO●PickleIOPickleIO●PlexonIOPlexonIO●PyNNIOPyNNIO●RawBinarySignalIORawBinarySignalIO●Spike2IOSpike2IO●TdtIOTdtIO●WinEdrIOWinEdrIO●WinWcpIOWinWcpIO

Page 9: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy
Page 10: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy
Page 11: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy
Page 12: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy
Page 13: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

2 levels users2 levels users

Simple and intuitive userinterfaceSimple and intuitive userinterface

A lower script level with python.A lower script level with python.

Page 14: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Goal : pre processing for:Goal : pre processing for:

Spike sortingSpike sorting

LFP oscillationsLFP oscillations

Page 15: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Software architectureSoftware architecture

User interface local clientUser interface local client

OpenElectrophy toolboxOpenElectrophy toolbox

Storage : sqlalchemyStorage : sqlalchemy

ExperimentalistuserExperimentalistuser

AnalysisuserAnalysisuser

Specific scriptsSpecific scripts

Spike sortingSpike sortingframeworkframework

OscillationOscillationanalysisanalysisNeo IONeo IO

Algorithmin:Algorithmin:MatlabMatlabC/C++C/C++RRPythonPython

PythonPythonPlexonPlexonNeuroExpNeuroExpSpike2Spike2TdTTdTAxonAxonElphyElphyAlphaOmegaAlphaOmega

Page 16: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Comment sauver un vecteur ou matrice ouun cube dans une table SQL ?Comment sauver un vecteur ou matrice ouun cube dans une table SQL ?

Utilisation d'un ''Mapper''Utilisation d'un ''Mapper''

SQLAlchemySQLAlchemy

ORM python compatible (SQLite, MySQL, Oracle, PQSQL, …)ORM python compatible (SQLite, MySQL, Oracle, PQSQL, …)

Une table SQL = Une class PythonUne table SQL = Une class Python

Un champ SQL = Un attribut de la classUn champ SQL = Un attribut de la class

Dans python les tableau N dimentionel → numpyDans python les tableau N dimentionel → numpy

Numpy = calcul vectoriel de matlabNumpy = calcul vectoriel de matlab

Chaque numpy.ndarray = 3 champs dans la table SQL:Chaque numpy.ndarray = 3 champs dans la table SQL:● Buffer → BLOBBuffer → BLOB● Shape (dimensions) → StrShape (dimensions) → Str● Dtype (taille de chaque element) → StrDtype (taille de chaque element) → Str● Moteur de compression → StrMoteur de compression → Str

Page 17: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Module temps fréquenceModule temps fréquence

Page 18: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Différents rythmes oscillatoires dans le cerveau:Différents rythmes oscillatoires dans le cerveau:

● Gamma 25 - 70Hz Gamma 25 - 70Hz● Beta 15 – 30 Hz Beta 15 – 30 Hz● Alpha 2-10Hz Alpha 2-10Hz

Reflet d'assemblé de neurones.Reflet d'assemblé de neurones.

Page 19: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Rappel :Rappel :Carte temps fréquence de morletCarte temps fréquence de morlet

Page 20: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Carte temps fréquence de morlet :principe de calculCarte temps fréquence de morlet :principe de calcul

OndeletteOndeletteSignalSignal

ConvolutionConvolutionmulti échellemulti échelle

carte complexe (module + phase)= = carte complexe (module + phase)

ModuleModule

Page 21: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Principe de la méthode : Étape 1Principe de la méthode : Étape 1

Carte temps fréquences sur le signalCarte temps fréquences sur le signalsous échantillonné : à 2*Fmaxsous échantillonné : à 2*Fmax

Page 22: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Principe de la méthode : Étape 2Principe de la méthode : Étape 2

Calcul dans un voisinage du max la ligne de crête temps fréquenceCalcul dans un voisinage du max la ligne de crête temps fréquencesur le signal haute fréquence échantillonnagesur le signal haute fréquence échantillonnage

Résultat : ligne temps fréquence complexe (module et phase)Résultat : ligne temps fréquence complexe (module et phase)

Page 23: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Application : calage des spikes sur la phase des oscillationsApplication : calage des spikes sur la phase des oscillations

Page 24: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Application : afficher les oscillations en timelineApplication : afficher les oscillations en timelineavec code couleuravec code couleur

Page 25: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Spike sortingSpike sorting

Page 26: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Source:scolarpediaSource:scolarpedia

Page 27: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Spikesorting pipeline : multi method for multi stepsSpikesorting pipeline : multi method for multi steps

FilteringFiltering

DetectionDetection

Features extractionFeatures extraction

ClusteringClustering

FFT-basedFFT-basedSliding medianSliding medianButterworthButterworthBesselBessel

Abs ThresholdAbs ThresholdStd ThresholdStd ThresholdMedian ThresholdMedian Threshold(K-TEO)(K-TEO)(optimal filter)(optimal filter)

ICAICAPCAPCAHaar waveletHaar wavelet(laplacian)(laplacian)

K-MeanK-MeanSuperparamegneticSuperparamegneticAffinity propagationAffinity propagationGaussian mixtureGaussian mixtureBagged clusteringBagged clustering

Waveform alignmentWaveform alignment Peak alignmentPeak alignmentThresh alignmentThresh alignment(Over sampling)(Over sampling)(sinc) (sinc)

Page 28: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Goal and features :Goal and features :● ( that hardly script ) Give access good methods to experimentalist Give access good methods to experimentalist ( that hardly script )

● A bridge algorithms and good UI A bridge algorithms and good UI● Mono-electrode, tetrode, N-trode Mono-electrode, tetrode, N-trode● Multi segment auto concatenation Multi segment auto concatenation● GGOBI-like viewer integrated GGOBI-like viewer integrated● Several method for each steps Several method for each steps● Object implementation = UI or/and script manipulation Object implementation = UI or/and script manipulation

Main idea : the user can choose the best method by himself.Main idea : the user can choose the best method by himself.

Page 29: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

SpikeSorting UISpikeSorting UI

Page 30: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

The user can easy try several methods for each stepsThe user can easy try several methods for each steps

Page 31: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

User custom layout:User custom layout:●● Widgets for manual clustering Widgets for manual clustering●● Widgets for validation Widgets for validation

Page 32: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

What OpenElectrophy can offer to community :What OpenElectrophy can offer to community :

● Intuitive GUI for experimentalists Intuitive GUI for experimentalists● Easy way to open multiple formats (neo) Easy way to open multiple formats (neo) ● The neo data representation could be a common nomenclature for spike sortingmethods benchmark. The neo data representation could be a common nomenclature for spike sorting

methods benchmark.● The developer friendly framework allow easy implementation of new methods The developer friendly framework allow easy implementation of new methods

What we plan to do :What we plan to do :

● Implement as many as possible open sourced algorithms Implement as many as possible open sourced algorithms● Improve the UI. Improve the UI.

Page 33: Trocmé Samuel Garcia, Nicolas Fourcaud-€¦ · Intro: electrophysiologie Neo : Data format and data representation View on OpenElectrophy project OpenElectrophy time frequency OpenElectrophy

Pas de conclusion mais demo sur demandePas de conclusion mais demo sur demande