Okay - so you've recorded some data. Great job! Now we're getting somewhere. Next step, loading it into MATLAB so we can make something of it. Here's how:
Use the script importRecording_guiSelect.m (attached below)
1. Open matlab
2. Create a new script in the editor.
3. Copy and paste the following into the blank script:
overwrite = 1;
base_path = fullfile(dropboxPath,'elnRats2');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% import raw data files
%% EDIT THIS: animal name, must match folder
animalID = 'CRE-95';
%% EDIT THIS:
% format:
% First column, folder within animal-name folder
% Second column, folder name created by OpenEphys with recording inside
prefixes = {...
'2017-08-20_CircleTrack', '2017-08-20_12-41-36'...
};
group = '140630_0930_140630_1100_140630_1651_CS'; %% EDIT THIS: if multiple recordings cluster cut as a group, this is the group name. Otherwise, replace with prefix name if no cluster cutting group.
manip = 'saline'; %% EDIT THIS: Assuming this is part of an experiment, this is the condition
dose = 0; %% EDIT THIS: Use as needed, dosage for drugs, light level for opto, etc
chOrd = [...
17 18 22 21 32 31 1 2 12 11 15 16,... % shank 1
44 43 19 20 25 26 3 4,... %shank 2
35 36 38 37 42 41 28 27 24 23 29 30 7 8,... % shank 3
];
%% EDIT THIS: Describe brain area targeted by each electrode. Add or del rows as needed.anatomy = {...
anatomy = {... % intan_ch > new_ch
's1_CA1_o',... % 17 > 1
's1_CA1_o',... % 18 > 2
's1_CA1_pry',... % 22 > 3
's1_CA1_pry',... % 21 > 4
's1_CA1_rad1',...% 32 > 5
's1_CA1_rad1',...% 31 > 6
's1_CA1_rad2',...% 1 > 7
's1_CA1_rad2',...% 2 > 8
's1_CA1_lm1',... % 12 > 9
's1_CA1_lm1',... % 11 > 10
's1_CA1_lm2',... % 15 > 11
's1_CA1_lm2',... % 16 > 12
's2_CA1_rad1',...% 44 > 13
's2_CA1_rad1',...% 43 > 14
's2_CA1_lm1',... % 19 > 15
's2_CA1_lm1',... % 20 > 16
's2_DG_mol',... % 25 > 17
's2_DG_mol',... % 26 > 18
's2_DG_hil',... % 3 > 19
's2_DG_hil',... % 4 > 20
's3_CA1_o',... % 35 > 21
's3_CA1_o',... % 36 > 22
's3_CA1_pry',... % 38 > 23
's3_CA1_pry',... % 37 > 24
's3_CA1_rad1',...% 42 > 25
's3_CA1_rad1',...% 41 > 26
's3_CA1_lm1',... % 28 > 27
's3_CA1_lm1',... % 27 > 28
's3_CA1_lm2',... % 24 > 29
's3_CA1_lm2',... % 23 > 30
's3_CA3',... % 29 > 31
's3_CA3',... % 30 > 32
's3_CA3',... % 7 > 33
's3_CA3',... % 8 > 34
};
ref = 1;
alignDataTimebase(animalID,prefixes,[],[],ref,'openephys');
outFiles = invivoImport('basePath',basePath,'overwrite',overwrite,'ratNames',{animalID},'prefixes',prefixes(:,1),'ephysFolder',prefixes(:,2),'group',group,'chOrd',chOrd,'numCh',length(chOrd));
dataSetPath = fullfile(dropboxPath,'scripts','projects','EvR_HPC_PDaxis','dataSets');
fnameSet_fname = [animalID,'_',prefixes{1}(1:10),'_',num2str(dose),'_',manip,'_fnameSet.mat'];
% create fnameSets
cmbObj_folder = fullfile('ratsEphys',animalID,[animalID,'_txtDataFiles'],'cmbObjsV2');
n = 1;
fnameSet(n).name = path2array(fullfile(cmbObj_folder,['CMBH_',prefixes{n}]));
fnameSet(n).sess_label = 'T-maze_Training';
fnameSet(n).dose = -1;
n=n+1;
[fnameSet.anatomy] = deal(anatomy);
[fnameSet.manip] = deal(manip);
save(fullfile(dataSetPath,fnameSet_fname),'fnameSet','group'); % saves group to fnameSet file
%runPreprocessData(fnameSet);
clear fnameSet
4. Go through the pasted code and make edits wherever it says %% EDIT THIS according to the instructions.