Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions +nla/+gfx/+plots/DiagnosticPlot.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,37 @@
end
end

function displayPlots(obj, test_method)
function displayPlots(obj, ranking_algorithm)

p_value = obj.choosePlottingStatistic(test_method);

obj.network_test_options.ranking_method = "Eggebrecht";
plot_parameters = nla.net.result.NetworkResultPlotParameter(obj.networkTestResult, obj.network_atlas, obj.network_test_options);
vs_network_size_parameters = plot_parameters.plotProbabilityVsNetworkSize(test_method, p_value);
no_permutations_vs_network_parameters = plot_parameters.plotProbabilityVsNetworkSize("no_permutations", p_value);
p_value = obj.choosePlottingStatistic(ranking_algorithm);

plot_parameters = nla.net.result.NetworkResultPlotParameter(...
obj.networkTestResult, obj.network_atlas, obj.network_test_options...
);
vs_network_size_parameters = plot_parameters.plotProbabilityVsNetworkSize(ranking_algorithm, p_value);
no_permutations_vs_network_parameters = plot_parameters.plotProbabilityVsNetworkSize(...
"no_permutations", p_value...
);
p_value_histogram = obj.networkTestResult.createHistogram(p_value);

non_permuted_title = sprintf("Non-permuted P-values vs.\nNetwork-Pair Size");
permuted_title = sprintf("Permuted P-values vs Network-Pair Size");

plotter = nla.net.result.plot.PermutationTestPlotter(obj.network_atlas);
if test_method == "no_permutations"
nla.gfx.createFigure(500, 500);
plotter.plotProbabilityVsNetworkSize(vs_network_size_parameters, subplot(1, 1, 1), non_permuted_title);
else
nla.gfx.createFigure(1200, 500);
p_value_histogram = obj.networkTestResult.createHistogram(p_value);
plotter.plotProbabilityHistogram(subplot(1, 3, 1), p_value_histogram, obj.networkTestResult.full_connectome.p_value.v, obj.networkTestResult.permutation_results.p_value_permutations.v(:, 1), obj.networkTestResult.test_display_name, obj.network_test_options.prob_max);
plotter.plotProbabilityVsNetworkSize(no_permutations_vs_network_parameters, subplot(1, 3, 2), non_permuted_title);
plotter.plotProbabilityVsNetworkSize(vs_network_size_parameters, subplot(1, 3, 3), permuted_title);
if isequal(ranking_algorithm, "no_permutations")
nla.gfx.createFigure(500, 500);
plotter.plotProbabilityVsNetworkSize(vs_network_size_parameters, subplot(1, 1, 1), non_permuted_title);
return
end
nla.gfx.createFigure(1200, 500);
p_value_histogram = obj.networkTestResult.createHistogram(p_value);
plotter.plotProbabilityHistogram(...
subplot(1, 3, 1), p_value_histogram, obj.networkTestResult.full_connectome.p_value.v,...
obj.networkTestResult.permutation_results.p_value_permutations.v(:, 1),...
obj.networkTestResult.test_display_name, obj.network_test_options.prob_max...
);
plotter.plotProbabilityVsNetworkSize(no_permutations_vs_network_parameters, subplot(1, 3, 2), non_permuted_title);
plotter.plotProbabilityVsNetworkSize(vs_network_size_parameters, subplot(1, 3, 3), permuted_title);
end
end

Expand Down
2 changes: 1 addition & 1 deletion +nla/+net/genBaseInputs.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'full_connectome', true,...
'within_network_pair', true,...
'prob_plot_method',nla.gfx.ProbPlotMethod.DEFAULT,...
'ranking_method', nla.RankingMethod.P_VALUE,...
'ranking_method', "Eggebrecht",...
'edge_chord_plot_method', nla.gfx.EdgeChordPlotMethod.PROB,...
'fdr_correction', nla.net.mcc.Bonferroni(),...
'd_thresh_chord_plot', true...
Expand Down
6 changes: 0 additions & 6 deletions +nla/RankingMethod.m

This file was deleted.

55 changes: 0 additions & 55 deletions +nla/rankingTestScript.m

This file was deleted.

Binary file modified NLAResult.mlapp
Binary file not shown.
6 changes: 6 additions & 0 deletions NLAResult_exported.m
Original file line number Diff line number Diff line change
Expand Up @@ -482,15 +482,21 @@ function OpenTriMatrixPlotButtonPushed(app, event)

% Button pushed function: OpenDiagnosticPlotsButton
function OpenDiagnosticPlotsButtonPushed(app, event)
prog = uiprogressdlg(app.UIFigure, 'Title', sprintf('Generating Diagnostic Plots'), 'Message', sprintf('Generating Diagnostic Plots'));
prog.Value = 0.02;
drawnow;

selected_nodes = app.ResultTree.SelectedNodes;
for i = 1:size(selected_nodes, 1)
if ~isempty(selected_nodes(i).NodeData)
result = selected_nodes(i).NodeData{1};
node_flags = selected_nodes(i).NodeData{2};

result.runDiagnosticPlots(app.input_struct, app.net_input_struct, app.edge_result, app.input_struct.net_atlas, node_flags);
prog.Value = i / size(selected_nodes, 1);
end
end
close(prog)
end

% Callback function
Expand Down