Getting started:

An OpenElectrophy? GUI tutorial

This page aims to present a step by step example of how to use the OpenElectrophy? graphical user interface (GUI). Briefly, it shows an example of how to insert new data into the database, how to visualize and explore these new data, and finally how to detect events of interest like spikes and oscillations. More detailed information about all these steps can be found in the manual. Moreover, this page is an introduction to the GUI only, if you want an introduction on how to write analysis script with OpenElectrophy? Python classes, please refer to this page.

Before starting

Before starting you need to have Python and OpenElectrophy? properly installed on your computer. Then you also need to have access to a MySQL server with an account which gives you most of the standard rights to read and edit a new database schema. In this tutorial, we will assume the database schema is initially empty (but already created), but everything should work similarly with an already populated database.

Starting OpenElectrophy?

The standard way to start OpenElectrophy? is to open the file "start_OpenElectrophy.py" with your python interpreter. In linux, this is usually done by writing in a terminal:

python start_OpenElectrophy.py

In windows, you should right click on the file "start_OpenElectrophy.py" and select "Open with" and finally choose your Python interpreter.

This is the only place where we distinguish between windows and linux because once OpenElectrophy? is opened, everything is platform independent.

Logging to the MySQL database schema

When OpenElectrophy? starts, you are welcomed by the database logging panel:

There you have to enter the name of your SQL server, your login and password. In this example, the server is running on the same machine as OpenElectrophy? that is why the server is "localhost". Note that the "+" and "-" buttons in the top right corner are used to record in your personal folder the parameters you have entered and thus speed up further uses of OpenElectrophy?. This system is used throughout all the OpenElectrophy? GUI and further described in the manual.

Once your are logged to the MySQL server, you have to choose the database you are going to use in the drop-down menu. Indeed, a given MySQL account can have access to different databases (created for different types of experiments for example) but you can work with only one at the same time. In this example, the name of the database is "test_local_OE"

If the database you have selected is empty, you should now face the standard OpenElectrophy window with no data.

Inserting new data

When new data are recorded, the first step with OpenElectrophy? is to insert them in the database. OpenElectrophy? can import data from various types of file format. This process has been simplified has much as possible. For this tutorial we invite you to download our data sample files.

We first insert the two following files:

These files are in a raw binary format. Thus to import them you need to select in the OpenElectrophy? menu: File > Import ... > generic > raw binary file (*.raw)

In the following window you have to select the files to be inserted either by writing their full path or selecting them from a directory explorer (click on the button with "..."). You can select multiple files at the same time, their names will be separated by a semicolon. Then with this type of very generic format, you need to specify to OpenElectrophy? how the file is organized. For now you must specify there are 2 channels (in the "num channel" field), that the sampling frequency is 10000 (10kHz, in the "frequency" field), that channel 1 is a trigger (in "Trigger on analog channel" field). Finally check both rising edge and falling edge boxes. Your import window should now look like this:

Click on "OK" to perform the importation which should be very fast.

Exploring and visualizing stored data

The data are now stored in the database but to see them in OpenElectrophy? you need to refresh the knowledge OpenElectrophy? has of the database. For that click on the refresh button (the "rounded arrow" in the upper middle). A new line "serie id : 1" appeared in the "Hierarchic explorer". This explorer is a tree view of the database content. You can unfold the tree content by clicking on the boxes at the beginning of each line and get something like this:

You can observe that we have one serie, in which are present 2 trials corresponding to the 2 files we have imported. If the files were imported separately, they would be in two different series but this can later be modified from the GUI. In each trial you have one "electrode" and two "epoch". If you right-click on any of the line, you get a contextual menu which is object-dependent. For example, if you right click on any trial you have:

If you choose the "edit fields" options, you have access to the parameters related to the trial stored in the database and managed by OpenElectrophy?. You can simply modify any of these fields but you need to click on the "save to the database" button to get the new parameter values stored into the database.

Now let's plot the data. The simplest way is to select an electrode in the hierarchical tree view and then click on the button "Draw" on the upper right of the main window. You should get something like this:

The menu on the left of the plot allows to zoom and move into the graph in different ways, to save the graph and finally to close it.

Different types of plots can be simply made. The plots made when you hit the "Draw" button are selected by the checked boxes in the upper-right corner of the main window. Note that different types of plots are available for each type of object. For example, select the electrode object from the drop-down menu and checked only the "time-frequency" box:

If you first erase the first plot and then click again on the "Draw" button (still with an "electrode" selected in the tree view) you will get a time-frequency map in color scale computed with a Morlet wavelet. This looks like this:

Detecting oscillations

On the last time-frequency plot you observed nice red blobs around 60Hz. One of the main feature of OpenElectrophy? is to give a full interface to properly detect such signal oscillations and get their instantaneous phase, frequency and energy at each time point. All detected oscillations can then be stored in the database and retrieved later for visualization or analysis. For example we will detect the oscillations of our current electrode. For that, first right-click on the wanted "electrode" in the tree view to get the electrode contextual menu and select "detect oscillation":

