diff --git a/+nla/+net/+result/+plot/NetworkTestPlotApp.mlapp b/+nla/+net/+result/+plot/NetworkTestPlotApp.mlapp index 5703a903..47d781d8 100644 Binary files a/+nla/+net/+result/+plot/NetworkTestPlotApp.mlapp and b/+nla/+net/+result/+plot/NetworkTestPlotApp.mlapp differ diff --git a/+nla/+net/+result/+plot/PermutationTestPlotter.m b/+nla/+net/+result/+plot/PermutationTestPlotter.m index a21ec8ff..eaec236f 100644 --- a/+nla/+net/+result/+plot/PermutationTestPlotter.m +++ b/+nla/+net/+result/+plot/PermutationTestPlotter.m @@ -1,4 +1,9 @@ classdef PermutationTestPlotter < handle + %PERMUTATIONTESTPLOTTER Permutation Test Plotter + % This is a class (poorly named) that calls the different plotting functions for plotting results + % Collected here are the commands to plot results. They are called by various + % different classes and used for different results. Since these are called by different classes + % and not on the actual NetworkTestResult, I gathered all the plotting functions here. properties network_atlas diff --git a/+nla/+net/+result/NetworkResultPlotParameter.m b/+nla/+net/+result/NetworkResultPlotParameter.m index 09c9acbc..554bac23 100644 --- a/+nla/+net/+result/NetworkResultPlotParameter.m +++ b/+nla/+net/+result/NetworkResultPlotParameter.m @@ -35,7 +35,7 @@ % test_method - 'no permutations', 'within network pair', 'full connectome' import nla.TriMatrix nla.TriMatrixDiag - % We're going to use a default filter here + % We're going to use a default filter here, i.e. keep everything if isequal(significance_filter, false) significance_filter = TriMatrix(obj.number_of_networks, "logical", TriMatrixDiag.KEEP_DIAGONAL); significance_filter.v = true(numel(significance_filter.v), 1); @@ -57,6 +57,7 @@ p_value_breakdown_label = fdr_correction.createLabel(obj.network_atlas, obj.updated_test_options,... statistic_input); + % More title construction. It's all just string concatenation name_label = sprintf("%s %s\nP < %.2g (%s)", obj.network_test_results.test_display_name, plot_title,... p_value_max, p_value_breakdown_label); if p_value_max == 0 @@ -145,6 +146,8 @@ function brainFigureButtonCallback(network1, network2) result.p_values = p_values; end + %% + % Getters for props function value = get.test_methods(obj) value = obj.network_test_results.test_methods; end @@ -156,6 +159,8 @@ function brainFigureButtonCallback(network1, network2) function value = get.number_of_networks(obj) value = obj.network_atlas.numNets(); end + % + %% end methods (Access = protected) @@ -199,6 +204,7 @@ function brainFigureButtonCallback(network1, network2) end methods(Static) + % We call this in other classes, mainly whenever we rescale a plot function color_map = getLogColormap(default_discrete_colors, probabilities_input, p_value_max, color_map) log_minimum = log10(min(nonzeros(probabilities_input.v))); log_minimum = max([-40, log_minimum]); diff --git a/+nla/+net/+result/NetworkTestResult.m b/+nla/+net/+result/NetworkTestResult.m index b14a5688..9416c4f2 100644 --- a/+nla/+net/+result/NetworkTestResult.m +++ b/+nla/+net/+result/NetworkTestResult.m @@ -74,20 +74,25 @@ end end - function output(obj, edge_test_options, updated_test_options, network_atlas, edge_test_result, flags) - import nla.NetworkLevelMethod + function output(obj, edge_test_options, updated_test_options, edge_test_result, flags) + % This function is here to run plots in scripting. GUI doesn't call this. - if isfield(flags, "show_nonpermuted") && flags.show_nonpermuted - test_method = "no_permutations"; - elseif isfield(flags, "show_full_conn") && flags.show_full_conn - test_method = "full_connectome"; - elseif isfield(flags, "show_within_net_pair") && flags.show_within_net_pair - test_method = "within_network_pair"; - end + nla.net.result.plot.NetworkTestPlotApp(obj, edge_test_result, flags, edge_test_options,... + updated_test_options); + + % If the above doesn't work in scripts, comment out command above and then uncomment below and use it + + % if isfield(flags, "show_nonpermuted") && flags.show_nonpermuted + % test_method = "no_permutations"; + % elseif isfield(flags, "show_full_conn") && flags.show_full_conn + % test_method = "full_connectome"; + % elseif isfield(flags, "show_within_net_pair") && flags.show_within_net_pair + % test_method = "within_network_pair"; + % end - network_result_plot = nla.net.result.plot.NetworkTestPlot(obj, edge_test_result, network_atlas,... - test_method, edge_test_options, updated_test_options); - network_result_plot.drawFigure(nla.PlotType.FIGURE) + % network_result_plot = nla.net.result.plot.NetworkTestPlot(obj, edge_test_result, edge_test_options.net_atlas,... + % test_method, edge_test_options, updated_test_options); + % network_result_plot.drawFigure(nla.PlotType.FIGURE) end function merge(obj, other_objects) diff --git a/+nla/ResultPool.m b/+nla/ResultPool.m index d66dc714..9d31e579 100755 --- a/+nla/ResultPool.m +++ b/+nla/ResultPool.m @@ -44,10 +44,10 @@ function output(obj) flags.plot_type = nla.PlotType.FIGURE; if ~islogical(obj.permutation_network_test_results) for i = 1:numel(obj.permutation_network_test_results) - obj.network_test_results{i}.output(obj.test_options, obj.network_test_options, obj.network_atlas,... + obj.network_test_results{i}.output(obj.test_options, obj.network_test_options,... obj.edge_test_results, flags); obj.permutation_network_test_results{i}.output(obj.test_options, obj.network_test_options,... - obj.network_atlas, obj.edge_test_results, flags); + obj.edge_test_results, flags); end end end diff --git a/main_pipeline.m b/main_pipeline.m index 942bc6cf..544189ac 100755 --- a/main_pipeline.m +++ b/main_pipeline.m @@ -68,7 +68,7 @@ input_struct.prob_max = 0.05; input_struct.permute_method = nla.edge.permutationMethods.BehaviorVec(); -net_input_struct = net.genBaseInputs(); +net_input_struct = nla.net.genBaseInputs(); net_input_struct.prob_max = 0.05; net_input_struct.behavior_count = 1; net_input_struct.d_max = 0.5; diff --git a/myresults.mat b/myresults.mat new file mode 100644 index 00000000..dd7592c8 Binary files /dev/null and b/myresults.mat differ