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

Java CyRootNetwork类代码示例

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

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



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

示例1: collapse

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的package包/类
private void collapse() {
	if(!cluster.isCollapsed()) {
		modelManager.ignore(VIEW_CHANGE, SELECTION).whileRunning(() -> {
			CyNetwork network = cluster.getNetwork();
			List<CyNode> nodes = new ArrayList<>(cluster.getNodes());
			
			CyGroup group = groupFactory.createGroup(network, nodes, null, true);
			
			CyRow groupRow = ((CySubNetwork)network).getRootNetwork().getRow(group.getGroupNode(), CyRootNetwork.SHARED_ATTRS);
	 		groupRow.set(CyRootNetwork.SHARED_NAME, cluster.getLabel());
	 		
			group.collapse(network);
			
			if(overrideAttribute) {
				maybeCreateAnotherAttributeForName(network, groupRow);
			}
		});
	}
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:20,代码来源:CollapseTask.java


示例2: SupervisedModel

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的package包/类
/**
 * Constructs model from the current network and a file with clusters for training.
 * 
 * @param trainingNetwork CyNetwork with PPI data for analysis.
 * @param trainingData Text file containing training clusters.
 * @throws An exception from loading the training data file
 */
SupervisedModel(CyRootNetwork trainingNetwork, CyNetwork modelNetwork, CyNetwork outputBayesNet, InputTask userInput) throws Exception {
	Set<String> featureDescs = null;
	List<CySubNetwork> positiveExamples = null, negativeExamples = null;
	rootNetwork = trainingNetwork;
	this.complexPrior = userInput.clusterPrior;
	this.userInput = userInput;
	
	// Create the positive and negative bayes graphs
	setup();
	
	// Get the set of features from the template/model
	for (Graph g: bayesGraphs) {
		featureDescs = g.loadModelFrom(modelNetwork);
		}
	features = FeatureUtil.parse(featureDescs);

	//  Get positive training examples and generate negative training examples
	positiveExamples = loadTrainingComplexes(userInput.trainingFile);
	negativeExamples = generateNegativeExamples(userInput.negativeExamples, positiveExamples);

	// Train
	train(positiveExamples, negativeExamples);
	saveGraphicalBayesianNetwork(outputBayesNet, features);
}
 
开发者ID:DataFusion4NetBio,项目名称:Paper16-SCODE,代码行数:32,代码来源:SupervisedModel.java


示例3: handleEvent

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的package包/类
/**
 * Update UI and network settings to match change in column name.
 */
@Override
public void handleEvent(final ColumnNameChangedEvent e) {
	if (listenersEnabled.get()) {
		System.out.println("Column name changed event: " + e.getOldColumnName() + ", source: " + e.getSource());
	
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				// get the root network first
				CyRootNetwork rootNetwork = rootNetworkManager.getRootNetwork(networkManager.getNetwork(currentNetworkSUID));

				// now for all subnetworks of this root network, update the
				// column name
				for (CyNetwork network : rootNetwork.getSubNetworkList()) {
					if (networkSettings.containsKey(network.getSUID())) {
						networkSettings.get(network.getSUID()).changeColumnName(e.getOldColumnName(), e.getNewColumnName());
					}
				}

				updateUserInterface();
			}
		});
	}
}
 
开发者ID:ls-cwi,项目名称:eXamine,代码行数:28,代码来源:ControlPanel.java


示例4: getTargetColumns

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的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


示例5: createNewSession

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的package包/类
SafeSession createNewSession(CyNetworkView view) {
    SafeSession session = new SafeSession();
    session.setNetworkView(view);
    session.setNameColumn(CyRootNetwork.SHARED_NAME);
    session.setIdColumn(CyRootNetwork.SHARED_NAME);
    session.setDistanceThreshold(0.5);
    session.setForceUndirectedEdges(true);
    session.setMinimumLandscapeSize(10);
    session.setSimilarityThreshold(0.75);
    session.setRestrictionMethod(new RadiusBasedRestrictionMethod(0, 0));
    session.setGroupingMethod(new ClusterBasedGroupingMethod(0, new JaccardDistanceMethod(d -> d != 0)));
    return session;
}
 
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:14,代码来源:SafeController.java