You get the "detect oscillation window":

Here is a brief description of this window. You have on the left two tabs:

  • a "Scalogram" tab: to enter the parameters used to plot the time-frequency map shown on the right
  • an "Oscillation detection" tab: to enter the parameters used for the oscillation detection and make the detection

On the right of the window, the upper panel shows the list of oscillations already detected, and the two lower graphs are the electrode raw signal and its time-frequency representation.

We will now detect the oscillations in the "Oscillation detection" tab. First we have to choose adapted parameters. Three types of parameters exist:

  • the Morlet parameters: where do we search for oscillations and with which time-frequency precision?
  • the threshold parameters: above which level of energy we consider there is an oscillation (either an absolute value or relative to a reference period)
  • the clean parameters: options to remove very short oscillatory periods, group very close oscillations or discard the smallest when there are simultaneous oscillations

With the sample files we previously inserted, a correct set of parameters is given in the following picture:

Note the "nan" for the absolute threshold which means we are using the comparison to a reference period. In the time-frequency map, the reference period is delimited by the white rectangle, while the detection period is delimited by the pink rectangle. Once the correct parameters have been entered, click "Reset all, recompute and clean" to start the detection. If everything is fine, after a short time, you should see a list of oscillations appearing in the upper right panel and their representation on the two lower graphs. If you zoom on one of the given oscillation, you will see something like that:

On the time-frequency map you can observe that the oscillation follows the ridge of the energy blob. The computation of the signal wavelet transform of the signal at each point of this line gives the oscillation instantaneous phase, frequency and energy. The phase is used to plot the oscillation superimposed on the raw signal above.

To finish, you can save these oscillations (precisely you save the line in the time-frequency map) into the database by clicking on the "Save to database" button. For more details on oscillation detections, refer to the manual.

Detecting spikes

If you observed in details the raw signal of the previous electrode, you should have noticed very short and large amplitude events which are spikes recorded extracellularly. OpenElectrophy? provides the necessary tools to (almost) automatically detect these spikes (and sort them if multiple cells are recorded on the same electrode). To detect spikes on an electrode, you have to choose "Edit spike" in the electrode contextual menu:

Then you get the "Edit spike" window. This window has five tabs (on the left) corresponding to the five steps useful during spike detection.

The first tab allow to filter the signal before detection. Enter the parameters as in the following picture and click on the "Compute filtering" button to get the filtered signal (see next picture). Note that the upper drop-down menu offers different filtering methods.

The second step is the detection of events of interest. The standard method consist in detecting all events which move away from the mean of the signal by a certain number of times the standard deviation of the signal (another method with the signal median is available). The "sign" parameter determines if only positive, negative or both types of events are detected. Finally, note that a refractory period during which no other event is taken into account can be set. Again, enter the parameters as in the following picture and click on the "Compute detection" button to get:

The third step consists in projecting (or not) the waveform of detected events into a low dimensional space. In this example, we are using an independent component analysis in 3 dimensions:

Finally, the last step is to group the projected events in order to segregate spikes coming from different cells and remove false spikes. This is perhaps the trickiest part of spike detection and many clustering methods exist. OpenElectrophy? implements some of them but other exists and could be added in future versions ( : contact us for that!). In this example we are using a superparamagnetic clustering method. Basically it is a statistic method based on a serie of Monte Carlo simulations to make an undetermined number of clusters based on the closeness of the points and on the temperature parameter (low temperature means low number of big clusters while high temperature means high number of small clusters). Thus the choice of the temperature is crucial in this method. An advanced version called "sequential superparamagnetic clustering" which will check the stability of clusters across of a range of temperature is currently under development and should help to lower this constraint. Use the parameters in the following picture which should be correct with the tutorial data (do not forget it is a statistical method thus small difference can appear between two clicks on the "Compute clustering" button

Finally the last step is to record the detected events in the database. Consequently the last tab is a summary of the detected spikes with the necessary "save to database" button.

Note that before saving all the detected spike trains (one will be created for each line in the bottom list), you can remove or regroup some of them by using a contextual menu obtained with a right-click on any element of the list.

In this example, keep only the spike train with the largest number of spikes, all the others should be noise (but this may change if you use different temperature or methods in the "clustering" tab), and then click on the "save to database" button.

More advanced topics

TO BE COMPLETED...

Detecting spikes or oscillations on multiple electrodes with the "Detection" menu. This necessitates to write a SQL query.

Detecting spikes on a given electrode but for all trials in one serie simultaneously. This can be done from the serie contextual menu in the tree view. It is useful when the same electrode has recorded the same cells accross different trials. In this case, the raw signals from all trials of the given electrode (same num_channel) are concatenated and the spike detection is performed on the whole signal. At the end, in the database, spike trains are created for each trial but they are all related to the same cell object.

Attachments