You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/actions/EnrichmentMapActionListener.java
//both the max and min are probably negative values
193
255
//JOptionPane.showMessageDialog(Cytoscape.getDesktop(),"Both the max and min expression are negative, log of negative numbers is not valid", "log normalization error", JOptionPane.WARNING_MESSAGE);
194
256
min = 0;
195
257
max = 0;
196
258
}
197
259
//if min expression is negative then use the max expression as the max
198
-
elseif(minExpression <= 0){
199
-
min = Math.min(Math.log(closestToZeroExpression), Math.log1p(maxExpression));
200
-
max = Math.max(Math.log(closestToZeroExpression), Math.log1p(maxExpression));
260
+
elseif(minExpression_ds1 <= 0){
261
+
min = Math.min(Math.log(closestToZeroExpression_ds1), Math.log1p(maxExpression_ds1));
262
+
max = Math.max(Math.log(closestToZeroExpression_ds1), Math.log1p(maxExpression_ds1));
201
263
}
202
264
//if the max expression is negative then use the min expression as the max (should never happen!)
203
-
elseif(maxExpression <= 0){
265
+
elseif(maxExpression_ds1 <= 0){
204
266
min = 0;
205
-
max = Math.log1p(minExpression);
267
+
max = Math.log1p(minExpression_ds1);
206
268
}
207
269
else{
208
-
min = Math.log1p(minExpression);
209
-
max = Math.log1p(maxExpression) ;
270
+
min = Math.log1p(minExpression_ds1);
271
+
max = Math.log1p(maxExpression_ds1) ;
210
272
max = Math.max(Math.abs(min),max);
211
273
}
212
274
213
275
break;
214
276
215
277
caseASIS:
216
278
default:
217
-
min = minExpression;
218
-
max = Math.max(Math.abs(minExpression), maxExpression);
279
+
min = minExpression_ds1;
280
+
max = Math.max(Math.abs(minExpression_ds1), maxExpression_ds1);
219
281
break;
220
282
}
221
283
222
284
median = max/2;
223
285
if(min >= 0){
224
286
median = max/2;
225
-
range = ColorGradientRange.getInstance(0,median, median,max, 0,median,median,max);
* Reset color gradients based on a change in the data transformation.
300
+
*/
301
+
publicvoidResetColorGradient_ds2(){
302
+
doublemin;
303
+
doublemax;
304
+
doublemedian;
305
+
306
+
switch(transformation){
307
+
caseROWNORM:
308
+
min = minExpression_rownorm_ds2;
309
+
max = maxExpression_rownorm_ds2;
310
+
311
+
//if both row normalization values are zero, can't perform row normalization
312
+
//issue warning
313
+
//This happens when there is only one data column in the dataset (or if it is rank file)
314
+
if((min == 0) && (max == 0)){
315
+
//JOptionPane.showMessageDialog(Cytoscape.getDesktop(),"Row normalization does not work with only one data column per dataset.","Row normalization error",JOptionPane.WARNING_MESSAGE);
316
+
}
317
+
max = Math.max(Math.abs(min),max);
318
+
break;
319
+
320
+
caseLOGTRANSFORM:
321
+
322
+
//can't take a log of a negative number
323
+
//if both the max and min are negative then log tranform won't work.
//both the max and min are probably negative values
327
+
//JOptionPane.showMessageDialog(Cytoscape.getDesktop(),"Both the max and min expression are negative, log of negative numbers is not valid", "log normalization error", JOptionPane.WARNING_MESSAGE);
328
+
min = 0;
329
+
max = 0;
330
+
}
331
+
//if min expression is negative then use the max expression as the max
332
+
elseif(minExpression_ds2 <= 0){
333
+
min = Math.min(Math.log(closestToZeroExpression_ds2), Math.log1p(maxExpression_ds2));
334
+
max = Math.max(Math.log(closestToZeroExpression_ds2), Math.log1p(maxExpression_ds2));
335
+
}
336
+
//if the max expression is negative then use the min expression as the max (should never happen!)
337
+
elseif(maxExpression_ds2 <= 0){
338
+
min = 0;
339
+
max = Math.log1p(minExpression_ds2);
340
+
}
341
+
else{
342
+
min = Math.log1p(minExpression_ds2);
343
+
max = Math.log1p(maxExpression_ds2) ;
344
+
max = Math.max(Math.abs(min),max);
345
+
}
346
+
347
+
break;
348
+
349
+
caseASIS:
350
+
default:
351
+
min = minExpression_ds2;
352
+
max = Math.max(Math.abs(minExpression_ds2), maxExpression_ds2);
0 commit comments