Skip to content

Commit 215f986

Browse files
committed
SLURM job scheduling, and added some color repos
1 parent f79bcd0 commit 215f986

File tree

145 files changed

+25114
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+25114
-15
lines changed

eeg_mvpa/adam_compute_group_ERP.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
if isempty(plot_order)
175175
dirz = dir(folder_name);
176176
dirz = {dirz([dirz(:).isdir]).name};
177-
plot_order = dirz(cellfun(@isempty,strfind(dirz,'.')));
177+
plot_order = dirz(~(strcmp(dirz,'.')|strcmp(dirz,'..')));
178178
if ndirs == 1
179179
[folder_name, plot_order] = fileparts(folder_name);
180180
plot_order = {plot_order};
@@ -187,7 +187,7 @@
187187
else
188188
dirz = dir(folder_name);
189189
dirz = {dirz([dirz(:).isdir]).name};
190-
dirz = dirz(cellfun(@isempty,strfind(dirz,'.')));
190+
dirz = dirz(~(strcmp(dirz,'.')|strcmp(dirz,'..')));
191191
for cPlot = 1:numel(plot_order)
192192
dirindex = find(strcmpi(plot_order{cPlot},dirz));
193193
if isempty(dirindex) % if an exact match cannot be made, look only for the pattern in the first sequency of characters
@@ -258,7 +258,8 @@
258258
% get filenames
259259
plotFreq = ''; % this is empty for now, but might be used to look at the ERPs obtained from a TF analysis
260260
subjectfiles = dir([folder_name filesep channelpool plotFreq filesep '*.mat']);
261-
[~, condname] = fileparts(folder_name);
261+
[~, condname,ext] = fileparts(folder_name);
262+
condname = [condname ext];
262263
subjectfiles = { subjectfiles(:).name };
263264
subjectfiles(strncmp(subjectfiles,'.',1)) = []; % remove hidden files
264265

eeg_mvpa/adam_compute_group_MVPA.m

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
if isempty(plot_order)
203203
dirz = dir(folder_name);
204204
dirz = {dirz([dirz(:).isdir]).name};
205-
plot_order = dirz(cellfun(@isempty,strfind(dirz,'.')));
205+
plot_order = dirz(~(strcmp(dirz,'.')|strcmp(dirz,'..')));
206206
if ndirs == 1
207207
[folder_name, plot_order] = fileparts(folder_name);
208208
plot_order = {plot_order};
@@ -215,7 +215,7 @@
215215
else
216216
dirz = dir(folder_name);
217217
dirz = {dirz([dirz(:).isdir]).name};
218-
dirz = dirz(cellfun(@isempty,strfind(dirz,'.')));
218+
dirz = dirz(~(strcmp(dirz,'.')|strcmp(dirz,'..')));
219219
for cPlot = 1:numel(plot_order)
220220
dirindex = find(strcmpi(plot_order{cPlot},dirz));
221221
if isempty(dirindex) % if an exact match cannot be made, look only for the pattern in the first sequency of characters
@@ -234,8 +234,28 @@
234234
end
235235
end
236236

237+
% when plotting individual subjects in a single plot also need to create a figure and set colors
238+
if plotsubjects && singleplot
239+
fh = figure('name','individual subjects');
240+
set(fh, 'Position', get(0,'Screensize'));
241+
set(fh,'color','w');
242+
% set line colors
243+
if ~exist('line_colors','var')
244+
line_colors = {[.5 0 0] [0 .5 0] [0 0 .5] [.5 .5 0] [0 .5 .5] [.5 0 .5] [.75 0 0] [0 .75 0] [0 0 .75] [.75 .75 0] [0 .75 .75] [.75 0 .75] };
245+
end
246+
if ~iscell(line_colors)
247+
for c=1:size(line_colors,1)
248+
cell_colors{c} = line_colors(c,:);
249+
end
250+
line_colors = cell_colors;
251+
end
252+
end
253+
237254
% loop through directories (results folders)
238255
for cdirz = 1:numel(plot_order)
256+
if plotsubjects && singleplot
257+
cfg.line_color = line_colors{cdirz};
258+
end
239259
[stats(cdirz), cfg] = subcompute_group_MVPA(cfg, [folder_name filesep plot_order{cdirz}], mask);
240260
end
241261

