Skip to content
Closed
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
Binary file modified +nla/+net/+result/+plot/NetworkTestPlotApp.mlapp
Binary file not shown.
5 changes: 5 additions & 0 deletions +nla/+net/+result/+plot/PermutationTestPlotter.m
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 7 additions & 1 deletion +nla/+net/+result/NetworkResultPlotParameter.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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]);
Expand Down
29 changes: 17 additions & 12 deletions +nla/+net/+result/NetworkTestResult.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions +nla/ResultPool.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion main_pipeline.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Binary file added myresults.mat
Binary file not shown.
Loading