-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMS_init_split_data.m
More file actions
61 lines (50 loc) · 2.63 KB
/
Copy pathMS_init_split_data.m
File metadata and controls
61 lines (50 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
%% MS_initialize: split the all_data, events, and naris structs into invidivual subjects
tic
clear all; close all
restoredefaultpath
global PARAMS
if isunix
PARAMS.data_dir = '/global/scratch/ecarmichael/Multisite/'; % where to find the raw data
PARAMS.inter_dir = '/dartfs-hpc/rc/lab/M/MeerM/EC/temp/'; % where to put intermediate files
PARAMS.stats_dir = '/dartfs-hpc/rc/home/r/f00287r/MS/Stats/'; % where to put the statistical output .txt
PARAMS.code_base_dir = '/dartfs-hpc/rc/home/r/f00287r/Code/vandermeerlab/code-matlab/shared'; % where the codebase repo can be found
PARAMS.code_MS_dir = '/dartfs-hpc/rc/home/r/f00287r/Code/EC_Multisite'; % where the multisite repo can be found
else
PARAMS.data_dir = 'G:\JK_recordings\Naris\'; % where to find the raw data
PARAMS.inter_dir = 'G:\JK_recordings\Naris\Multisite\temp\'; % where to put intermediate files
PARAMS.stats_dir = 'G:\JK_recordings\Naris\Multisite\temp\Stats\'; % where to put the statistical output .txt
PARAMS.code_base_dir = 'D:\Users\mvdmlab\My_Documents\GitHub\vandermeerlab\code-matlab\shared'; % where the codebase repo can be found
PARAMS.code_MS_dir = 'D:\Users\mvdmlab\My_Documents\GitHub\EC_Multisite'; % where the multisite repo can be found
end
% log the progress
PARAMS.log = fopen([PARAMS.inter_dir 'MS_log.txt'], 'w');
% define subjects, phases,
PARAMS.Phases = {'pre', 'ipsi', 'contra', 'post'}; % recording phases within each session
PARAMS.Subjects = {'R102', 'R104', 'R107', 'R108', 'R112', 'R122', 'R123'}; %list of subjects
PARAMS.Sub_xpiri = {'R108', 'R112', 'R122', 'R123'}; % subjects with electrodes spanning the piriform cortex
PARAMS.all_sites = {'PL', 'IL', 'OFC', 'PiriO', 'NAc', 'PiriN', 'CG'};
% add the required code
addpath(genpath(PARAMS.code_base_dir));
addpath(genpath(PARAMS.code_MS_dir));
cd(PARAMS.data_dir) % move to the data folder
% formatting
set(groot, 'DefaultAxesTickLabelInterpreter', 'none')
set(groot, 'DefaultLegendInterpreter', 'none')
set(groot,'defaulttextinterpreter','none');
%% load and split the subjects
load([PARAMS.inter_dir 'MS_data.mat'])
load([PARAMS.inter_dir 'MS_naris.mat'])
load([PARAMS.inter_dir 'MS_events.mat'])
d_t = data;s
e_t = Events;
n_t = Naris;
%%
for iSub = 1:length(PARAMS.Subjects)
clear data Events Naris
data = d_t.(PARAMS.Subjects{iSub});
Events = e_t.(PARAMS.Subjects{iSub});
Naris = n_t.(PARAMS.Subjects{iSub});
save([PARAMS.inter_dir PARAMS.Subjects{iSub} '_Data'], 'data', '-v7.3')
save([PARAMS.inter_dir PARAMS.Subjects{iSub} '_Events'], 'Events', '-v7.3')
save([PARAMS.inter_dir PARAMS.Subjects{iSub} '_Naris'], 'Naris', '-v7.3')
end