示例6: createCyNetwork

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的package包/类
public CyNetwork createCyNetwork(String networkName, CyRootNetwork rootNetwork)  {
	CyNetwork network = (rootNetwork == null) 
			? networkFactory.createNetwork() 
				: rootNetwork.addSubNetwork();

	// First, create nodes for all Entity class objects
	createEntityNodes(network);

	// create edges
	createInteractionEdges(network);
	createComplexEdges(network);
	
	// TODO create pathwayComponent edges (requires pathway nodes)?
	
	// create PE->memberPE edges!
	createMemberEdges(network);
	
	// Finally, set network attributes:
	
	// name
	AttributeUtil.set(network, network, CyNetwork.NAME, networkName, String.class);
	
	// default Quick Find Index
	AttributeUtil.set(network, network, "quickfind.default_index", CyNetwork.NAME, String.class);
	
	return network;
}
 
开发者ID:cytoscape,项目名称:biopax,代码行数:28,代码来源:BioPaxMapper.java


示例7: createCyNetwork

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的package包/类
public CyNetwork createCyNetwork(String networkName, CyRootNetwork rootNetwork)  {
	CyNetwork network = (rootNetwork == null)
			? networkFactory.createNetwork() 
				: rootNetwork.addSubNetwork();

	// First, create nodes for all Entity class objects
	createEntityNodes(network);

	// create edges
	createInteractionEdges(network);
	createComplexEdges(network);
	
	// TODO create pathwayComponent edges (requires pathway nodes)?
	
	// create PE->memberPE edges!
	createMemberEdges(network);
	
	// Finally, set network attributes:
	
	// name
	Attributes.set(network, network, CyNetwork.NAME, networkName, String.class);
	
	// default Quick Find Index
	Attributes.set(network, network, "quickfind.default_index", CyNetwork.NAME, String.class);
	
	return network;
}
 
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:28,代码来源:BioPaxMapper.java


示例8: BioPaxReaderTask

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的package包/类
/**
 * Constructor
 * 
 * @param stream input biopax stream
 * @param inputName a file or pathway name (can be later updated using actual data)
 * @param cyServices api services
 * @param visualStyleUtil  biopax/sif visual style utilities
 */
public BioPaxReaderTask(InputStream stream, String inputName, 
		CyServices cyServices, VisualStyleUtil visualStyleUtil) 
{
	this.networks = new HashSet<CyNetwork>();
	this.stream = stream;
	this.inputName = inputName;
	this.cyServices = cyServices;
	this.visualStyleUtil = visualStyleUtil;
	
	// initialize the root networks Collection
	nameToRootNetworkMap = new HashMap<String, CyRootNetwork>();
	for (CyNetwork net : cyServices.networkManager.getNetworkSet()) {
		final CyRootNetwork rootNet = cyServices.rootNetworkManager.getRootNetwork(net);
		if (!nameToRootNetworkMap.containsValue(rootNet))
			nameToRootNetworkMap.put(rootNet.getRow(rootNet).get(CyRootNetwork.NAME, String.class), rootNet);
	}		
	List<String> rootNames = new ArrayList<String>();
	rootNames.add(CREATE_NEW_COLLECTION);
	rootNames.addAll(nameToRootNetworkMap.keySet());
	rootNetworkSelection = new ListSingleSelection<String>(rootNames);
	rootNetworkSelection.setSelectedValue(CREATE_NEW_COLLECTION);

	// initialize the list of data processing modes
	readerMode = new ListSingleSelection<>(ReaderMode.values());
	readerMode.setSelectedValue(ReaderMode.DEFAULT);
	
	// init the SIF rules/patterns list
	sifSelection = new ListMultipleSelection<SIFType>(SIFEnum.values());
	sifSelection.setSelectedValues(sifSelection.getPossibleValues());

	//TODO init SBGN options
	sbgnSelection = new ListSingleSelection<String>();
	
	// initialize renderer list
	final List<NetworkViewRenderer> renderers = new ArrayList<>();
	final Set<NetworkViewRenderer> rendererSet = cyServices.applicationManager.getNetworkViewRendererSet();
	// If there is only one registered renderer, we don't want to add it to the List Selection,
	// so the combo-box does not appear to the user, since there is nothing to select anyway.
	if (rendererSet.size() > 1) {
		renderers.addAll(rendererSet);
		Collections.sort(renderers, new Comparator<NetworkViewRenderer>() {
			@Override
			public int compare(NetworkViewRenderer r1, NetworkViewRenderer r2) {
				return r1.toString().compareToIgnoreCase(r2.toString());
			}
		});
	}
	rendererList = new ListSingleSelection<>(renderers);
}
 
