• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CyColumn类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.cytoscape.model.CyColumn的典型用法代码示例。如果您正苦于以下问题:Java CyColumn类的具体用法?Java CyColumn怎么用?Java CyColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CyColumn类属于org.cytoscape.model包,在下文中一共展示了CyColumn类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkSafeColumns

import org.cytoscape.model.CyColumn; //导入依赖的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);
    }
}
 
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:17,代码来源:SafeUtil.java


示例2: set

import org.cytoscape.model.CyColumn; //导入依赖的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);
	}
}
 
开发者ID:cytoscape,项目名称:biopax,代码行数:21,代码来源:AttributeUtil.java


示例3: addColumnName

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
/**
 * Adds a column to the current network settings.
 * 
 * @param network
 * @param addedColumnName
 */
public void addColumnName(CyNetwork network, String addedColumnName) {
	CyColumn c = network.getDefaultNodeTable().getColumn(addedColumnName);
	if (c == null)
		return;
	
	if (existsColumn(addedColumnName) && c != null)
		return;

	columnNamesSet.add(addedColumnName);
	columnNames.add(addedColumnName);
	int i = columnNames.size() - 1;

	if (c.getListElementType() == String.class) {
		allGroupColumns.add(i);
		allGroupColumnSizes.add(Constants.CATEGORY_MAX_SIZE);
	} else if (c.getType() == String.class) {
		allStringColumns.add(i);
	} else if (c.getType() == Double.class) {
		allDoubleColumns.add(i);
	}
}
 
开发者ID:ls-cwi,项目名称:eXamine,代码行数:28,代码来源:ControlPanel.java


示例4: set

import org.cytoscape.model.CyColumn; //导入依赖的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);
	}
}
 
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:21,代码来源:Attributes.java


示例5: getTargetColumns

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
private ListSingleSelection<String> getTargetColumns() 
{
	final CyTable table = network.getTable(CyNode.class, CyNetwork.DEFAULT_ATTRS);
	final List<String> colNames = new ArrayList<String>();
	
	for (final CyColumn col : table.getColumns()) {
		// Exclude list, numerical, boolean type columns
		if (String.class.isAssignableFrom(col.getType())) {
			colNames.add(col.getName());
		}
	}

	ListSingleSelection<String> toReturn = 
			new ListSingleSelection<String>(colNames);
	
	if(colNames.contains("UNIPROT"))
		toReturn.setSelectedValue("UNIPROT");
	else if(colNames.contains("GENE SYMBOL"))
		toReturn.setSelectedValue("GENE SYMBOL");
	else if(colNames.contains("URI"))
		toReturn.setSelectedValue("URI");
	else if(colNames.contains(CyRootNetwork.SHARED_NAME))
		toReturn.setSelectedValue(CyRootNetwork.SHARED_NAME); //less desired
	
	return toReturn;
}
 
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:27,代码来源:ExpandNetworkTask.java


示例6: showColumnsForClass

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
private void showColumnsForClass(Class<?> columnType, ListSingleSelection<String> selection, Class<? extends CyIdentifiable> targetClass)
{
	CyNetwork network = targetNetwork.getSelectedValue();
	List<CyColumn> candidateColumns = new ArrayList<>(mappingManager.getMappingTable(network, targetClass).getColumns());
	List<String> filteredCandidateColumnsNames = candidateColumns.stream()
			.filter(col -> col.getType() == columnType && !col.isPrimaryKey())
			.map(col -> col.getName())
			.collect(Collectors.toList());
	
	filteredCandidateColumnsNames.sort(new AlphanumComparator<>());
	
	selection.setPossibleValues(filteredCandidateColumnsNames);
	
}
 
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:15,代码来源:MapColumnTask.java


示例7: isStringColumn

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
static boolean isStringColumn(CyColumn column) {
    Class<?> type = column.getType();
    if (type.equals(String.class)) {
        return true;
    }
    if (type.equals(List.class) && column.getListElementType()
                                         .equals(String.class)) {
        return true;
    }
    return false;
}
 
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:12,代码来源:SafeUtil.java


示例8: checkColumn

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
private void checkColumn(CyTable table,
                         String name,
                         Class<?> type) {
    CyColumn column = table.getColumn(name);
    if (column == null) {
        table.createColumn(name, type, false);
    }
}
 
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:9,代码来源:SafeSessionSerializer.java


示例9: getColumnsOfType

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
public static List<String> getColumnsOfType(CyNetwork network, Class<?> type, boolean node, boolean addNone, boolean allowList) {
	List<String> columns = new LinkedList<>();
	
	CyTable table;
	if(node)
		table = network.getDefaultNodeTable();
	else 
		table = network.getDefaultEdgeTable();
	
	for(CyColumn column : table.getColumns()) {
		if(column.getName().equalsIgnoreCase("suid")) {
			continue;
		}
		
		if(type.isAssignableFrom(column.getType())) {
			columns.add(column.getName());
		}
		else if(allowList && List.class.equals(column.getType()) && type.isAssignableFrom(column.getListElementType())) {
			columns.add(column.getName());
		}
	}
	
	columns.sort(Comparator.naturalOrder());
	if(addNone) {
		columns.add(0, NONE);
	}
	return columns;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:29,代码来源:CreateAnnotationSetDialog.java


示例10: getLabelColumn

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
private String getLabelColumn() {
	Collection<CyColumn> columns = networkView.getModel().getDefaultNodeTable().getColumns();
	for(CyColumn column : columns) {
		String name = column.getName();
		if(name.endsWith("GS_DESCR")) {
			return name;
		}
	}
	return CyNetwork.NAME;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:11,代码来源:CreateClusterTask.java


示例11: aggregateAttributes

import org.cytoscape.model.CyColumn; //导入依赖的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);
		}
	}
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:35,代码来源:SummaryNetworkTask.java


