Skip to content

Commit 9026ed9

Browse files
committed
Remove 'formatted name' column.
Refs #330.
1 parent 3c83241 commit 9026ed9

File tree

3 files changed

+0
-68
lines changed

3 files changed

+0
-68
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/style/EMStyleBuilder.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public static class Columns {
8080
public static final ColumnDescriptor<String> NODE_GS_TYPE = new ColumnDescriptor<>("GS_Type", String.class);
8181
public static final String NODE_GS_TYPE_ENRICHMENT = "ENR";
8282
public static final String NODE_GS_TYPE_SIGNATURE = "SIG";
83-
public static final ColumnDescriptor<String> NODE_FORMATTED_NAME = new ColumnDescriptor<>("Formatted_name", String.class);
8483
public static final ColumnListDescriptor<String> NODE_GENES = new ColumnListDescriptor<>("Genes", String.class);
8584
public static final ColumnDescriptor<Integer> NODE_GS_SIZE = new ColumnDescriptor<>("gs_size", Integer.class);
8685

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/task/CreateEMNetworkTask.java

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ private Map<String, CyNode> createNodes(CyNetwork network) {
123123
// Set common attributes
124124
CyRow row = network.getRow(node);
125125
row.set(CyNetwork.NAME, genesetName);
126-
Columns.NODE_FORMATTED_NAME.set(row, prefix, null, formatLabel(genesetName));
127126
Columns.NODE_NAME.set(row, prefix, null, genesetName); // MKTODO why is this column needed?
128127

129128
GeneSet geneSet = map.getGeneSet(genesetName);
@@ -220,7 +219,6 @@ private CyTable createNodeColumns(CyNetwork network) {
220219
Columns.NODE_NAME.createColumn(table, prefix, null);// !
221220
Columns.NODE_GS_DESCR.createColumn(table, prefix, null);// !
222221
Columns.NODE_GS_TYPE.createColumn(table, prefix, null);// !
223-
Columns.NODE_FORMATTED_NAME.createColumn(table, prefix, null); // !
224222
Columns.NODE_GENES.createColumn(table, prefix, null); // Union of geneset genes across all datasets // !
225223
Columns.NODE_GS_SIZE.createColumn(table, prefix, null); // Size of the union // !
226224

@@ -295,66 +293,4 @@ private static double getColorScore(EnrichmentResult result) {
295293
return (-1) * (1 - result.getPvalue());
296294
}
297295

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-
}
360296
}

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/task/postanalysis/CreatePANetworkTask.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.baderlab.csplugins.enrichmentmap.model.SimilarityKey;
2121
import org.baderlab.csplugins.enrichmentmap.style.EMStyleBuilder.Columns;
2222
import org.baderlab.csplugins.enrichmentmap.style.WidthFunction;
23-
import org.baderlab.csplugins.enrichmentmap.task.CreateEMNetworkTask;
2423
import org.baderlab.csplugins.enrichmentmap.util.DiscreteTaskMonitor;
2524
import org.baderlab.csplugins.enrichmentmap.util.NetworkUtil;
2625
import org.cytoscape.event.CyEventHelper;
@@ -214,9 +213,7 @@ private void createHubNode(String hubName, CyNetwork network, CyNetworkView netV
214213

215214
network.getRow(hubNode).set(CyNetwork.NAME, hubName);
216215

217-
String formattedLabel = CreateEMNetworkTask.formatLabel(hubName);
218216
CyRow row = nodeTable.getRow(hubNode.getSUID());
219-
Columns.NODE_FORMATTED_NAME.set(row, prefix, null, formattedLabel);
220217

221218
List<String> geneList = sigGeneSet.getGenes().stream()
222219
.map(map::getGeneFromHashKey)

0 commit comments

Comments
 (0)