Beauchamp:ECogAnalysis: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
==Processing Data from Ping Sun==
==Processing Data from Ping Sun==
First, get the data files from Ping. There is one data file per channel, which will be entitled fileName_ch#.mat (i.e. "JPDatafile006_ch15.mat", where JPDatafile006 is fileName and 15 is the channel number in question). In addition, a time stamp file is needed, named fileName_timeStamp.mat (i.e. JPDatafile006_timeStamp.mat). Once these files are uploaded to the server, one must create a setting file called OBJSettingForAll_new.mat. This is done by the generateOBJSetting_new.m. This setting file will encode the information particular to that subject's experiment. Of particular importance to edit is the list of channel names (S.chanDesList), as this changes for every patient. For example, for JPDatafile006, the channel list is:
Please note, all work with the ECoG data will be done in MATLAB. First, get the data files from Ping. There is one data file per channel, which will be entitled fileName_ch#.mat (e.g. "JPDatafile006_ch15.mat", where JPDatafile006 is fileName and 15 is the channel number in question). In addition, a time stamp file is needed, named fileName_timeStamp.mat (e.g. JPDatafile006_timeStamp.mat). Once these files are uploaded to the server, one must create a setting file in MATLAB called OBJSettingForAll_new.mat. This is done by the generateOBJSetting_new.m. This setting file will encode the information particular to that subject's experiment. Of particular importance to edit is the list of channel names (S.chanDesList), as this changes for every patient. For example, for JPDatafile006, the channel list is:


<code>S.chanDesList = {'G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9', 'G10', 'G11', 'G12', 'g13', 'G14', 'G15', 'G16', 'G17', 'G18', 'G19', 'G20', 'G21', 'G22', 'G23', 'G24', 'G25', 'G26', 'G27', 'G28', 'G29', 'G30', 'g31', 'G32', 'AF1', 'AF2', 'AF3', 'AF4', 'AIT1', 'AIT2', 'AIT3', 'AIT4', 'MIT1', 'MIT2', 'MIT3', 'MIT4', 'PIT1', 'PIT2', 'PIT3', 'PIT4', 'SPLT1', 'SPLT2', 'SPLT3', 'SPLT4', 'SPLT5', 'SPLT6', 'IPLT1', 'IPLT2', 'IPLT3', 'IPLT4', 'IPLT5', 'IPLT6', 'IPLT7', 'IPLT8', 'EKG1', 'EKG2'};</code>
<code>S.chanDesList = {'G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9', 'G10', 'G11', 'G12', 'g13', 'G14', 'G15', 'G16', 'G17', 'G18', 'G19', 'G20', 'G21', 'G22', 'G23', 'G24', 'G25', 'G26', 'G27', 'G28', 'G29', 'G30', 'g31', 'G32', 'AF1', 'AF2', 'AF3', 'AF4', 'AIT1', 'AIT2', 'AIT3', 'AIT4', 'MIT1', 'MIT2', 'MIT3', 'MIT4', 'PIT1', 'PIT2', 'PIT3', 'PIT4', 'SPLT1', 'SPLT2', 'SPLT3', 'SPLT4', 'SPLT5', 'SPLT6', 'IPLT1', 'IPLT2', 'IPLT3', 'IPLT4', 'IPLT5', 'IPLT6', 'IPLT7', 'IPLT8', 'EKG1', 'EKG2'};</code>
Line 6: Line 6:
As long as the same experiment is being done and the equipment doesn't change, nothing else should need to be edited. If it were to change, examine items such as S.images, S.imageNames, S.sampleHZ, etc. Additional comments can be found on the code itself.
As long as the same experiment is being done and the equipment doesn't change, nothing else should need to be edited. If it were to change, examine items such as S.images, S.imageNames, S.sampleHZ, etc. Additional comments can be found on the code itself.


==Analyzing Data==
==LFP Traces and Power Spectra==
To analyze the data, the first step is to organize the raw analog traces into a structure relating to the trial number. This is done by the function doLFPvoltage.m. This function has three outputs:  
 
