@@ -123,7 +123,6 @@ private Map<String, CyNode> createNodes(CyNetwork network) {
123
123
// Set common attributes
124
124
CyRow row = network .getRow (node );
125
125
row .set (CyNetwork .NAME , genesetName );
126
- Columns .NODE_FORMATTED_NAME .set (row , prefix , null , formatLabel (genesetName ));
127
126
Columns .NODE_NAME .set (row , prefix , null , genesetName ); // MKTODO why is this column needed?
128
127
129
128
GeneSet geneSet = map .getGeneSet (genesetName );
@@ -220,7 +219,6 @@ private CyTable createNodeColumns(CyNetwork network) {
220
219
Columns .NODE_NAME .createColumn (table , prefix , null );// !
221
220
Columns .NODE_GS_DESCR .createColumn (table , prefix , null );// !
222
221
Columns .NODE_GS_TYPE .createColumn (table , prefix , null );// !
223
- Columns .NODE_FORMATTED_NAME .createColumn (table , prefix , null ); // !
224
222
Columns .NODE_GENES .createColumn (table , prefix , null ); // Union of geneset genes across all datasets // !
225
223
Columns .NODE_GS_SIZE .createColumn (table , prefix , null ); // Size of the union // !
226
224
@@ -295,66 +293,4 @@ private static double getColorScore(EnrichmentResult result) {
295
293
return (-1 ) * (1 - result .getPvalue ());
296
294
}
297
295
298
-
299
- /**
300
- * Wrap label
301
- *
302
- * @param label - current one line representation of label
303
- * @return formatted, wrapped label
304
- */
305
- public static String formatLabel (String label ) {
306
- final int maxNodeLabelLength = 15 ;
307
- String formattedLabel = "" ;
308
-
309
- int i = 0 ;
310
- int k = 1 ;
311
-
312
- //only wrap at spaces
313
- String [] tokens = label .split (" " );
314
- //first try and wrap label based on spacing
315
- if (tokens .length > 1 ) {
316
- int current_count = 0 ;
317
- for (int j = 0 ; j < tokens .length ; j ++) {
318
- if (current_count + tokens [j ].length () <= maxNodeLabelLength ) {
319
- formattedLabel = formattedLabel + tokens [j ] + " " ;
320
- current_count = current_count + tokens [j ].length ();
321
- } else if (current_count + tokens [j ].length () > maxNodeLabelLength ) {
322
- formattedLabel = formattedLabel + "\n " + tokens [j ] + " " ;
323
- current_count = tokens [j ].length ();
324
- }
325
- }
326
- } else {
327
- tokens = label .split ("_" );
328
-
329
- if (tokens .length > 1 ) {
330
- int current_count = 0 ;
331
- for (int j = 0 ; j < tokens .length ; j ++) {
332
- if (j != 0 )
333
- formattedLabel = formattedLabel + "_" ;
334
- if (current_count + tokens [j ].length () <= maxNodeLabelLength ) {
335
- formattedLabel = formattedLabel + tokens [j ];
336
- current_count = current_count + tokens [j ].length ();
337
- } else if (current_count + tokens [j ].length () > maxNodeLabelLength ) {
338
- formattedLabel = formattedLabel + "\n " + tokens [j ];
339
- current_count = tokens [j ].length ();
340
- }
341
- }
342
- }
343
-
344
- //if there is only one token wrap it anyways.
345
- else if (tokens .length == 1 ) {
346
- while (i <= label .length ()) {
347
-
348
- if (i + maxNodeLabelLength > label .length ())
349
- formattedLabel = formattedLabel + label .substring (i , label .length ()) + "\n " ;
350
- else
351
- formattedLabel = formattedLabel + label .substring (i , k * maxNodeLabelLength ) + "\n " ;
352
- i = (k * maxNodeLabelLength );
353
- k ++;
354
- }
355
- }
356
- }
357
-
358
- return formattedLabel ;
359
- }
360
296
}
0 commit comments