diff --git a/+nla/+gfx/+plots/MatrixPlot.m b/+nla/+gfx/+plots/MatrixPlot.m index a43b8ee..4ca4431 100644 --- a/+nla/+gfx/+plots/MatrixPlot.m +++ b/+nla/+gfx/+plots/MatrixPlot.m @@ -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)); diff --git a/+nla/+net/+result/NetworkResultPlotParameter.m b/+nla/+net/+result/NetworkResultPlotParameter.m index f07fb17..000ab2f 100644 --- a/+nla/+net/+result/NetworkResultPlotParameter.m +++ b/+nla/+net/+result/NetworkResultPlotParameter.m @@ -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); @@ -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; @@ -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. @@ -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]); @@ -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)); @@ -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 diff --git a/+nla/+qualityControl/checkNormalityWithKS.m b/+nla/+qualityControl/checkNormalityWithKS.m index 3bb8eac..57000f4 100644 --- a/+nla/+qualityControl/checkNormalityWithKS.m +++ b/+nla/+qualityControl/checkNormalityWithKS.m @@ -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