示例12: run

import org.cytoscape.model.CyColumn; //导入依赖的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;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:30,代码来源:CutoffTask.java


示例13: addVirtualColumn

import org.cytoscape.model.CyColumn; //导入依赖的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());
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:16,代码来源:CreateSubnetworkTask.java


示例14: getOrCreateColumnByPrototype

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
public static CyColumn getOrCreateColumnByPrototype(String name, Object prototype,
                                    boolean immutable, CyTable table) {
    if (name == null) throw new NullPointerException("name cannot be null");
    if (table == null) throw new NullPointerException("table cannot be null");

    Class<?> type = (prototype == null) ? String.class : prototype.getClass();
    if (!SUPPORTED_TYPES.contains(type)) {
        type = String.class;
    }

    return getOrCreateColumn(name, type, immutable, table);
}
 
开发者ID:jsongraph,项目名称:jgf-app,代码行数:13,代码来源:TableUtility.java


示例15: getOrCreateListColumn

import org.cytoscape.model.CyColumn; //导入依赖的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;
}
 
开发者ID:jsongraph,项目名称:jgf-app,代码行数:13,代码来源:TableUtility.java


示例16: getEdgeColumnNames

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
private List<String> getEdgeColumnNames() {
	List<String> names = new ArrayList<String>();
	names.add("- Select Column -");
	for (CyNetwork network: CyActivator.networkManager.getNetworkSet()) {
		for (CyColumn col:  network.getDefaultEdgeTable().getColumns()) {
			if (!names.contains(col.getName()) &&  (!col.getName().equals("SUID")) &&
					((col.getType() == Double.class) || (col.getType() == Integer.class) || (col.getType() == Long.class))) 
				names.add(col.getName());
		}
	}
	return names;
}
 
开发者ID:DataFusion4NetBio,项目名称:Paper16-SCODE,代码行数:13,代码来源:MyControlPanel.java


示例17: minScoreThreshold

import org.cytoscape.model.CyColumn; //导入依赖的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;
}
 
开发者ID:DataFusion4NetBio,项目名称:Paper16-SCODE,代码行数:33,代码来源:MyControlPanel.java


示例18: ensemblGeneIds

import org.cytoscape.model.CyColumn; //导入依赖的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();
}
 
开发者ID:heuermh,项目名称:variation-cytoscape3-app,代码行数:37,代码来源:VariationUtils.java


示例19: maxCount

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
/**
 * Return the maximum count value in the specified column in the specified network.
 *
 * @param network network
 * @param columnName column name
 * @return the maximum count value in the specified column in the specified network
 */
static int maxCount(final CyNetwork network, final String columnName)
{
    CyTable table = network.getDefaultNodeTable();
    CyColumn column = table.getColumn(columnName);
    int max = 0;
    for (Integer value : column.getValues(Integer.class))
    {
        if (value != null && value > max)
        {
            max = value;
        }
    }
    return max;
}
 
开发者ID:heuermh,项目名称:variation-cytoscape3-app,代码行数:22,代码来源:VariationUtils.java


示例20: detectImmutableProblem

import org.cytoscape.model.CyColumn; //导入依赖的package包/类
private static String detectImmutableProblem(String key, CyTable table, Class<?> valueClass, Class<?> colClass){
	
	CyColumn col = table.getColumn(key);
	
	String newKey = key; // trying to make this less confusing with the extra variables

	if(col.isImmutable() && !matchingValues(valueClass,colClass)){
		newKey = key + "_cannot_change_original";
		
		// we had this problem before and fixed it, now use the fixed column instead of the previous one!
		if(table.getColumn(newKey) == null){
			if(table.getColumn(key).getListElementType() != null){
				table.createListColumn(newKey,table.getColumn(key).getListElementType() , false);
				
			} else {
				table.createColumn(newKey, table.getColumn(key).getType(), false);
			}
			
			// populate the new column!
			List<CyRow> rows = table.getAllRows();
			for(CyRow row : rows){
				if(row.isSet(key)){
					table.getRow(row.get("SUID", Long.class)).set(newKey, row.getRaw(key));
				}
			}
			
		}
	}
	
	return newKey;
	
}
 
开发者ID:gsummer,项目名称:cyNeo4j,代码行数:33,代码来源:CyUtils.java



注:本文中的org.cytoscape.model.CyColumn类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Instruction35mi类代码示例发布时间:2022-05-22
下一篇:
Java FileType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap