use of org.cytoscape.model.CyTable in project EnrichmentMapApp by BaderLab.
the class CreateEMNetworkTask method createEdgeColumns.
private CyTable createEdgeColumns(CyNetwork network) {
CyTable table = network.getDefaultEdgeTable();
Columns.EDGE_SIMILARITY_COEFF.createColumn(table, prefix, null);
Columns.EDGE_OVERLAP_SIZE.createColumn(table, prefix, null);
Columns.EDGE_DATASET.createColumn(table, prefix, null);
Columns.EDGE_OVERLAP_GENES.createColumn(table, prefix, null);
map.getParams().addSimilarityCutoffColumnName(Columns.EDGE_SIMILARITY_COEFF.with(prefix, null));
return table;
}
use of org.cytoscape.model.CyTable in project EnrichmentMapApp by BaderLab.
the class CreateEMNetworkTask method createNodeColumns.
private CyTable createNodeColumns(CyNetwork network) {
CyTable table = network.getDefaultNodeTable();
// !
Columns.NODE_NAME.createColumn(table, prefix, null);
// !
Columns.NODE_GS_DESCR.createColumn(table, prefix, null);
// !
Columns.NODE_GS_TYPE.createColumn(table, prefix, null);
// !
Columns.NODE_FORMATTED_NAME.createColumn(table, prefix, null);
// Union of geneset genes across all datasets // !
Columns.NODE_GENES.createColumn(table, prefix, null);
// Size of the union // !
Columns.NODE_GS_SIZE.createColumn(table, prefix, null);
EMCreationParameters params = map.getParams();
for (String datasetName : map.getDataSetNames()) {
Columns.NODE_PVALUE.createColumn(table, prefix, datasetName);
Columns.NODE_FDR_QVALUE.createColumn(table, prefix, datasetName);
Columns.NODE_FWER_QVALUE.createColumn(table, prefix, datasetName);
// MKTODO only create these if method is GSEA?
Columns.NODE_ES.createColumn(table, prefix, datasetName);
Columns.NODE_NES.createColumn(table, prefix, datasetName);
Columns.NODE_COLOURING.createColumn(table, prefix, datasetName);
params.addPValueColumnName(Columns.NODE_PVALUE.with(prefix, datasetName));
params.addQValueColumnName(Columns.NODE_FDR_QVALUE.with(prefix, datasetName));
}
return table;
}
use of org.cytoscape.model.CyTable in project EnrichmentMapApp by BaderLab.
the class WidthFunction method createColumns.
private void createColumns(CyNetwork network, String prefix) {
CyTable networkTable = network.getDefaultNetworkTable();
NETWORK_EDGE_WIDTH_PARAMETERS_COLUMN.createColumnIfAbsent(networkTable, null, null);
CyTable edgeTable = network.getDefaultEdgeTable();
EDGE_WIDTH_FORMULA_COLUMN.createColumnIfAbsent(edgeTable, prefix, null);
}
use of org.cytoscape.model.CyTable in project EnrichmentMapApp by BaderLab.
the class AbstractChart method getLabelsFromColumn.
@SuppressWarnings("unchecked")
public List<String> getLabelsFromColumn(final CyNetwork network, final CyIdentifiable model, final CyColumnIdentifier columnId) {
final List<String> labels = new ArrayList<>();
final CyRow row = network.getRow(model);
if (row != null && columnId != null) {
final CyTable table = row.getTable();
final CyColumn column = table.getColumn(columnId.getColumnName());
if (column != null && column.getType() == List.class) {
final Class<?> type = column.getListElementType();
final List<?> values = row.getList(columnId.getColumnName(), type);
if (type == String.class) {
labels.addAll((List<String>) values);
} else {
for (Object obj : values) labels.add(obj.toString());
}
}
}
return labels;
}
use of org.cytoscape.model.CyTable in project EnrichmentMapApp by BaderLab.
the class AbstractChart method getSingleValueColumnNames.
/**
* @return The names of the data columns or an empty list if any of the data columns is of type List.
*/
protected List<String> getSingleValueColumnNames(final CyNetwork network, final CyIdentifiable model) {
final List<String> names = new ArrayList<>();
final CyRow row = network.getRow(model);
if (row == null)
return names;
final List<CyColumnIdentifier> dataColumns = getList(DATA_COLUMNS, CyColumnIdentifier.class);
final CyTable table = row.getTable();
boolean invalid = false;
for (final CyColumnIdentifier colId : dataColumns) {
final CyColumn column = table.getColumn(colId.getColumnName());
if (column == null || column.getType() == List.class) {
// Not a single value column!
invalid = true;
break;
}
names.add(colId.getColumnName());
}
if (invalid)
names.clear();
return names;
}
Aggregations