Data Analysis

The data recorded by Maestro during an experiment is saved in a custom-formatted binary data file. Analog data are compressed to reduce file size. Information about the experiment (trial, stimulus run, other settings) is included in the file so that analysis programs can identify what protocol was presented when the data was collected, reproduce the trajectories of targets animated during a trial, determine whether or not the subject successfully performed a task, and so on. The file's format has been augmented many times as Maestro has evolved, but always in a way that avoided "breaking" existing analysis code.

Of course, although a binary file format combined with compression techniques helps to reduce the size of the data file, it can induce headaches when it is time to retrieve and analyze the experimental data that was recorded. To import the data files into any other custom or off-the-shelf data analysis application requires a detailed understanding of the native file format and a significant coding effort. Over the years the Lisberger laboratory has developed a number of analysis tools that can read Maestro's data files and can perform certain basic analytical tasks that most researchers will frequently use.

Before the release of Maestro 1.0, the workhorse analysis program in the lab was the UNIX-based XWork. This program could read in Cntrlx-generated data files, display the recorded data in a trace window, and perform a number of different tasks, such as: spike sorting of the 50KHz electrode trace recorded by spikesPC; cut saccades from eye velocity traces; and construct post-stimulus time histograms (PSTH) across repeated presentations of a given trial. XWork stored user edits like saccade cuts and spike-sorting results in separate action records appended to the data file, thus preserving the raw data in its original form while providing a means of automatically regenerating the edit actions when the file was again loaded by the program.

While XWork was sufficient for certain needs, most researchers needed to perform their own unique analyses, often after initially processing the data files in XWork. Some wrote C/C++ programs to read in and process their data files, but over time everyone in the lab began to turn to the Matlab application suite for all their data analysis needs. Matlab provides a number of powerful analytic "toolboxes", and writing Matlab scripts is usually a much easier task than writing, compiling, and debugging a full-blown C/C++ program. Graduate students and post-docs in the lab developed a Matlab function to read in the contents of the Maestro data file into Matlab matrices, and then used that function repeatedly in their own scripts. They also developed MWork, a stripped-down, Matlab-based version of XWork.

Scott Ruffner, the lab's scientific programmer, eventually took over maintenance of the function that reads and parses the data file. Called readcxdata(), Scott rewrote it as a complied C MEX function, which dramatically improved its performance -- an important consideration when a Matlab script needs to digest hundreds or even thousands of individual trial data files. As Maestro and its data file format have evolved over the course of three major releases, Scott has updated readcxdata() so that it can parse data files generated by any version of Maestro or its predecessor Cntrlx. He has also introduced a number of other Matlab-based utilities to assist with some common analysis task, such as integrating the data streams of Maestro and the Plexon Multi-Acquisition Processor system. Finally, he developed and maintains JMWork, a Java application which has since replaced both XWork and MWork.

Explore this chapter further for more detailed information about the Maestro data file format, JMWork, and supported Matlab tools like readcxdata(). All tools are available for download here.