3434 plot_scale % The scale and values being plotted (Linear, log, -log10, p-value, statistic p-value)
3535 current_settings % the settings for the plot (upper, lower, scale)
3636 display_legend
37+ p_value_max
3738 end
3839
3940 properties (Dependent )
111112 addParameter(matrix_input_parser , ' y_position' , 0 , validNumberInput );
112113 addParameter(matrix_input_parser , ' discrete_colorbar' , false , @islogical );
113114 addParameter(matrix_input_parser , ' plot_scale' , nla .gfx .ProbPlotMethod .DEFAULT );
115+ addParameter(matrix_input_parser , ' p_value_max' , 0.05 )
114116
115117 parse(matrix_input_parser , figure , name , matrix , networks , figure_size , varargin{: });
116118 properties = {' figure' , ' name' , ' matrix' , ' networks' , ' figure_size' , ' network_clicked_callback' ,...
117119 ' marked_networks' , ' figure_margins' , ' draw_legend' , ' draw_colorbar' , ' color_map' , ' lower_limit' ,...
118- ' upper_limit' , ' x_position' , ' y_position' , ' discrete_colorbar' , ' plot_scale' };
120+ ' upper_limit' , ' x_position' , ' y_position' , ' discrete_colorbar' , ' plot_scale' , ' p_value_max ' };
119121 for property = properties
120122 obj.(property{1 }) = matrix_input_parser .Results.(property{1 });
121123 if property{1 } == " marked_networks"
@@ -179,7 +181,7 @@ function displayImage(obj)
179181
180182 end
181183
182- function applyScale(obj , ~, ~, upper_limit_box , lower_limit_box , scale , color_map_select )
184+ function applyScale(obj , ~, ~, upper_limit_box , lower_limit_box , old_scale , new_scale , color_map_select )
183185 % This callback gets the colormap/scale and then applies the new bounds to the data.
184186 % Only works with APPLY button, will not work with only CLOSE
185187
@@ -197,49 +199,50 @@ function applyScale(obj, ~, ~, upper_limit_box, lower_limit_box, scale, color_ma
197199 end
198200
199201 if isnumeric(upper_limit_box )
200- upper_limit = upper_limit_box ;
202+ obj. upper_limit = upper_limit_box ;
201203 else
202- upper_limit = get(upper_limit_box , " String" );
204+ obj. upper_limit = get(upper_limit_box , " String" );
203205 end
204206
205207 if isnumeric(lower_limit_box )
206- lower_limit = lower_limit_box ;
208+ obj. lower_limit = lower_limit_box ;
207209 else
208- lower_limit = get(lower_limit_box , " String" );
210+ obj. lower_limit = get(lower_limit_box , " String" );
209211 end
210212
211213 if ~isstring(obj .plot_scale )
212214 obj.plot_scale = char(obj .plot_scale );
213215 end
214216
215217 obj.matrix = obj .original_matrix ;
216- if ismember(obj .plot_scale , [" nla.ProbPlotMethod.NEGATIVE_LOG_10" , " nla.ProbPlotMethod.NEGATIVE_LOG_STATISTIC" ]) && ...
217- ismember(scale , [" nla.ProbPlotMethod.DEFAULT" , " nla.ProbPlotMethod.LOG" ])
218- obj.matrix.v = 10 .^(-obj .matrix .v );
219-
220- elseif ~ismember(obj .plot_scale , [" nla.ProbPlotMethod.NEGATIVE_LOG_10" , " nla.ProbPlotMethod.NEGATIVE_LOG_STATISTIC" ]) && ...
221- ~ismember(scale , [" nla.ProbPlotMethod.DEFAULT" , " nla.ProbPlotMethod.LOG" ])
218+ if ismember(old_scale , [" nla.gfx.ProbPlotMethod.NEGATIVE_LOG_10" , " nla.gfx.ProbPlotMethod.NEGATIVE_LOG_STATISTIC" ]) && ...
219+ ismember(new_scale , [" nla.gfx.ProbPlotMethod.DEFAULT" , " nla.gfx.ProbPlotMethod.LOG" ])
220+ % obj.matrix.v = 10.^(-obj.matrix.v);
221+ obj.lower_limit = 0 ;
222+ obj.upper_limit = obj .p_value_max ;
223+ elseif ~ismember(old_scale , [" nla.gfx.ProbPlotMethod.NEGATIVE_LOG_10" , " nla.gfx.ProbPlotMethod.NEGATIVE_LOG_STATISTIC" ]) && ...
224+ ~ismember(new_scale , [" nla.gfx.ProbPlotMethod.DEFAULT" , " nla.gfx.ProbPlotMethod.LOG" ])
222225 obj.matrix.v = - log10(obj .matrix .v );
223- lower_limit = 0 ;
224- upper_limit = 2 ;
226+ obj. lower_limit = 0 ;
227+ obj. upper_limit = 2 ;
225228 end
226229
227230 discrete_colors = NetworkResultPlotParameter().default_discrete_colors;
228231
229- if scale == " nla.ProbPlotMethod.DEFAULT"
230- new_color_map = NetworkResultPlotParameter .getColormap(discrete_colors , upper_limit , color_map );
231- obj.plot_scale = scale ;
232- elseif scale == " nla.ProbPlotMethod.LOG"
233- new_color_map = NetworkResultPlotParameter .getLogColormap(discrete_colors , obj .matrix , upper_limit , color_map );
234- obj.plot_scale = scale ;
232+ if new_scale == " nla.gfx .ProbPlotMethod.DEFAULT"
233+ new_color_map = NetworkResultPlotParameter .getColormap(discrete_colors , obj . upper_limit , color_map );
234+ obj.plot_scale = new_scale ;
235+ elseif new_scale == " nla.gfx .ProbPlotMethod.LOG"
236+ new_color_map = NetworkResultPlotParameter .getLogColormap(discrete_colors , obj .matrix , obj . upper_limit , color_map );
237+ obj.plot_scale = new_scale ;
235238 else
236239 color_map_name = str2func(lower(color_map ));
237240 new_color_map = color_map_name(discrete_colors );
238- obj.plot_scale = " nla.ProbPlotMethod.NEGATIVE_LOG_10" ;
241+ obj.plot_scale = " nla.gfx. ProbPlotMethod.NEGATIVE_LOG_10" ;
239242 end
240243 obj.color_map = new_color_map ;
241- obj .embiggenMatrix(lower_limit , upper_limit );
242- obj .createColorbar(lower_limit , upper_limit );
244+ obj .embiggenMatrix(obj . lower_limit , obj . upper_limit );
245+ obj .createColorbar(obj . lower_limit , obj . upper_limit );
243246 end
244247
245248 function createLegend(obj )
0 commit comments