本文整理汇总了Java中org.cytoscape.model.CyTable.getColumn方法的典型用法代码示例。如果您正苦于以下问题:Java CyTable.getColumn方法的具体用法?Java CyTable.getColumn怎么用?Java CyTable.getColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cytoscape.model.CyTable
的用法示例。
在下文中一共展示了CyTable.getColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSafeColumns
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
public static void checkSafeColumns(CyTable table) {
CyColumn column = table.getColumn(StyleFactory.HIGHLIGHT_COLUMN);
if (column == null) {
table.createColumn(StyleFactory.HIGHLIGHT_COLUMN, Double.class, false, 0D);
}
column = table.getColumn(StyleFactory.COLOR_COLUMN);
if (column == null) {
table.createColumn(StyleFactory.COLOR_COLUMN, String.class, false, null);
}
column = table.getColumn(StyleFactory.BRIGHTNESSS_COLUMN);
if (column == null) {
table.createColumn(StyleFactory.BRIGHTNESSS_COLUMN, Double.class, false, 0D);
}
}
示例2: set
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
public static void set(CyNetwork network, CyIdentifiable entry, String tableName, String name, Object value, Class<?> type) {
CyRow row = network.getRow(entry, tableName);
CyTable table = row.getTable();
CyColumn column = table.getColumn(name);
if (value != null) {
if (column == null) {
if (value instanceof List) {
table.createListColumn(name, type, false);
}
else if (value instanceof Collection) {
throw new IllegalArgumentException("Arrt. values collection is not a List: "
+ value.getClass().getSimpleName());
}
else {
table.createColumn(name, type, false);
}
}
row.set(name, value);
}
}
示例3: setEdgeAttribute
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
@Override
protected void setEdgeAttribute(CyEdge edge, String colName, Object value)
{
if (value == null) return; //ignore
if (value instanceof RdfNode) { value = value.toString(); }
CyTable table = myNet.getDefaultEdgeTable();
if (table.getColumn(colName) == null)
{
table.createColumn(colName, value.getClass(), true);
}
try
{
table.getRow(edge.getSUID()).set(colName, value);
}
catch (IllegalStateException e)
{
// class cast problem when sparql result does not match column class.
// TODO...
e.printStackTrace();
}
}
示例4: addProperties
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
public static void addProperties(Long suid, CyTable table,Map<String,Object> props){
for(Entry<String,Object> obj : props.entrySet()){
if(table.getColumn(obj.getKey()) == null){
if(obj.getValue().getClass() == ArrayList.class){
table.createListColumn(obj.getKey(), CyUtils.getArrayListType((ArrayList)obj.getValue()), false);
} else {
table.createColumn(obj.getKey(), obj.getValue().getClass(), false);
}
}
CyUtils.addValueToTable(suid,obj.getKey(),obj.getValue(),table);
}
}
示例5: set
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
public static void set(CyNetwork network, CyIdentifiable entry, String tableName, String name, Object value, Class<?> type) {
CyRow row = network.getRow(entry, tableName);
CyTable table = row.getTable();
CyColumn column = table.getColumn(name);
if (value != null) {
if (column == null) {
if (value instanceof List) {
table.createListColumn(name, type, false);
}
else if (value instanceof Collection) {
throw new IllegalArgumentException("Attribute value is a Collection and not List: "
+ value.getClass().getSimpleName());
}
else {
table.createColumn(name, type, false);
}
}
row.set(name, value);
}
}
示例6: checkColumn
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
private void checkColumn(CyTable table,
String name,
Class<?> type) {
CyColumn column = table.getColumn(name);
if (column == null) {
table.createColumn(name, type, false);
}
}
示例7: aggregateAttributes
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
private void aggregateAttributes(CyNetwork originNetwork, SummaryNetwork summaryNetwork) {
CyTable originNodeTable = originNetwork.getDefaultNodeTable();
CyTable summaryNodeTable = summaryNetwork.network.getDefaultNodeTable();
summaryNodeTable.createColumn("cluster node count", Integer.class, false);
List<String> columnsToAggregate = new ArrayList<>();
for(CyColumn column : originNodeTable.getColumns()) {
String name = column.getName();
if(summaryNodeTable.getColumn(name) == null) {
columnsToAggregate.add(name);
Class<?> listElementType = column.getListElementType();
if(listElementType == null) {
summaryNodeTable.createColumn(name, column.getType(), false);
}
else {
summaryNodeTable.createListColumn(name, listElementType, false);
}
}
}
for(SummaryCluster cluster : summaryNetwork.getClusters()) {
CyNode summaryNode = summaryNetwork.getNodeFor(cluster);
CyRow row = summaryNodeTable.getRow(summaryNode.getSUID());
row.set("name", cluster.getLabel());
row.set("cluster node count", cluster.getNodes().size());
for(String columnName : columnsToAggregate) {
Object result = aggregate(originNetwork, cluster, columnName);
row.set(columnName, result);
}
}
}
示例8: run
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage("Calculating clusterMaker edgeCutOff attribute.");
CyTable table = network.getDefaultEdgeTable();
CyColumn column = table.getColumn(edgeAttribute);
double min = Double.MAX_VALUE;
boolean updated = false;
if(column != null) {
Class<?> type = column.getType();
if(Number.class.isAssignableFrom(type)) {
for(CyRow row : table.getAllRows()) {
Number value = (Number) row.get(edgeAttribute, type);
if(value != null) {
double doubleValue = value.doubleValue();
if(Double.isFinite(doubleValue)) {
min = Math.min(doubleValue, min);
updated = true;
}
}
}
}
}
result = updated ? min : null;
}
示例9: addVirtualColumn
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
private void addVirtualColumn (CyColumn col, CyTable subTable){
VirtualColumnInfo colInfo = col.getVirtualColumnInfo();
CyColumn checkCol= subTable.getColumn(col.getName());
if (checkCol == null)
subTable.addVirtualColumn(col.getName(), colInfo.getSourceColumn(), colInfo.getSourceTable(),
colInfo.getTargetJoinKey(), col.isImmutable());
else
if (!checkCol.getVirtualColumnInfo().isVirtual() ||
!checkCol.getVirtualColumnInfo().getSourceTable().equals(colInfo.getSourceTable()) ||
!checkCol.getVirtualColumnInfo().getSourceColumn().equals(colInfo.getSourceColumn()))
subTable.addVirtualColumn(col.getName(), colInfo.getSourceColumn(), colInfo.getSourceTable(),
colInfo.getTargetJoinKey(), col.isImmutable());
}
示例10: getColumnName
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
private String getColumnName() {
CyTable table = network.getDefaultNodeTable();
final String originalName = algorithm.getColumnName();
String name = originalName;
int suffix = 2;
while(table.getColumn(name) != null && table.getColumn(name).isImmutable()) {
name = originalName + "_" + (suffix++);
}
return name;
}
示例11: createNodeAttributeIfNotExists
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
private void createNodeAttributeIfNotExists(String colName)
{
CyTable table = myNet.getDefaultNodeTable();
if (table.getColumn(colName) == null)
{
table.createColumn(colName, String.class, true);
}
}
示例12: getOrCreateListColumn
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
public static CyColumn getOrCreateListColumn(String name, Class<?> type, boolean immutable, CyTable table) {
if (name == null) throw new NullPointerException("name cannot be null");
if (type == null) throw new NullPointerException("type cannot be null");
if (table == null) throw new NullPointerException("table cannot be null");
CyColumn column = table.getColumn(name);
if (column == null) {
table.createListColumn(name, type, immutable);
column = table.getColumn(name);
}
return column;
}
示例13: minScoreThreshold
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
private Double minScoreThreshold() {
String proteinGraphName = proteinGraph.getSelectedItem().toString();
if (proteinGraphName.equals(" - Select Network - ")) {
JOptionPane.showMessageDialog(this, "Please select a protein graph under 'Search'");
} else {
CyNetwork nw = null;
for (CyNetwork network: CyActivator.networkManager.getNetworkSet()) {
if (network.getRow(network).get(CyNetwork.NAME, String.class).equals(proteinGraphName)) {
nw = network;
break;
}
}
CyTable nodeTable = nw.getDefaultEdgeTable();
if(nodeTable.getColumn("weight") != null) {
// Network has weight column
CyColumn column = nodeTable.getColumn("weight");
List<Double> values = column.getValues(Double.class);
Double avgWeight = 0.0;
for (Double value : values) {
avgWeight += value;
}
avgWeight = avgWeight / values.size();
return avgWeight * Integer.valueOf(minSize.getText()) / 10;
} else {
// No weight column
return 0.5;
}
}
return -1.0;
}
示例14: ensemblGeneIds
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
/**
* Return zero or more Ensembl gene ids from the specified Ensembl gene id column for the specified node.
*
* @param node node
* @param network network
* @param ensemblGeneIdColumn Ensembl gene id column
* @return zero or more Ensembl gene ids from the specified Ensembl gene id column for the specified node
*/
static Iterable<String> ensemblGeneIds(final CyNode node, final CyNetwork network, final String ensemblGeneIdColumn)
{
CyTable table = network.getDefaultNodeTable();
CyRow row = table.getRow(node.getSUID());
CyColumn column = table.getColumn(ensemblGeneIdColumn);
if (column != null)
{
Class<?> columnClass = column.getType();
if (String.class.equals(columnClass))
{
String ensemblGeneId = row.get(ensemblGeneIdColumn, String.class);
if (ensemblGeneId != null)
{
return ImmutableList.of(ensemblGeneId);
}
}
else if (columnClass.equals(List.class))
{
Class<?> listClass = column.getListElementType();
if (String.class.equals(listClass))
{
return row.getList(ensemblGeneIdColumn, String.class);
}
}
}
return Collections.<String>emptyList();
}
示例15: addCount
import org.cytoscape.model.CyTable; //导入方法依赖的package包/类
/**
* Add the specified count in the specified column name to the specified node.
*
* @param node node
* @param network network
* @param columnName column name
* @param count count
*/
static void addCount(final CyNode node, final CyNetwork network, final String columnName, final int count)
{
CyTable table = network.getDefaultNodeTable();
CyRow row = table.getRow(node.getSUID());
if (table.getColumn(columnName) == null)
{
table.createColumn(columnName, Integer.class, false);
}
// todo: or add to current value
row.set(columnName, count);
}