-
Notifications
You must be signed in to change notification settings - Fork 0
/
debuggingSession.m
69 lines (64 loc) · 2.17 KB
/
debuggingSession.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
% ------------------
% Get the path setup
% ------------------
addpath(genpath('~/Code/analysis'))
[animal, day, varargin] = deal('RY16', 36, {});
Opt = OPTARGS('unit', 'spikes');
Opt.shuffleStruct;
%Opt.shuffleStruct = []; % this makes program skip caching new shuffles, while Opt.nShuffle still acknowledges an ability to read out 50 of those cached items
Opt.analyses = [];
disp(newline)
disp("-------")
disp("Options")
disp("-------")
disp(Opt)
disp(newline)
disp(newline)
disp("-------")
disp("ShuffleOpt")
disp("-------")
disp(Opt.shuffleStruct)
% TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
%% HARD CODE : remove this
% TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
% -------------
% Get Unit data
% -------------
spikeDat = ndb.load(animal, Opt.unit, 'ind', day);
spikes = units.getRateMatrix(animal, day,...
'unit', Opt.unit,...
'taskFilter', Opt.taskFilter,...
'ploton',false,...
'dense', false,...
'cellFilter', Opt.cellFilter,...
'spikeData', spikeDat);
clear spikeDat
% ------------------------------------
% Load previous analyses if they exist
% ------------------------------------
if coding.file.exist(animal, day)
spikes = coding.file.load(animal, day, 'appendTo', spikes);
end
% ------------------------------------------------------------
% Pregenerate our shuffled indices we grab per neuron from beh
% (these shuffles are used for all analyses below)
% ------------------------------------------------------------
%if ~isempty(Opt.shuffleStruct)
% disp("Shuffling")
% tmp = struct('groups', [],...
% 'cacheToDisk', {{animal, day}},...
% 'shift', Opt.shift,...
% 'returnIndices', 1);
% Opt.shuffleStruct = util.struct.update(Opt.shuffleStruct, tmp); clear tmp;
% groupby = ["epoch", "period"]; % properties in behavior table to shuffle around
%beh = gbehavior.lookup(animal, [], day);
% units.shuffle.shuffleWithinConditions(beh, spikes, groupby, Opt.shuffleStruct);
%else
% disp("Skip shuffling")
%end
tmp = struct('groups', [],...
'cacheToDisk', {{animal, day}},...
'shift', Opt.shift,...
'query', Opt.behFilter,...
'returnIndices', 1);
Opt.shuffleStruct = util.struct.update(Opt.shuffleStruct, tmp); clear tmp;