开发者ID:cytoscape,项目名称:biopax,代码行数:58,代码来源:BioPaxReaderTask.java


示例9: BioPaxReaderTask

import org.cytoscape.model.subnetwork.CyRootNetwork; //导入依赖的package包/类
/**
	 * Constructor
	 *  @param stream input biopax stream
	 * @param inputName a file or pathway name (can be later updated using actual data)
	 */
	public BioPaxReaderTask(InputStream stream, String inputName)
	{
		this.networks = new HashSet<CyNetwork>();
		this.stream = stream;
		this.inputName = inputName;

		// initialize the root networks Collection
		nameToRootNetworkMap = new HashMap<String, CyRootNetwork>();
		for (CyNetwork net : App.cyServices.networkManager.getNetworkSet()) {
			final CyRootNetwork rootNet = App.cyServices.rootNetworkManager.getRootNetwork(net);
			if (!nameToRootNetworkMap.containsValue(rootNet))
				nameToRootNetworkMap.put(rootNet.getRow(rootNet).get(CyRootNetwork.NAME, String.class), rootNet);
		}		
		List<String> rootNames = new ArrayList<String>();
		rootNames.add(CREATE_NEW_COLLECTION);
		rootNames.addAll(nameToRootNetworkMap.keySet());
		rootNetworkSelection = new ListSingleSelection<String>(rootNames);
		rootNetworkSelection.setSelectedValue(CREATE_NEW_COLLECTION);

		// initialize the list of data processing modes
		readerMode = new ListSingleSelection<>(ReaderMode.values());
		readerMode.setSelectedValue(ReaderMode.DEFAULT);
		
		// init the SIF rules/patterns list
		sifSelection = new ListMultipleSelection<SIFType>(SIFEnum.values());
		List<SIFType> values = sifSelection.getPossibleValues();
		//remove sif rules/types/patterns that we don't want to apply by default
		for(SIFType item : sifSelection.getPossibleValues()) {
			if(item == SIFEnum.NEIGHBOR_OF // excl. this ubiquitous but confusing type (not useful)
				|| item == SIFEnum.INTERACTS_WITH //excl. PPIs (mostly PSI-MI data)
//					|| item == SIFEnum.REACTS_WITH
			)
			{
				values.remove(item);
			}
		}
		sifSelection.setSelectedValues(values);

		// initialize renderer list
		final List<NetworkViewRenderer> renderers = new ArrayList<>();
		final Set<NetworkViewRenderer> rendererSet = App.cyServices.applicationManager.getNetworkViewRendererSet();
		// If there is only one registered renderer, we don't want to add it to the List Selection,
		// so the combo-box does not appear to the user, since there is nothing to select anyway.
		if (rendererSet.size() > 1) {
			renderers.addAll(rendererSet);
			Collections.sort(renderers, new Comparator<NetworkViewRenderer>() {
				@Override
				public int compare(NetworkViewRenderer r1, NetworkViewRenderer r2) {
					return r1.toString().compareToIgnoreCase(r2.toString());
				}
			});
		}
		rendererList = new ListSingleSelection<>(renderers);
	}
 
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:60,代码来源:BioPaxReaderTask.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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