#traces, a 16x20x6000 matrix containing the raw LFP traces for each trial. The format is image X trial X time point.
===doLFPvoltage===
#avgPlots, a 16x6000 matrix containing averaged LFP traces for each stimulus type. This variable is just traces with the mean taken across the second dimension. The format is image X time point.  
To analyze the data, the first step is to organize the raw analog traces into a structure relating to the trial number. This is done by the function doLFPvoltage.m. To run analysis on all channels and save the data:
#n, a matrix containing the number of trials found for each image. The format is image X number of trials.
#Find the directory you wish to save the data in. The best way to do this is to create a new folder for each type of data with the filename (e.g. JPDatafile006 LFPvoltage). Make this the current directory in MATLAB.
#type the following into the MATLAB command window:
<code>for c = 1:<number of channels>
doLFPvoltage('<fileName>', c, 'none', 1);
c
end</code>
#The previous step can take many minutes, depending on the number of channels. After it has gone through all channels, be sure to update the path so that these files are accessible to other functions as the analysis continues.
 
===doPowerSpectra===
The next step of the analysis is to calculate Power Spectra. This is done by doPowerSpectra.

Revision as of 11:58, 29 July 2010

Processing Data from Ping Sun

Please note, all work with the ECoG data will be done in MATLAB. First, get the data files from Ping. There is one data file per channel, which will be entitled fileName_ch#.mat (e.g. "JPDatafile006_ch15.mat", where JPDatafile006 is fileName and 15 is the channel number in question). In addition, a time stamp file is needed, named fileName_timeStamp.mat (e.g. JPDatafile006_timeStamp.mat). Once these files are uploaded to the server, one must create a setting file in MATLAB called OBJSettingForAll_new.mat. This is done by the generateOBJSetting_new.m. This setting file will encode the information particular to that subject's experiment. Of particular importance to edit is the list of channel names (S.chanDesList), as this changes for every patient. For example, for JPDatafile006, the channel list is:

S.chanDesList = {'G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9', 'G10', 'G11', 'G12', 'g13', 'G14', 'G15', 'G16', 'G17', 'G18', 'G19', 'G20', 'G21', 'G22', 'G23', 'G24', 'G25', 'G26', 'G27', 'G28', 'G29', 'G30', 'g31', 'G32', 'AF1', 'AF2', 'AF3', 'AF4', 'AIT1', 'AIT2', 'AIT3', 'AIT4', 'MIT1', 'MIT2', 'MIT3', 'MIT4', 'PIT1', 'PIT2', 'PIT3', 'PIT4', 'SPLT1', 'SPLT2', 'SPLT3', 'SPLT4', 'SPLT5', 'SPLT6', 'IPLT1', 'IPLT2', 'IPLT3', 'IPLT4', 'IPLT5', 'IPLT6', 'IPLT7', 'IPLT8', 'EKG1', 'EKG2'};

As long as the same experiment is being done and the equipment doesn't change, nothing else should need to be edited. If it were to change, examine items such as S.images, S.imageNames, S.sampleHZ, etc. Additional comments can be found on the code itself.

LFP Traces and Power Spectra

doLFPvoltage

To analyze the data, the first step is to organize the raw analog traces into a structure relating to the trial number. This is done by the function doLFPvoltage.m. To run analysis on all channels and save the data:

  1. Find the directory you wish to save the data in. The best way to do this is to create a new folder for each type of data with the filename (e.g. JPDatafile006 LFPvoltage). Make this the current directory in MATLAB.
  2. type the following into the MATLAB command window:

for c = 1:<number of channels> doLFPvoltage('<fileName>', c, 'none', 1); c end

  1. The previous step can take many minutes, depending on the number of channels. After it has gone through all channels, be sure to update the path so that these files are accessible to other functions as the analysis continues.

doPowerSpectra

The next step of the analysis is to calculate Power Spectra. This is done by doPowerSpectra.