-
Notifications
You must be signed in to change notification settings - Fork 0
/
processRunsAsOne.m
300 lines (285 loc) · 19.8 KB
/
processRunsAsOne.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
function [ runAnalysisInputs ] = processRunsAsOne(runList, varargin)
%processRunsAsOne merges the data structures that processRun passes to
%runAnalyses from multiple runs that should be treated as one.
% - assumes that all stimuli are described in one stimulusParamFile
% - adds'RUN_BREAK' event at beginning of second and following runs
% - assumes that unit numbering is constant; unsorts any unit numbers
% that appear in some but not all trials.
% - runList: runs to analyze, as cell array of runNum strings, e.g. {'002';'003'}
% - varargin: name-value pairs:
% 'analysisParamSource': full path to a mat file, or handle to analysisParamFileBuilder;
% default is to use buildAnalysisParamFile for all params except dateSubj and runNum
% 'unitsIdentical': logical, if true, don't check unit assignment consistency
% 'savePreprocessed': logical, if true, save the preprocessed combined output data structures
% Notes and todo:
% - currently overwrites the analysisParams file for each constituent run
% - cannot currently combine an RF map run with a non-RF map run
for argPair_i=1:length(varargin)/2
argName = varargin{1+2*(argPair_i-1)};
argVal = varargin{2+2*(argPair_i-1)};
if strcmp(argName, 'analysisParamSource')
if isstring(argVal)
analysisParamFilename = argVal;
else
analysisParamFilename = argVal();
end
elseif strcmp(argName, 'unitsIdentical')
unitsIdentical = argVal;
end
end
if ~exist('analysisParamFilename', 'var')
analysisParamFilename = buildAnalysisParamFile();
end
if ~exist('unitsIdentical','var')
unitsIdentical = 0;
end
load(analysisParamFilename);
% resolve unit mapping:
% - assume all units that appear with same number are the same
% - unsort units that appear in some but not all runs
if ~unitsIdentical
unitsToInclude = cell(length(ephysParams.spikeChannels),1);
for run_i = 1:length(runList)
spikeFilename = sprintf('%s/%s/%s%s.nev',ephysVolume,dateSubject,dateSubject,runList{run_i});
NEV = openNEV(spikeFilename,'read','nosave','noparse'); %note: add param 'report' for verbose
for channel_i = 1:length(ephysParams.spikeChannels)
unitNumbers = unique(NEV.Data.Spikes.Unit(NEV.Data.Spikes.Electrode == ephysParams.spikeChannels(channel_i)));
if channel_i == 1
unitsToInclude{channel_i} = unitNumbers;
else
unitsToInclude{channel_i} = intersect(unitsToInclude{channel_i},unitNumbers);
ephysParams.unitsToUnsort{channel_i} = union(ephysParams.unitsToUnsort{channel_i}, setdiff(unitsToInclude{channel_i}, unitNumbers));
end
end
end
end
%%% set paths and directories for combined run%%%
runNum = '';
for run_i = 1:length(runList)
runNum = strcat(runNum, runList{run_i});
if run_i < length(runList)
runNum = strcat(runNum,'-');
end
end
finalOutDir = sprintf('%s/%s/%s/%s/',outputVolume,dateSubject,analysisLabel,runNum);
finalAnalysisParamFilename = strcat(finalOutDir,analysisParamFilenameStem);
finalPreprocessedDataFilename = strcat(finalOutDir,preprocessedDataFilenameStem);
%
if ~exist(finalOutDir,'dir')
mkdir(finalOutDir);
end
outDir = finalOutDir; %#ok
analysisParamFilename = finalAnalysisParamFilename; %#ok
preprocessedDataFilename = finalPreprocessedDataFilename;
save(finalAnalysisParamFilename);
for run_i = 1:length(runList)
runNum = runList{run_i};
analysisParamFilename = strcat(finalOutDir,'run',runNum,analysisParamFilenameStem);
analogInFilename = sprintf('%s/%s/%s%s.ns2',ephysVolume,dateSubject,dateSubject,runNum); %#ok
lfpFilename = sprintf('%s/%s/%s%s.ns5',ephysVolume,dateSubject,dateSubject,runNum);
spikeFilename = sprintf('%s/%s/%s%s.nev',ephysVolume,dateSubject,dateSubject,runNum); %note that this file also contains blackrock digital in events
taskFilename = sprintf('%s/%s/%s0%s.log',stimulusLogVolume,dateSubject,dateSubject,runNum); %information on stimuli and performance
photodiodeFilename = lfpFilename; %#ok
lineNoiseTriggerFilename = lfpFilename; %#ok
preprocessedDataFilename = strcat(outDir,preprocessedDataFilenameStem); %#ok
photodiodeParams.outputCalibrationFile = strcat(outDir,'/',photodiodeParams.outputCalibrationFile); %#ok
lineNoiseTriggerParams.outputCalibrationFile = strcat(outDir,'/',lineNoiseTriggerParams.outputCalibrationFile); %#ok
save(analysisParamFilename);
runAnalysisInputsTmp = processRun('paramFile',analysisParamFilename,'analyzer', @(x) 1,'keepItemsNotPresented',1);
if run_i == 1
runAnalysisInputs = runAnalysisInputsTmp;
runAnalysisInputs.analysisParamFilename = finalAnalysisParamFilename;
accumulatedTimeOffset = runAnalysisInputs.excludeStimParams.ephysDuration;
accumulatedTrialOffset = length(runAnalysisInputs.taskData.taskEventStartTimes);
continue
end
% first, defend against spurrious computation of timeseries across run boundaries
dataReqPre = psthParams.psthPre + max(3*psthParams.smoothingWidth, tfParams.movingWin(1)/2);
if exist('spikeBackgroundParams','var') && spikeBackgroundParams.trialWise
dataReqPre = max(dataReqPre, spikeBackgroundParams.compWin(1));
end
if exist('lfpBackgroundParams','var') && lfpBackgroundParams.trialWise
dataReqPre = max(dataReqPre, lfpBackgroundParams.compWin(1));
end
dataReqPost = psthParams.psthPost + max(3*psthParams.smoothingWidth, tfParams.movingWin(1)/2);
if ~(isfield(runAnalysisInputsTmp.excludeStimParams,'ephysDataPre') && ...
runAnalysisInputsTmp.excludeStimParams.ephysDataPre > dataReqPre && ...
isfield(runAnalysisInputsTmp.excludeStimParams,'ephysDataPost') && ...
runAnalysisInputsTmp.excludeStimParams.ephysDataPost > dataReqPost)
assert(false,'processRunAsOne currently requires that trials be excluded per-run for insufficient ephys data pre- and post');
end
runAnalysisInputs.lfpData = cat(2,runAnalysisInputs.lfpData,runAnalysisInputsTmp.lfpData);
runAnalysisInputs.analogInData = cat(2,runAnalysisInputs.analogInData,runAnalysisInputsTmp.analogInData);
% merge taskData
runAnalysisInputs.taskData.taskEventStartTimes = vertcat(runAnalysisInputs.taskData.taskEventStartTimes,accumulatedTimeOffset,...
runAnalysisInputsTmp.taskData.taskEventStartTimes + accumulatedTimeOffset);
runAnalysisInputs.taskData.taskEventEndTimes = vertcat(runAnalysisInputs.taskData.taskEventEndTimes,accumulatedTimeOffset+1,...
runAnalysisInputsTmp.taskData.taskEventEndTimes + accumulatedTimeOffset);
runAnalysisInputs.taskData.fixationInTimes = vertcat(runAnalysisInputs.taskData.fixationInTimes,...
runAnalysisInputsTmp.taskData.fixationInTimes + accumulatedTimeOffset);
runAnalysisInputs.taskData.fixationOutTimes = vertcat(runAnalysisInputs.taskData.fixationOutTimes,...
runAnalysisInputsTmp.taskData.fixationOutTimes + accumulatedTimeOffset);
runAnalysisInputs.taskData.juiceOnTimes = vertcat(runAnalysisInputs.taskData.juiceOnTimes,...
runAnalysisInputsTmp.taskData.juiceOnTimes + accumulatedTimeOffset);
runAnalysisInputs.taskData.juiceOffTimes = vertcat(runAnalysisInputs.taskData.juiceOffTimes,...
runAnalysisInputsTmp.taskData.juiceOffTimes + accumulatedTimeOffset);
if runAnalysisInputsTmp.taskData.RFmap
assert(isfield(runAnalysisInputs.taskData.stimJumps),'combination of RF map and non-RF-map runs not currently implemented');
runAnalysisInputs.taskData.stimJumps = vertcat(runAnalysisInputs.taskData.stimJumps,[0,0],runAnalysisInputsTmp.taskData.stimJumps);
runAnalysisInputs.taskData.gridPointsDegX = sort(union(runAnalysisInputs.taskData.gridPointsDegX,runAnalysisInputsTmp.taskData.gridPointsDegX),'ascend');
runAnalysisInputs.taskData.gridPointsDegY = sort(union(runAnalysisInputs.taskData.gridPointsDegY,runAnalysisInputsTmp.taskData.gridPointsDegY),'ascend');
end
runAnalysisInputs.taskData.taskEventIDs = vertcat(runAnalysisInputs.taskData.taskEventIDs,'RUN_BREAK',...
runAnalysisInputsTmp.taskData.taskEventIDs);
runAnalysisInputs.taskData.stimFramesLost = vertcat(runAnalysisInputs.taskData.stimFramesLost,0,runAnalysisInputsTmp.taskData.stimFramesLost);
runAnalysisInputs.taskData.eventTimeAdjustments = vertcat(runAnalysisInputs.taskData.eventTimeAdjustments,0,...
runAnalysisInputsTmp.taskData.eventTimeAdjustments);
% merge taskDataAll
runAnalysisInputs.taskDataAll.taskEventStartTimes = vertcat(runAnalysisInputs.taskDataAll.taskEventStartTimes,accumulatedTimeOffset,...
runAnalysisInputsTmp.taskDataAll.taskEventStartTimes + accumulatedTimeOffset);
runAnalysisInputs.taskDataAll.taskEventEndTimes = vertcat(runAnalysisInputs.taskDataAll.taskEventEndTimes,accumulatedTimeOffset+1,...
runAnalysisInputsTmp.taskDataAll.taskEventEndTimes + accumulatedTimeOffset);
runAnalysisInputs.taskDataAll.fixationInTimes = vertcat(runAnalysisInputs.taskDataAll.fixationInTimes,...
runAnalysisInputsTmp.taskDataAll.fixationInTimes + accumulatedTimeOffset);
runAnalysisInputs.taskDataAll.fixationOutTimes = vertcat(runAnalysisInputs.taskDataAll.fixationOutTimes,...
runAnalysisInputsTmp.taskDataAll.fixationOutTimes + accumulatedTimeOffset);
runAnalysisInputs.taskDataAll.juiceOnTimes = vertcat(runAnalysisInputs.taskDataAll.juiceOnTimes,...
runAnalysisInputsTmp.taskDataAll.juiceOnTimes + accumulatedTimeOffset);
runAnalysisInputs.taskDataAll.juiceOffTimes = vertcat(runAnalysisInputs.taskDataAll.juiceOffTimes,...
runAnalysisInputsTmp.taskDataAll.juiceOffTimes + accumulatedTimeOffset);
if runAnalysisInputsTmp.taskData.RFmap
assert(isfield(runAnalysisInputs.taskDataAll.stimJumps),'combination of RF map and non-RF-map runs not currently implemented');
runAnalysisInputs.taskDataAll.stimJumps = vertcat(runAnalysisInputs.taskDataAll.stimJumps,[0,0],runAnalysisInputsTmp.taskDataAll.stimJumps);
runAnalysisInputs.taskDataAll.gridPointsDegX = sort(union(runAnalysisInputs.taskDataAll.gridPointsDegX,runAnalysisInputsTmp.taskDataAll.gridPointsDegX),'ascend');
runAnalysisInputs.taskDataAll.gridPointsDegY = sort(union(runAnalysisInputs.taskDataAll.gridPointsDegY,runAnalysisInputsTmp.taskDataAll.gridPointsDegY),'ascend');
end
runAnalysisInputs.taskDataAll.taskEventIDs = vertcat(runAnalysisInputs.taskDataAll.taskEventIDs,'RUN_BREAK',...
runAnalysisInputsTmp.taskDataAll.taskEventIDs);
runAnalysisInputs.taskDataAll.stimFramesLost = vertcat(runAnalysisInputs.taskDataAll.stimFramesLost,0,runAnalysisInputsTmp.taskDataAll.stimFramesLost);
runAnalysisInputs.taskDataAll.eventTimeAdjustments = vertcat(runAnalysisInputs.taskDataAll.eventTimeAdjustments,0,...
runAnalysisInputsTmp.taskDataAll.eventTimeAdjustments);
% merge 'byEvent' data structures for spikes, lfps, analogIns, jumps, onsets, and trialIDs
for event_i = 1:length(runAnalysisInputs.eventLabels)
for channel_i = 1:length(runAnalysisInputsTmp.spikesByEvent{event_i})
for unit_i = 1:length(runAnalysisInputsTmp.spikesByEvent{1}{channel_i})
runAnalysisInputs.spikesByEvent{event_i}{channel_i}{unit_i} = vertcat(runAnalysisInputs.spikesByEvent{event_i}{channel_i}{unit_i},...
runAnalysisInputsTmp.spikesByEvent{event_i}{channel_i}{unit_i});
runAnalysisInputs.psthEmptyByEvent{event_i}{channel_i}{unit_i} = runAnalysisInputs.psthEmptyByEvent{event_i}{channel_i}{unit_i} &&...
runAnalysisInputsTmp.psthEmptyByEvent{event_i}{channel_i}{unit_i};
runAnalysisInputs.spikesByEventForTF{event_i}{channel_i}{unit_i} = vertcat(runAnalysisInputs.spikesByEventForTF{event_i}{channel_i}{unit_i},...
runAnalysisInputsTmp.spikesByEventForTF{event_i}{channel_i}{unit_i});
end
end
runAnalysisInputs.lfpByEvent{event_i} = cat(3, runAnalysisInputs.lfpByEvent{event_i}, runAnalysisInputsTmp.lfpByEvent{event_i});
if analogInParams.needAnalogIn
runAnalysisInputs.analogInByEvent{event_i} = cat(3, runAnalysisInputs.analogInByEvent{event_i}, runAnalysisInputsTmp.analogInByEvent{event_i});
end
if runAnalysisInputsTmp.taskData.RFmap
runAnalysisInputs.jumpsByImage{event_i} = vertcat(runAnalysisInputs.jumpsByImage{event_i}, runAnalysisInputsTmp.jumpsByImage{event_i});
end
runAnalysisInputs.onsetsByEvent{event_i} = vertcat(runAnalysisInputs.onsetsByEvent{event_i},runAnalysisInputsTmp.onsetsByEvent{event_i});
runAnalysisInputs.trialIDsByEvent{event_i} = vertcat(runAnalysisInputs.trialIDsByEvent{event_i},...
runAnalysisInputsTmp.trialIDsByEvent{event_i}+accumulatedTrialOffset);
end
% merge 'byCategory' data structures for spikes, lfps, analogIns, jumps, onsets, and trialIDs
for cat_i = 1:length(runAnalysisInputs.categoryList)
for channel_i = 1:length(runAnalysisInputsTmp.spikesByCategory{cat_i})
for unit_i = 1:length(runAnalysisInputsTmp.spikesByCategory{1}{channel_i})
runAnalysisInputs.spikesByCategory{cat_i}{channel_i}{unit_i} = vertcat(runAnalysisInputs.spikesByCategory{cat_i}{channel_i}{unit_i},...
runAnalysisInputsTmp.spikesByCategory{cat_i}{channel_i}{unit_i});
runAnalysisInputs.psthEmptyByCategory{cat_i}{channel_i}{unit_i} = runAnalysisInputs.psthEmptyByCategory{cat_i}{channel_i}{unit_i} &&...
runAnalysisInputsTmp.psthEmptyByCategory{cat_i}{channel_i}{unit_i};
runAnalysisInputs.spikesByCategoryForTF{cat_i}{channel_i}{unit_i} = vertcat(runAnalysisInputs.spikesByCategoryForTF{cat_i}{channel_i}{unit_i},...
runAnalysisInputsTmp.spikesByCategoryForTF{cat_i}{channel_i}{unit_i});
end
end
runAnalysisInputs.lfpByCategory{cat_i} = cat(3, runAnalysisInputs.lfpByCategory{cat_i}, runAnalysisInputsTmp.lfpByCategory{cat_i});
if analogInParams.needAnalogIn
runAnalysisInputs.analogInByCategory{cat_i} = cat(3, runAnalysisInputs.analogInByCategory{cat_i}, runAnalysisInputsTmp.analogInByCategory{cat_i});
end
runAnalysisInputs.onsetsByCategory{cat_i} = vertcat(runAnalysisInputs.onsetsByCategory{cat_i},runAnalysisInputsTmp.onsetsByCategory{cat_i});
runAnalysisInputs.trialIDsByCategory{cat_i} = vertcat(runAnalysisInputs.trialIDsByCategory{cat_i},...
runAnalysisInputsTmp.trialIDsByCategory{cat_i} + accumulatedTrialOffset);
end
runAnalysisInputs.stimTiming.shortest = min(runAnalysisInputs.stimTiming.shortest,runAnalysisInputsTmp.stimTiming.shortest);
runAnalysisInputs.stimTiming.longest = min(runAnalysisInputs.stimTiming.longest,runAnalysisInputsTmp.stimTiming.longest);
accumulatedTimeOffset = accumulatedTimeOffset + runAnalysisInputsTmp.excludeStimParams.ephysDuration;
accumulatedTrialOffset = accumulatedTrialOffset + length(runAnalysisInputsTmp.taskData.taskEventStartTimes);
end
%remove lines for events not observed from data structures
eventsNotObserved = zeros(length(runAnalysisInputs.eventLabels),1);
for event_i = 1:length(runAnalysisInputs.eventLabels)
eventsNotObserved(event_i) = isempty(runAnalysisInputs.onsetsByEvent{event_i});
end
runAnalysisInputs.onsetsByEvent = runAnalysisInputs.onsetsByEvent(eventsNotObserved == 0);
runAnalysisInputs.offsetsByEvent = runAnalysisInputs.offsetsByEvent(eventsNotObserved == 0);
runAnalysisInputs.trialIDsByEvent = runAnalysisInputs.trialIDsByEvent(eventsNotObserved == 0);
runAnalysisInputs.eventLabels = runAnalysisInputs.eventLabels(eventsNotObserved == 0);
runAnalysisInputs.eventCategories = runAnalysisInputs.eventCategories(eventsNotObserved == 0);
runAnalysisInputs.spikesByEvent = runAnalysisInputs.spikesByEvent(eventsNotObserved == 0);
runAnalysisInputs.psthEmptyByEvent = runAnalysisInputs.psthEmptyByEvent(eventsNotObserved == 0);
runAnalysisInputs.spikesByEventForTF = runAnalysisInputs.spikesByEventForTF(eventsNotObserved == 0);
runAnalysisInputs.lfpByEvent = runAnalysisInputs.lfpByEvent(eventsNotObserved == 0);
if analogInParams.needAnalogIn
runAnalysisInputs.analogInByEvent = runAnalysisInputs.analogInByEvent(eventsNotObserved == 0);
end
if runAnalysisInputsTmp.taskData.RFmap
runAnalysisInputs.jumpsByImage = runAnalysisInputs.jumpsByImage(eventsNotObserved == 0);
end
%remove lines for categories not observed from data structures
catsNotObserved = zeros(length(runAnalysisInputs.categoryList),1);
for cat_i = 1:length(runAnalysisInputs.categoryList)
catsNotObserved(cat_i) = isempty(runAnalysisInputs.onsetsByCategory{cat_i});
end
runAnalysisInputs.onsetsByCategory = runAnalysisInputs.onsetsByCategory(catsNotObserved == 0);
runAnalysisInputs.offsetsByCategory = runAnalysisInputs.offsetsByCategory(catsNotObserved == 0);
runAnalysisInputs.categoryList = runAnalysisInputs.categoryList(catsNotObserved == 0);
runAnalysisInputs.trialIDsByCategory = runAnalysisInputs.trialIDsByCategory(catsNotObserved == 0);
runAnalysisInputs.spikesByCategory = runAnalysisInputs.spikesByCategory(catsNotObserved == 0);
runAnalysisInputs.psthEmptyByCategory = runAnalysisInputs.psthEmptyByCategory(catsNotObserved == 0);
runAnalysisInputs.spikesByCategoryForTF = runAnalysisInputs.spikesByCategoryForTF(catsNotObserved == 0);
runAnalysisInputs.lfpByCategory = runAnalysisInputs.lfpByCategory(catsNotObserved == 0);
if analogInParams.needAnalogIn
runAnalysisInputs.analogInByCategory = runAnalysisInputs.analogInByCategory(catsNotObserved == 0);
end
if savePreprocessed
analysisParamFilename = runAnalysisInputs. analysisParamFilename; %#ok
spikesByChannel = runAnalysisInputs. spikesByChannel; %#ok
lfpData = runAnalysisInputs. lfpData; %#ok
analogInData = runAnalysisInputs. analogInData; %#ok
taskData = runAnalysisInputs. taskData; %#ok
taskDataAll = runAnalysisInputs. taskDataAll; %#ok
psthImDur = runAnalysisInputs. psthImDur; %#ok
preAlign = runAnalysisInputs. preAlign; %#ok
postAlign = runAnalysisInputs. postAlign; %#ok
categoryList = runAnalysisInputs. categoryList; %#ok
eventLabels = runAnalysisInputs. eventLabels; %#ok
jumpsByImage = runAnalysisInputs. jumpsByImage; %#ok
spikesByEvent = runAnalysisInputs. spikesByEvent; %#ok
psthEmptyByEvent = runAnalysisInputs. psthEmptyByEvent; %#ok
spikesByCategory = runAnalysisInputs. spikesByCategory; %#ok
psthEmptyByCategory = runAnalysisInputs. psthEmptyByCategory; %#ok
spikesByEventForTF = runAnalysisInputs. spikesByEventForTF; %#ok
spikesByCategoryForTF = runAnalysisInputs. spikesByCategoryForTF; %#ok
lfpByEvent = runAnalysisInputs. lfpByEvent; %#ok
lfpByCategory = runAnalysisInputs. lfpByCategory; %#ok
analogInByEvent = runAnalysisInputs. analogInByEvent; %#ok
analogInByCategory = runAnalysisInputs. analogInByCategory; %#ok
channelUnitNames = runAnalysisInputs. channelUnitNames; %#ok
stimTiming = runAnalysisInputs. stimTiming; %#ok
eventCategories = runAnalysisInputs. eventCategories; %#ok
onsetsByEvent = runAnalysisInputs. onsetsByEvent; %#ok
onsetsByCategory = runAnalysisInputs. onsetsByCategory; %#ok
trialIDsByEvent = runAnalysisInputs. trialIDsByEvent; %#ok
trialIDsByCategory = runAnalysisInputs. trialIDsByCategory; %#ok
save(finalPreprocessedDataFilename,'analysisParamFilename', 'spikesByChannel', 'lfpData', 'analogInData', 'taskData', 'taskDataAll', 'psthImDur', 'preAlign', 'postAlign',...
'categoryList', 'eventLabels', 'jumpsByImage', 'spikesByEvent', 'psthEmptyByEvent', 'spikesByCategory', 'psthEmptyByCategory',...
'spikesByEventForTF', 'spikesByCategoryForTF', 'lfpByEvent', 'lfpByCategory', 'analogInByEvent','analogInByCategory','channelUnitNames', ...
'stimTiming', 'eventCategories', 'onsetsByEvent', 'onsetsByCategory','trialIDsByEvent','trialIDsByCategory');
end
if ~exist('analyzer','var')
runAnalyses(runAnalysisInputs);
else
feval(analyzer,runAnalysisInputs);
end
end