@@ -326,7 +346,8 @@
326346

327347
% get filenames
328348
subjectfiles = dir([folder_name filesep channelpool plotFreq{1} filesep '*.mat']);
329-
[~, condname] = fileparts(folder_name);
349+
[~, condname, ext] = fileparts(folder_name);
350+
condname = [condname ext];
330351
subjectfiles = { subjectfiles(:).name };
331352
subjectfiles(strncmp(subjectfiles,'.',1)) = []; % remove hidden files
332353

@@ -342,7 +363,7 @@
342363
end
343364

344365
% prepare figure in case individual subjects are plotted
345-
if plotsubjects;
366+
if plotsubjects && ~singleplot
346367
fh = figure('name',['individual subjects: ' condname]);
347368
set(fh, 'Position', get(0,'Screensize'));
348369
set(fh,'color','w');
@@ -630,6 +651,9 @@
630651

631652
% plot individual subjects
632653
if plotsubjects
654+
if singleplot
655+
hold on; % for plotting multiple lines
656+
end
633657
subplot(numSubplots(nSubj,1),numSubplots(nSubj,2),cSubj);
634658
onestat.ClassOverTime = ClassOverTime;
635659
onestat.StdError = [];
@@ -644,6 +668,9 @@
644668
onestat.channelpool = channelpool;
645669
onestat.cfg = [];
646670
tmpcfg = cfg;
671+
if singleplot
672+
tmpcfg.line_colors = {line_color}; % for plotting multiple lines
673+
end
647674
tmpcfg.plot_model = plot_model;
648675
tmpcfg.plotsubjects = true;
649676
tmpcfg.plotsigline_method = 'both';

eeg_mvpa/adam_plot_MVPA.m

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@
6969
% will plot testing on y and training x.
7070
% cfg.inverty = [] (default, for ERP plots default is true); you can choose to plot
7171
% the voltage on the y-axis of ERP plots downward by setting to false.
72-
% cfg.plotsigline_method = 'both' (default); or 'straight'; a straight horizontal line at the
73-
% bottom of the plot for (clusters of) significant time points in line
74-
% plots is always drawn, but the default option 'both' will also make
75-
% the line of the line plot thicker on these time points.
72+
% cfg.plotsigline_method = 'both' (default); Alternatively specify 'straight' a straight
73+
% horizontal line at the bottom of the plot for (clusters of)
74+
% significant time points. 'follow' will make the significant lines
75+
% thicker in the graph itself. The default option 'both' will also
76+
% make the line of the line plot thicker on these time points.
7677
% cfg.plot_model = 'BDM' (default); or 'FEM' if stats contains classification results
7778
% of a forward encoding model.
7879
%
@@ -191,6 +192,12 @@
191192
end
192193

