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
4 changes: 2 additions & 2 deletions +nla/+gfx/+plots/MatrixPlot.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ function applyScale(obj, ~, ~, upper_limit_box, lower_limit_box, old_scale, new_

if new_scale == "nla.gfx.ProbPlotMethod.DEFAULT"
if ~isequal(color_map, false)
new_color_map = NetworkResultPlotParameter.getColormap(discrete_colors, obj.upper_limit, color_map);
new_color_map = NetworkResultPlotParameter.getColormap(discrete_colors, obj.upper_limit, color_map, obj.app_plot);
else
new_color_map = obj.color_map;
end
obj.plot_scale = new_scale;
elseif new_scale == "nla.gfx.ProbPlotMethod.LOG"
new_color_map = NetworkResultPlotParameter.getLogColormap(discrete_colors, obj.matrix, obj.upper_limit, color_map);
new_color_map = NetworkResultPlotParameter.getLogColormap(discrete_colors, obj.matrix, obj.upper_limit, color_map, obj.app_plot);
obj.plot_scale = new_scale;
else
color_map_name = str2func(lower(color_map));
Expand Down
18 changes: 11 additions & 7 deletions +nla/+net/+result/NetworkResultPlotParameter.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
switch obj.updated_test_options.prob_plot_method
case "LOG"
color_map = nla.net.result.NetworkResultPlotParameter.getLogColormap(obj.default_discrete_colors,...
statistic_input, p_value_max);
statistic_input, p_value_max, true);
% Here we take a -log10 and change the maximum value to show on the plot
case "NEGATIVE_LOG_10"
color_map = parula(obj.default_discrete_colors);
Expand All @@ -97,7 +97,7 @@
significance_type = "nla.gfx.SigType.INCREASING";
otherwise
color_map = nla.net.result.NetworkResultPlotParameter.getColormap(obj.default_discrete_colors,...
p_value_max);
p_value_max, true);
end
else
ranking_statistic = obj.network_test_results.ranking_statistic;
Expand All @@ -111,7 +111,7 @@
% color_map
significance_type = "nla.gfx.SigType.DECREASING";
color_map = nla.net.result.NetworkResultPlotParameter.getColormap(obj.default_discrete_colors,...
p_value_plot_max);
p_value_plot_max, true);
end

% callback function for brain image.
Expand Down Expand Up @@ -225,7 +225,7 @@ function brainFigureButtonCallback(network1, network2)
end

methods(Static)
function color_map = getLogColormap(default_discrete_colors, probabilities_input, p_value_max, color_map)
function color_map = getLogColormap(default_discrete_colors, probabilities_input, p_value_max, color_map, white_out)
log_minimum = log10(min(nonzeros(probabilities_input.v)));
log_minimum = max([-40, log_minimum]);

Expand All @@ -240,13 +240,15 @@ function brainFigureButtonCallback(network1, network2)
if p_value_max ~= 0
color_map = flip(color_map_base(ceil(logspace(log_minimum, 0, default_discrete_colors) .*...
default_discrete_colors), :));
color_map = [color_map; default_color_map];
if white_out
color_map = [color_map; default_color_map];
end
else
color_map = default_color_map;
end
end

function color_map = getColormap(default_discrete_colors, p_value_max, color_map)
function color_map = getColormap(default_discrete_colors, p_value_max, color_map, white_out)
color_map_base = parula(default_discrete_colors);
if nargin > 2
color_map_name = str2func(lower(color_map));
Expand All @@ -258,7 +260,9 @@ function brainFigureButtonCallback(network1, network2)
color_map = default_color_map;
else
color_map = flip(color_map_base);
color_map = [color_map; default_color_map];
if white_out
color_map = [color_map; default_color_map];
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion +nla/+qualityControl/checkNormalityWithKS.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function qcKSOutput(ks_result_p_value, edge_test_options, remove_index)
[~, p_value_max] = network_test_options.fdr_correction.correct(network_atlas, edge_test_options, ks_result_p_value);

color_map = nla.net.result.NetworkResultPlotParameter.getColormap(default_discrete_colors,...
p_value_max);
p_value_max, true);

fig = nla.gfx.createFigure();
% Also remember to move this in read the docs
Expand Down
Loading