use of org.cytoscape.model.CyTable in project EnrichmentMapApp by BaderLab.
the class BaseIntegrationTest method assertTablesEqual.
public void assertTablesEqual(CyTable expectedTable, CyTable actualTable, boolean edgeTable, Set<String> columnsToIgnore) {
List<CyColumn> expectedColumns = new ArrayList<>(expectedTable.getColumns());
// Remove columns to ignore
expectedColumns = expectedColumns.stream().filter(c -> !columnsToIgnore.contains(c.getName())).filter(c -> !CyNetwork.SUID.equals(c.getName())).collect(Collectors.toList());
// Test columns are the same
for (CyColumn expectedColumn : expectedColumns) {
String name = expectedColumn.getName();
// if(!CyNetwork.SUID.equals(name)) {
CyColumn actualColumn = actualTable.getColumn(name);
assertNotNull("Column '" + name + "' does not exist", actualColumn);
assertEquals("Column '" + name + "' is wrong type", expectedColumn.getType(), actualColumn.getType());
// }
}
List<CyRow> expectedRows = expectedTable.getAllRows();
List<CyRow> actualRows = actualTable.getAllRows();
assertEquals("Tables are not the same size", expectedRows.size(), actualRows.size());
if (edgeTable) {
assertEdgeTableRowsEqual(expectedColumns, expectedRows, actualRows);
} else {
// node table or other table
// need to sort both Lists
sort(expectedColumns, expectedRows);
sort(expectedColumns, actualRows);
for (int i = 0; i < expectedRows.size(); i++) {
CyRow expectedRow = expectedRows.get(i);
CyRow actualRow = actualRows.get(i);
assertAttributesEqual(expectedColumns, expectedRow, actualRow);
}
}
}
use of org.cytoscape.model.CyTable in project EnrichmentMapApp by BaderLab.
the class CreateDiseaseSignatureNetworkTask method createNodeColumns.
/**
* Create Node attribute table with post analysis parameters not in the main EM table
*/
private CyTable createNodeColumns(CyNetwork network, String name, String prefix) {
CyTable table = network.getDefaultNodeTable();
Columns.NODE_ENR_GENES.createColumnIfAbsent(table, prefix, null);
Columns.NODE_GS_SIZE.createColumnIfAbsent(table, prefix, null);
return table;
}
use of org.cytoscape.model.CyTable in project EnrichmentMapApp by BaderLab.
the class CreateDiseaseSignatureNetworkTask method createEdgeColumns.
// create the edge attribue table
private CyTable createEdgeColumns(CyNetwork network, String name, String prefix) {
CyTable table = network.getDefaultEdgeTable();
//check to see if column exists. If it doesn't then create it
Columns.EDGE_HYPERGEOM_PVALUE.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_HYPERGEOM_U.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_HYPERGEOM_N.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_HYPERGEOM_K.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_HYPERGEOM_M.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_HYPERGEOM_CUTOFF.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_MANN_WHIT_TWOSIDED_PVALUE.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_MANN_WHIT_GREATER_PVALUE.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_MANN_WHIT_LESS_PVALUE.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_MANN_WHIT_CUTOFF.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_CUTOFF_TYPE.createColumnIfAbsent(table, prefix, null);
Columns.EDGE_SIG_DATASET.createColumnIfAbsent(table, prefix, null);
return table;
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class GroupUtils method getPosition.
public static Dimension getPosition(CyNetwork net, CyGroup group, Long suid, Class tableClass) {
CyTable table = group.getGroupNetwork().getTable(tableClass, CyNetwork.HIDDEN_ATTRS);
CyRow row = table.getRow(suid);
int index = getNetworkIndex(row, net);
Dimension d = getDimension(row, index);
return d;
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class RowListTunableHandler method processArg.
public Object processArg(String arg) throws Exception {
RowList bi = (RowList) getValue();
CyTable table = bi.getTable();
List<CyRow> value = stringHandler.getRowList(table, arg);
bi.setValue(value);
return bi;
}
Aggregations