Closed AlexanderPico closed 2 years ago
The current fix disabled scientific notation. Need to find a better way to deal with this.
We use auto sorter here, but don't know how to override it. https://github.com/cytoscape/enrichment-table-app/blob/768ed2ac45bf0510f8b0c2ba3c42e25292468e83/src/main/java/org/nrnb/gsoc/enrichment/ui/EnrichmentCytoPanel.java#L470
From Scooter:
Here are the key pieces: 1) When you create the table:
tcm.getColumn(EnrichmentTerm.fdrColumn).setCellRenderer(new DecimalFormatRenderer());
2) Add the class DecimalFormatRenderer:
static class DecimalFormatRenderer extends DefaultTableCellRenderer { private static final DecimalFormat formatter = new DecimalFormat("0.#####E0");
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
try {
if (value != null && (double) value < 0.001) {
value = formatter.format((Number) value);
}
} catch (Exception ex) {
// ignore and return original value
}
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row,
column);
}
}
>Where, as you see, we create the correct format, but the source data is actually a double value. This is in edu.ucsf.rbvi.stringApp.internal.ui.EnrichmentCytoPanel.java
@yihangx Do you think this can be fixed for v1?
@AlexanderPico I don't think so. I tried to fix with Scooter's suggestion but failed. Previous p-value fix changed a lot of code.
Fixed by #82
Manual sorting of adjusted p-values is not working.
When the table of results first appears (or when it is refreshed) the sort order is correct (using the scientific notation, e.g., E-8). But if you click on the column header to sort by adjusted p-value it is not correct (it ignores the scientific notation).
Can manual sorting be fixed to use the same comparison logic as the initial sorting?