Skip to content

Commit 46f623b

Browse files
committed
trying to change git yaml
1 parent f96ac69 commit 46f623b

2 files changed

Lines changed: 101 additions & 13 deletions

File tree

+nla/+net/+result/NetworkTestResult.m

Lines changed: 100 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,6 @@ function runDiagnosticPlots(obj, edge_test_options, updated_test_options, edge_t
198198
end
199199
end
200200

201-
function old_data = loadOldVersionData(obj, results_struct)
202-
number_of_results = numel(results_struct.net_results);
203-
test_options = result_struct.input_struct;
204-
network_atlas = result_struct.net_atlas;
205-
number_of_networks = network_atlas.numNets();
206-
permutation_network_test_results = {};
207-
network_test_results = {};
208-
for result_number = number_of_results
209-
210-
end
211-
end
212-
213201
%%
214202
% getters for dependent properties
215203
function value = get.permutation_count(obj)
@@ -354,5 +342,105 @@ function createPValueTriMatrices(obj, number_of_networks, test_method)
354342
end
355343
end
356344
end
345+
346+
function converted_data_struct = loadOldVersionData(results_struct)
347+
import nla.net.test.results.NetworkTestResult, nla.TriMatrix, nla.TriMatrixDiag
348+
349+
number_of_results = numel(results_struct.net_results);
350+
test_options = result_struct.input_struct;
351+
352+
network_test_options = result_struct.net_input_struct;
353+
network_test_options.ranking_method = "Uncorrected";
354+
network_test_options.no_permutations = result_struct.nonpermuted;
355+
network_test_options.full_connectome = result_struct.full_conn;
356+
network_test_options.within_network_pair = result_struct.show_within_net_pair;
357+
network_test_options = rmfield(network_test_options, ["nonpermuted", "full_conn", "within_net_pair"]);
358+
359+
network_atlas = result_struct.net_atlas;
360+
number_of_networks = network_atlas.numNets();
361+
362+
converted_data_struct = struct(...
363+
'test_options', test_options,...
364+
'network_atlas', network_atlas,...
365+
'network_test_options', network_test_options,...
366+
'edge_test_results', result_struct.edge_result,...
367+
'version', result_struct.version,...
368+
'commit', result_struct.commit,...
369+
'commit_short', result_struct.commit_short...
370+
);
371+
372+
for result_number = number_of_results
373+
switch results_struct.perm_net_results{result_number}.name
374+
case "Chi-Squared"
375+
test_name = "chi_squared";
376+
test_display_name = "Chi-Squared";
377+
ranking_statistic = "chi2_statistic";
378+
is_noncorrelation_input = 1;
379+
case "Hypergeometric"
380+
test_name = "hypergeometric";
381+
test_display_name = "Hypergeometric";
382+
ranking_statistic = "two_sample_p_value";
383+
is_noncorrelation_input = 1;
384+
case "Kolmogorov-Smirnov"
385+
test_name = "kolmogorov_smirnov";
386+
test_display_name = "Kolmogorov-Smirnov";
387+
ranking_statistic = "ks_statistic";
388+
is_noncorrelation_input = 0;
389+
case "Student's T"
390+
test_name = "students_t";
391+
test_display_name = "Student's T-test";
392+
ranking_statistic = "t_statistic";
393+
is_noncorrelation_input = 0;
394+
case "Welch's T"
395+
test_name = "welchs_t";
396+
test_display_name = "Welch's T-test";
397+
ranking_statistic = "t_statistic";
398+
is_noncorrelation_input = 0;
399+
case "Wilcoxon"
400+
test_name = "wilcoxon";
401+
test_display_name = "Wilcoxon Rank Sum";
402+
ranking_statistic = "z_statistic";
403+
is_noncorrelation_input = 0;
404+
end
405+
new_results_struct = struct(...
406+
"test_name", test_name,...
407+
"test_display_name", test_display_name,...
408+
"ranking_statistic", ranking_statistic,...
409+
"is_noncorrelation_input", is_noncorrelation_input,...
410+
"permutation_count", results_struct.perm_net_results{result_number}.perm_count,...
411+
"network_test_results", {}...
412+
);
413+
test_methods = [];
414+
no_permutation = struct();
415+
full_connectome = struct();
416+
within_network_pair = struct();
417+
if results_struct.perm_net_results{result_number}.has_nonpermuted
418+
test_methods = [test_methods "no_permutations"];
419+
no_permutation.uncorrected_single_sample_p_value = TriMatrix(number_of_networks, TriMatrixDiag.KEEP_DIAGONAL);
420+
no_permutation.uncorrected_single_sample_p_value.v = results_struct.perm_net_results{result_number}.prob.v;
421+
end
422+
if results_struct.perm_net_results.has_full_conn
423+
test_methods = [test_methods "full_connectome"];
424+
full_connectome.uncorrected_two_sample_p_value = TriMatrix(number_of_networks, TriMatrixDiag.KEEP_DIAGONAL);
425+
full_connectome.uncorrected_two_sample_p_value.v = results_struct.perm_net_results{result_number}.perm_prob.v;
426+
end
427+
if results_struct.perm_net_results.has_within_net_pair
428+
test_methods = [test_methods "within_network_pair"];
429+
within_network_pair.uncorrected_single_sample_p_value = TriMatrix(number_of_networks, TriMatrixDiag.KEEP_DIAGONAL);
430+
within_network_pair.uncorrected_single_sample_p_value.v = results_struct.perm_net_results{result_number}.within_np_prob.v;
431+
end
432+
new_results_struct.test_methods = test_methods;
433+
new_results_struct.test_options = test_options;
434+
435+
permutation_network_test_results = {...
436+
"no_permutation", no_permutations,...
437+
"full_connectome", full_connectome,...
438+
"within_network_pair", within_network_pair,...
439+
"test_methods", test_methods,...
440+
"test_options", test_options...
441+
};
442+
new_results_struct.permutation_network_test_results = permutation_network_test_results;
443+
end
444+
end
357445
end
358446
end

.github/workflows/run_matlab_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Setup MATLAB
1212
uses: matlab-actions/setup-matlab@v2
1313
with:
14-
release: R2021a
14+
release: R2023a
1515
cache: true
1616
products: >
1717
MATLAB

0 commit comments

Comments
 (0)