-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremakeTonsetResp_test.m
70 lines (52 loc) · 2.39 KB
/
remakeTonsetResp_test.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
rootFolder = '//storage.erc.monash.edu.au/shares/R-MNHS-Physio/SysNeuroData/Monash Data/Joanita/';
%saveServer = 'E:/tmp/cuesaccade_data';
saveServer = 'Z:\Shared\Daisuke\cuesaccade_data';
%load('fitPSTH_pop20230704hugo.mat')
theseIDs = {'hugo/2021/09September/01/25',...
'hugo/2022/03March/10/20',...
'hugo/2022/07July/29/19'};
for ii = 1:numel(theseIDs)
aaa = split(theseIDs{ii},'/');
animal = aaa{1};
year = aaa{2};
months = aaa{3};
dates = aaa{4};
channels = aaa{5};
saveFigFolder = fullfile(saveServer, '20230704',year,animal);
mkdir(saveFigFolder);
datech = [months filesep dates filesep channels];
saveSuffix = [animal replace(datech,filesep,'_') ];%'_cue'];
saveFolder = fullfile(saveServer, year,animal);%17/6/23
saveName = fullfile(saveFolder, [saveSuffix '.mat']);
load(saveName, 'PSTH_f','predicted_all', 'predicted','kernelInfo'...
,'t_r','param','t_cat');%,'dds');
psthNames = cat(2,{'psth','predicted_all'},param.predictorNames);
eyeName = fullfile(saveFolder,['eyeCat_' animal months '_' dates '.mat']);
load(eyeName,'catEvTimes','startSaccNoTask','saccDirNoTask');
loadName = getCuesaccadeName(rootFolder, theseIDs{ii});
load(loadName,'dd');
y_r = cat(2,PSTH_f,predicted_all, predicted);
if min(PSTH_f)<0
k = -min(PSTH_f)+0.5;
else
k = 0.5;
end
[f] = showTonsetResp(t_r, (y_r), catEvTimes, dd, psthNames, ...
startSaccNoTask, saccDirNoTask, param, [-0.5 0.5], 1);
screen2png(fullfile(saveFigFolder,['cellclassFig_' saveSuffix '_allTr']), f);
close(f);
[f] = showTonsetResp(t_r, y_r, catEvTimes, dd, psthNames, ...
startSaccNoTask, saccDirNoTask, param, [-0.5 0.5], 0);
screen2png(fullfile(saveFigFolder,['cellclassFig_' saveSuffix]), f);
close(f);
%% traces in log space
% problem of log(0) was dealt with pseudolog transformation
[f] = showTonsetResp(t_r, log(y_r+k), catEvTimes, dd, psthNames, ...
startSaccNoTask, saccDirNoTask, param, [-0.5 0.5], 0);
screen2png(fullfile(saveFigFolder,['cellclassFig_' saveSuffix '_log']), f);
close(f);
[f] = showTonsetResp(t_r, log(y_r+k), catEvTimes, dd, psthNames, ...
startSaccNoTask, saccDirNoTask, param, [-0.5 0.5], 1);
screen2png(fullfile(saveFigFolder,['cellclassFig_' saveSuffix '_allTr_log']), f);
close(f);
end