-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotPopSTdata.m
More file actions
54 lines (48 loc) · 2.02 KB
/
plotPopSTdata.m
File metadata and controls
54 lines (48 loc) · 2.02 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
% Plots the single trial gamma activity, behavioral correlation data
groups = {'ET', 'PD'};
gc = {[0 0 1], [1 0 0]};
setDirectories;
subjectLists;
locations = {'Precentral Gyrus', 'Postcentral Gyrus', 'Superior Temporal Gyrus'};
fh = figure; ah=[];
for gg = 1:length(groups)
load([savedDataDir filesep groups{gg} '_SingleTrialActivity.mat'], 'Results');
setDirectories;
disp([groups{gg} ' Patients']);
for ll = 1:length(locations)
ah(ll) = subplot(2,2, ll);
loci = find(strcmpi(locations{ll}, {Results.Locations}));
locResults = Results(loci);
sigC = [locResults.pvalCspearman] < 0.05;
sigS = [locResults.pvalSspearman] < 0.05;
either = sigC | sigS;
plot([Results(loci).rhoCspearman], [Results(loci).rhoSspearman],'o', 'Color', gc{gg});
disp(locations{ll});
medCR = cellfun(@nanmedian, {locResults(sigC).CR});
medSPR = cellfun(@(x) nanmedian(double(x)), {locResults(sigS).SPR});
fprintf('%d Electrode-Sessions significantly CueR-RT correlated. Median time %f\n', sum(sigC), mean(medCR));
fprintf('%d Electrode-Sessions significantly SpeechR-RT correlated. Median time %f\n', sum(sigS), mean(medSPR));
hold on;
xlabel('\rho Activation w/ Cue');
ylabel('\rho Activation w/ Speech Onset');
title(locations{ll});
end
end
% Come up with count for electrodes
subjects = [];
for gg=1:length(groups)
load([savedDataDir filesep groups{gg} '_SingleTrialActivity.mat'], 'Results');
for ll = 1:length(locations)
n = 0;
eval(['subjects=' groups{gg} '_subjects;']);
for ss = 1:length(subjects)
subi = find(strncmp(subjects{ss}, {Results.Session}, 7));
chans = [Results(subi).Channel];
locs = {Results(subi).Locations};
[c, ia] = unique(chans);
locmatch = strcmpi(locations{ll}, locs(ia));
n = sum(locmatch) + n;
end
fprintf('In %s group: %d electrodes in %s\n', groups{gg}, n, locations{ll});
end
end