Skip to content

Commit 76b1939

Browse files
committed
Fixed matrix size on subject assertion. Wrong index
1 parent 1059d55 commit 76b1939

7 files changed

Lines changed: 13 additions & 13 deletions

File tree

0 Bytes
Binary file not shown.

data/test_act_act.mat

119 Bytes
Binary file not shown.

data/test_hcp_fc.mat

0 Bytes
Binary file not shown.

data/test_r_fc.mat

0 Bytes
Binary file not shown.

data/test_t2_fc.mat

0 Bytes
Binary file not shown.

power_calculator_tools/subs_data_from_score_condition.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,6 @@
7272
RP.n_subs_2 = n_subs_2;
7373
RP.n_subs = n_subs_1 + n_subs_2;
7474

75-
n_available = size(BrainData.(ref_cond).data,1);
76-
77-
assert(RP.n_subs <= n_available, ...
78-
['Dataset bug: t2 groups sum to %d subjects but BrainData.%s ' ...
79-
'only has %d unique subjects. ' ...
80-
'Groups likely overlap (a subject matched both conditions) ' ...
81-
'or IDs are duplicated.'], ...
82-
RP.n_subs, ref_cond, n_available);
83-
8475
case 'r'
8576

8677
ref_cond = TestData.reference_condition;
@@ -117,7 +108,16 @@
117108
RP.n_subs_2 = length(sub_ids);
118109
RP.n_subs = length(sub_ids);
119110

111+
120112
end
121113

114+
n_available = size(BrainData.(ref_cond).data,2);
115+
116+
assert(RP.n_subs <= n_available, ...
117+
['Dataset bug: t2 groups sum to %d subjects but BrainData.%s ' ...
118+
'only has %d unique subjects. ' ...
119+
'Groups likely overlap (a subject matched both conditions) ' ...
120+
'or IDs are duplicated.'], ...
121+
RP.n_subs, ref_cond, n_available);
122122

123123
end

setparams.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
Params.recalculate = false;
5050

5151
%%% Resampling parameters %%%
52-
Params.parallel = false; % run stuff sequentially or in parallel
53-
Params.n_workers = 10; % num parallel workers for parfor, best if # workers = # cores
52+
Params.parallel = true; % run stuff sequentially or in parallel
53+
Params.n_workers = 5; % num parallel workers for parfor, best if # workers = # cores
5454
Params.n_repetitions = 100; % 500 recommended
5555
Params.batch_size = 10;
5656

5757
%% Skip some tests - change ranges or the function
5858
% Tests to skip accepts functions
59-
ranges = {[0, 1]};
59+
ranges = {[0, 0]};
6060
Params.tests_to_skip = @(x) any(cellfun(@(r) (x >= r(1)) && (x <= r(2)), ranges));
6161

6262
%% List of subjects per subset
@@ -80,7 +80,7 @@
8080
%%%%% DEVELOPERS ONLY %%%%%
8181
% Use a small subset of permutations for faster development -- inappropriate for inference
8282

83-
Params.testing = true;
83+
Params.testing = false;
8484
Params.test_n_perms = 5;
8585
Params.test_n_repetitions = 10;
8686
Params.test_n_workers = 1;

0 commit comments

Comments
 (0)