Saccade analysis

From biophysics
Revision as of 14:03, 22 January 2024 by Lof (talk | contribs) (Created page with "<a href="images/avhistogram.png" rel="rokbox(gallery)" title="Audiovisual Reaction time"><img src="images/avhistogram.png" alt="image" width="103" height="99" class="rt-image...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<a href="images/avhistogram.png" rel="rokbox(gallery)" title="Audiovisual Reaction time"><img src="images/avhistogram.png" alt="image" width="103" height="99" class="rt-image floatleft" /></a>

<a href="http://www.neural-code.com/index.php/panda/about-panda" target="_blank">PANDA</a> tutorial, for students and coworkers: This is a short and simple introduction on how to analyze saccades. Students will be introduced to reaction times, histograms, selection vectors, and cumulative probability.


Saccade data

After you have followed a <a href="http://www.math.toronto.edu/mpugh/primer.pdf" target="_blank">Matlab Introduction</a> course (or have read the first chapters of <a href="http://www.elsevier.com/books/matlab-for-neuroscientists/wallisch/978-0-12-374551-4" target="_blank">Matlab for Neuroscientists</a>), you may want to try your newly-found MatLab powers at analyzing actual data. The data for this tutorial can be found <a href="http://www.mbfys.ru.nl/staff/m.vanwanrooij/neuralcode/data/AVsaccade.mat">here</a>. The <a href="http://www.neural-code.com/index.php/panda/about-panda" target="_parent">PANDA</a> toolbox is also required, together with an <a href="http://www.mbfys.ru.nl/staff/m.vanwanrooij/neuralcode/data/index.m" target="_blank">index m-file</a>. The data for this tutorial is from one subject (BC), from a <a href="http://jn.physiology.org/content/88/1/438.long" target="_blank">study on audiovisual integration</a>.

Background

Specifically, this data is obtained from our study on <a href="http:jn.physiology.org/cgi/content/full/88/1/438" target="_blank">Auditory-Visual Interactions Subserving Goal-Directed Saccades in a Complex Scene</a>. In this study, subjects had to search for a light, a sound or both among a large number of distractor lights and sounds. The task was to respond as rapidly as possible by generating a voluntary rapid eye movement or saccade. We concluded that responses to a synchronously-presented light and sound followed a "best of both worlds" principle: they were as fast as auditory saccades, yet as accurate as visual saccades. What you will be doing in this tutorial, is determining whether subject BC was faster for audiovisual stimuli than for the auditory or visual stimuli, when the sound lagged the light by 100 ms.

Multisensory reaction times

First, you need to load the <a href="http://www.mbfys.ru.nl/staff/m.vanwanrooij/neuralcode/data/AVsaccade.mat">data</a> into the MatLab workspace. For this, you have to go to the directory where you stored the data and type:

cd('C:\DATA');
load('AVsaccade.mat');

This action will produce a matrix stored in the MatLab workspace called sac, which is 409 rows long and 9 colums wide. You can check this with the function whos, which will show all variables stored in the workspace.

>> whos
  
  Name        Size            Bytes  Class     Attributes
  
sac       412x7             32200  double 

SAC matrix

In each row of the sac matrix all saccade parameters of one particular saccade are stored. Vice versa, each column of the sac matrix represents one particular parameter for all saccades. The saccade parameters of each column can be obtained in MATLAB by typing:


>> index

  And [[http:www.mbfys.ru.nl/staff/m.vanwanrooij/Downloads/index.m|this m-file]] will display in the command window:
  Rows
  Each row contains saccade parameters for a single trial 
  Columns: 
  1 Trial Number 
  2 Saccade    Latency       [ms] 
  3 Saccade Amplitude        [deg] 
  4 Saccade direction        [deg] 
  5 Saccade Duration         [ms] 
  6 Peak Saccade Velocity    [deg/s]
  7 Modality					(1 - Visual
  2 - Auditory -6 dB
  3 - Auditory -18 dB
  4 - Audiovisual -6dB
  5 - Audiovisual -18 dB)
  
 

Below, the first ten rows of the sac matrix parameters are listed:

>> sac(1:10,:)
  
  ans =
  
  1.0000  224.0000   12.5494  295.7188   48.0000  458.1762    4.0000
  4.0000  310.0000   16.2406   46.2253   60.0000  449.6114    5.0000
  7.0000  354.0000   14.6940  271.6397   56.0000  431.0925    1.0000
  17.0000  484.0000   15.5194  211.1216   60.0000  431.1098    1.0000
  18.0000  290.0000   20.8366  196.1716   72.0000  420.6550    3.0000
  19.0000  258.0000   12.7184   96.0820   54.0000  389.2359    3.0000
  23.0000  358.0000   16.8306  244.8486   62.0000  455.7257    3.0000
  24.0000  322.0000   13.7645  290.5611   54.0000  417.3952    3.0000
  32.0000  248.0000   19.7672    3.1488   74.0000  422.2016    5.0000
  39.0000  306.0000   17.1490  288.7840   60.0000  497.6191    5.0000

To reiterate, saccades are listed in subsequent rows. From the first column (Trial Number according to index), you can see that you are missing some trials, as the numbers are not consecutive.

  1. Is this because the saccades are randomly placed within the matrix causing you to miss some trial numbers in the first ten rows (e.g. if you
    sort
    the trial numbers, do you find 412
    unique
    consecutive trial numbers from 1 to 412) or are some trials actually absent from the sac matrix?
  2. The second row contains saccade latency, or reaction time (in ms). This is the time it takes to respond with a saccade after the onset of the target. The last (7th) row tells you the modality of the target: 1 means the stimulus was visual, 2 and 3 are auditory stimuli, 4 and 5 are audiovisual targets. This column tells us that of the first ten saccades of the matrix, two were visually-guided, four were aurally-guided, and four were audiovisual. How many visual trials were there in total? And how many were auditory and visual?

Multisensory vs unisensory reaction time

Next, you have to determine which modality elicits the fastest responses. What is the mean reaction time for visual, auditory, and audiovisual responses? Make the same figure as plotted above.

  • use
    hist
    to make histograms of the reaction times for each modality (use selection vectors to select for each modality. Use 20-msec wide bins, starting at 0 and ending at 600).
  • Plot these histograms (probability vs reaction time), use red for visual ('r'), blue for auditory ('b'), and green for audiovisual ('g') responses in a single graph: hold on. Use correct labeling:
      xlabel
      ylabel
      legend
  • Note that on the y-axis probability is plotted, not the number of responses per reaction time bin (as obtained by hist). You have to normalize by the total number of saccades:
      length
      size
      sum

<a href="images/avhistogram.png" rel="rokbox(gallery)" title="Audiovisual Reaction time"><img src="images/avhistogram.png" alt="image" width="254" height="242" class="rt-image" title="Figure 1. Probability histogram of saccadic reaction times to visual, auditory or audiovisual targets. red - visual; blue - auditory; green - audiovisual"/></a>

Cumulative Probability

It is more informative to express the reaction time distributions as cumulative percentage probabilities on a probit scale (i.e. inverted gaussian) as a function of the reciprocal reaction time (-1/RT). In this manner, Gaussian distributions will appear as a straight line. Try this out yourself (or have a <a href="http://www.neural-code.com/index.php/tutorials/action/reaction-time/83-reciprobit-distribution" target="_blank">look here</a>).

And here is an example code that can create the graph as shown above. Try to write this code yourself first! Note the use of:

  • sub-functions
  • clear labeling of the m-file and the graphics
function webtutorial_sac
% WEBTUTORIAL_SAC
%
% An m-file producing the graph in the Saccade Introduction Tutorial</p>
% Main function

% First, let us clear data and plots
clear all
close all
clc

% Now let's load the data
% Make sure that you are in the correct directory!
% cd('C:\DATA');
load AVsaccade

%% Let's make a historgam
% Bins
x	= 0:20:600;

% Probability
PV	= getprob(sac,1,x);		% Visual
PA	= getprob(sac,2:3,x);	% Auditory
PAV	= getprob(sac,4:5,x);	% Audiovisual

%% And let's plot these distributions
figure(1)
plot(x,PV,'r','LineWidth',2);
hold on
plot(x,PA,'b','LineWidth',2);
plot(x,PAV,'g','LineWidth',2);
axis square
xlabel('Reaction time (ms)');
ylabel('Probability');
xlim([100 500])
legend('Visual','Auditory','Audiovisual');

function P = getprob(sac,mod,x)
% Sub-function
% P = GETPROB(SAC,MOD,X)
% Get reaction time probability distribution P for saccades SAC with
% modality MOD, at bins X.
sel = ismember(sac(:,7),mod);
N	= hist(sac(sel,2),x);
P	= N/sum(N);