Beauchamp:iEEGWorkflow

From OpenWetWare
Jump to navigationJump to search
Brain picture
Beauchamp Lab




To search for things on the wiki, use Google's site search feature. For instance, to find an Experiment Sheet, type

 site:openwetware.org/wiki/Beauchamp ExperimentSheet

Overview

This page describes the iEEG workflow as of October 2020.

Steps for iEEG Data Files

1. Data is placed on the server in the folder

  /Volumes/ecog/ECoG_Data/YDJDatafile/DATA/

2. The raw data from the BlackRock system is saved into a set of five files, e.g.

YDJDatafile019.ccf
YDJDatafile019.nev
YDJDatafile019.ns3
YDJDatafile019.ns5
YDJDatafile019.ns6

The ".nev" file is the metadata. The ".ns3" and ".ns5" are the voltage electrode recordings. The ".ns6" file contains the microelectrode data. These file should be located in a folder corresponding to the recording block number, e.g.

/Volumes/ecog/ECoG_Data/YDJDatafile/DATA/019

If they are not in such a folder, move them there.

3. These files are converted to one ".mat" file that contains data from all channels, e.g.

YDJDatafile022_rawData.mat

4. It is possible for this conversion to happen automatically, for instance, by modifying the stimulus presentation program.

5. If the conversion does not happen automatically, it must be done manually using a one-piece script as followed: First, open Matlab. Change to the code directory

cd /Volumes/ecog/Foster_Lab/CODE/MASTER/BASICS

OR add the code directory to the path:

 addpath /Volumes/ecog/Foster_Lab/CODE/MASTER/BASICS

Second, call the script (Call_convert_code_server_256.m): The function takes a subj name and block numbers(s), e.g. subj_name ='YBY'; blocknums=[12:23];

 Call_convert_code_server_256('YDJ',19);

6. Alternately (if the script somehow does not work), you can also convert them PURE MANUALLY:

openNSx('YDJDatafile019.ns3','p:double');
openNSx('YDJDatafile019.ns5','p:double');
openNSx('YDJDatafile019.ns6','p:double');

Then save them out:

save(YDJDatafile019_rawData', 'NS3', 'NS5', 'NS6','-v7.3');

7. Next, split the converted .mat file into individual channel files. Each channel has one .mat file after splitting. Use this one-piece code to do the split (/Volumes/ecog/Foster_Lab/CODE/MASTER/BASICS/ecog_rawData2mat.m):

First, check how many channels/electrodes are active in this subject, this can be found in the subject folder (e.g.):

/Volumes/ecog/ECoG_Data/YDJDatafile/INFO/YDJ_montage.xlsx

Call the command in matlab:

ecog_rawData2mat('YDJ',019,121)

Where YDJ is the subject code. In this folder, the data is organized by recording blocks. '019' is the block number, and '121' is the channel number.

Now the individual ".mat" files are automatically stored in: /Volumes/ecog/ECoG_Data/YDJDatafile/DATA/019/Indiv_chans

8. LAST STEP: Copy results of conversion into RAVE directory tree, e.g.

/Volumes/OneDrive/data/rave_data/raw/YDJ/019

9. Go to RAVE and begin the preprocessing workflow.

Steps for Creating Epoch Files

Ingredients:

1. Output from Psychtoolbox log files in filename

YDJ_-4dB_run1_log.txt

one line is

4,movie,hoist_kristen_a.mp4,21.051

2. Transcribed results from subject responses sample filename

YDJ_Responses-4dB.xlsx

This is used to decide what stimulus type each trial is and whether the subject's response was correct or not.

Output: 1. Epoch file in the meta subdirectory in filename

epoch_YDJ.csv

sample line

006,156.0239333,3,HITCH_JAMES,AnV0,,156.7799333,157.3839333,157.9649333

For instance,

epoch_YDJ_vis_onset.csv

Is used with the RAVE automatic photodiode detection script to measure stimulus onset.

https://openwetware.org/wiki/RAVE:Epoching

This can be combined with the behavioral data to make the epoch_YDJ.csv file using the R script

augment_epoch_files.R