Project philosophy : database for everything

Preamble

(for people who don't known anything about MySQL)

The core of OpenElectrophy is the use of a powerful and flexible way of handling data: databases.

In consideration of that, the user have to learn a simple language : SQL (Structured Query Language). This is not a programming language, it is just for query.

In OpenElectrophy absolutely everything is stored in a database : brut data, spike, oscillation, ... Forget files and list of files directory and sub sub sub directories.

In the basic principle of databases, everything is stacked disordered in different tables. Each table have fields (like columns in Excel). All tables are linked (joined) with keys. With that mechanism you can reordered your data as you want. Data are not ordered a priori for an priori analysis. Each query to the database is a different view of your data. Possibilities of querying are infinite so view are infinite. It sounds basic but this is the flexibility.

For OpenElectrophy the choice is MySQL, the most popular opensource database server. The number of free tools around MySQL is amazing. You can access this server from many classical programs : python, C, C++, matlab , R, openoffice, excel (via odbc) , statistica, ... all classical tools for data analysis in a lab. That means that you can still use your favourite language for analysing data, not only python. If you have a very specific test in R for spike discharge you can use it with minimal effort, no file convention, all is centralised in the database.

Database structure

Here is a figure representing the structure of the database in OpenElectrophy. Tables are linked with keys. It is a classical hierarchical 1-n relation database.

Table details

  • serie

This is a bulk of trial. For example trial recorded in the same location.

  • trial

This is a coherent recording of several data continuous or discrete : example 10 electrodes + animal position + respiration + event marker

  • electrode

This table contains each signal of each electrode from a trial with all information : frequency sample, label, number , ...

  • epoch

This table manages discrete event during a trial : trig, period of stimulation, state, ...

  • spiketrain

This table is difined as an ensemble of spike coming from an electrode. You can a several spiketrain for one electrode.

  • spike

This table contains all spike detected, this table is very big in number of line but eah line is quite short : time of spike and its extracted waveform.

  • oscillation

After analysis of the time frequency map, each oscillation is extracted. One line represent one oscillation with all its characteristics : begin, stop frequencies, phase, module, ...

SQL examples

Here are some examples not interesting for an electro-physiologist but to illustrate how flexible is SQL :

take all signal form electrode nb 5 in the range 2007-06-10 2007-07-12:

SELECT id_electrode
FROM electrode , trial
WHERE 
electrode.id_trial = trial.id_trial
AND electrode.num_channel =5
AND trial.thedatetime > 2007-06-10
AND trial.thedatetime < 2007-07-12

take all oscillation in the gamma range :

SELECT id_oscillation
FROM oscillation
WHERE 
oscillation.freq_max > 35
AND oscillation.freq_max < 90

Attachments