-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrunTemporalAnalysis.m
123 lines (82 loc) · 2.44 KB
/
runTemporalAnalysis.m
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
clear all %#ok<CLALL>
%% 1) Set up subject
% Main analysis directory
sParams.root = ...
'S:\OneDrive\Gareth\Current\AC\fBehaviouralData\NeuralAnalysis';
cd(sParams.root);
% Box
sParams.box = 'Nellie';
% Subject
% sParams.fName = 'Twister';
% sParams.subject = 'Suarez';
sParams.subject = 'Snow';
% sParams.subject = 'Beryl';
% sParams.level = [8, 9, 10];
% sParams.level = 8;
sParams.level = [10, 11];
% The rest
sub = Subject(sParams);
% Sync
sub.syncSubject();
%% Find sessions
reImport = true;
sub = sub.importSessions(reImport);
% Plot summary
sub.sessions = sub.sessions.summary();
%% Import sessions
% Import behavioural data
% Try to import and preprocess neural data, if data is available
% Limit for debugging
lim = 0;
if lim
sub.sessions.sessions = sub.sessions.sessions(1:lim,:);
sub.sessions.nS = lim;
end
% Import
reImport = true;
forceNeural = false; % Force prcoessing of neural data from this stage.
sub.sessions = sub.sessions.importData(reImport, forceNeural);
%% Analyse individual sessions
% Do behavioural analysis (using BehavAnalysis)
% Do neural analysis (PSTH etc.) (Using NeuralAnalysis)
force = false;
sub.sessions.analyseBehav(force)
sub.sessions.analyseNerual(force)
%% Create combined sessions - level 9/10/11
% Join on dayIDs
level = 10;
sub = sub.importComboSessions('DID', level);
% Analyse combine sessions
force = true;
sub.comboSessions.DID = sub.comboSessions.DID.analyseBehav(force);
sub.comboSessions.DID = sub.comboSessions.DID.analyseNerual(force);
%% Create combined sessions - level 11
% Join on seedIDs
level = 11;
sub = sub.importComboSessions('SID2', level);
% Analyse combine sessions
force = true;
sub.comboSessions.SID2 = sub.comboSessions.SID2.analyseBehav(force);
%% Create combo sessions using all
level = 11;
sub = sub.importComboSessions('All', level);
sub.comboSessions.All = sub.comboSessions.All.analyseBehav(force);
%% Run comparision between combo sessions
% All vs SIDs2
% Do comps
sub.comboSessions.All = ...
sub.comboSessions.All.compareSessions(sub.comboSessions.SID2);
% Plot summary
sub.comboSessions.All.plotSummaryComps
%% Run comparision between combo sessions
% SIDs2 vs SIDs2
close all
sub.comboSessions.SID2 = ...
sub.comboSessions.SID2.compareSessions(...
sub.comboSessions.SID2, false);
%% Plot summary deltas
close all
sub.comboSessions.SID2.plotSummaryCompsDeltas
%% Plot summary
close all
sub.comboSessions.SID2 = sub.comboSessions.SID2.plotSummaryComps;