193194
% set line colors
195+
if ~iscell(line_colors)
196+
for c=1:size(line_colors,1)
197+
cell_colors{c} = line_colors(c,:);
198+
end
199+
line_colors = cell_colors;
200+
end
194201
if numel(line_colors)<numel(stats) || isempty(line_colors)
195202
if numel(stats) > 1
196203
line_colors = {[.5 0 0] [0 .5 0] [0 0 .5] [.5 .5 0] [0 .5 .5] [.5 0 .5] [.75 0 0] [0 .75 0] [0 0 .75] [.75 .75 0] [0 .75 .75] [.75 0 .75] };
@@ -597,7 +604,7 @@
597604
% plot significant time points
598605
if ~isempty(pVals)
599606
sigdata = data;
600-
if strcmpi(plotsigline_method,'straight') || strcmpi(plotsigline_method,'both') && ~isempty(pVals) && ~strcmpi(mpcompcor_method,'none')
607+
if strcmpi(plotsigline_method,'straight') || strcmpi(plotsigline_method,'both')
601608
if ~singleplot elevate = 1; else elevate = (nGraph-cGraph)+.5; end
602609
if inverty
603610
sigdata(1:numel(sigdata)) = max(acclim) - (diff(acclim)/80)*elevate;
@@ -612,7 +619,7 @@
612619
end
613620
end
614621
sigdata = data;
615-
if ~strcmpi(plotsigline_method,'straight')
622+
if strcmpi(plotsigline_method,'follow') || strcmpi(plotsigline_method,'both')
616623
sigdata(pVals>=indiv_pval) = NaN;
617624
if isnumeric(line_colors{cGraph})
618625
H.mainLine=plot(1:numel(sigdata),sigdata,'Color',line_colors{cGraph},'LineWidth',3); % sigline on graph
@@ -637,6 +644,15 @@
637644
set(h_legend,'FontSize',12);
638645
end
639646
end
647+
else
648+
if strcmpi(plotsigline_method,'follow') || strcmpi(plotsigline_method,'both')
649+
sigdata = data;
650+
if isnumeric(line_colors{cGraph})
651+
H.mainLine=plot(1:numel(sigdata),sigdata,'Color',line_colors{cGraph},'LineWidth',3); % sigline on graph
652+
else
653+
H.mainLine=plot(1:numel(sigdata),sigdata,line_colors{cGraph},'LineWidth',3); % sigline on graph
654+
end
655+
end
640656
end
641657
if unique(numel(acclim)) == 2
642658
ylim(acclim);
429 Bytes
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
1.0000000e+01 8.0400000e+00 1.0000000e+01 9.1400000e+00 1.0000000e+01 7.4600000e+00 8.0000000e+00 6.5800000e+00
2+
8.0000000e+00 6.9500000e+00 8.0000000e+00 8.1400000e+00 8.0000000e+00 6.7700000e+00 8.0000000e+00 5.7600000e+00
3+
1.3000000e+01 7.5800000e+00 1.3000000e+01 8.7400000e+00 1.3000000e+01 1.2740000e+01 8.0000000e+00 7.7100000e+00
4+
9.0000000e+00 8.8100000e+00 9.0000000e+00 8.7700000e+00 9.0000000e+00 7.1100000e+00 8.0000000e+00 8.8400000e+00
5+
1.1000000e+01 8.3300000e+00 1.1000000e+01 9.2600000e+00 1.1000000e+01 7.8100000e+00 8.0000000e+00 8.4700000e+00
6+
1.4000000e+01 9.9600000e+00 1.4000000e+01 8.1000000e+00 1.4000000e+01 8.8400000e+00 8.0000000e+00 7.0400000e+00
7+
6.0000000e+00 7.2400000e+00 6.0000000e+00 6.1300000e+00 6.0000000e+00 6.0800000e+00 8.0000000e+00 5.2500000e+00
8+
4.0000000e+00 4.2600000e+00 4.0000000e+00 3.1000000e+00 4.0000000e+00 5.3900000e+00 1.9000000e+01 1.2500000e+01
9+
1.2000000e+01 1.0840000e+01 1.2000000e+01 9.1300000e+00 1.2000000e+01 8.1500000e+00 8.0000000e+00 5.5600000e+00
10+
7.0000000e+00 4.8200000e+00 7.0000000e+00 7.2600000e+00 7.0000000e+00 6.4200000e+00 8.0000000e+00 7.9100000e+00
11+
5.0000000e+00 5.6800000e+00 5.0000000e+00 4.7400000e+00 5.0000000e+00 5.7300000e+00 8.0000000e+00 6.8900000e+00
13.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)