Cytoscape 2.8.0 API

cytoscape
Interface CyNetwork

All Superinterfaces:
GraphPerspective
All Known Implementing Classes:
FingCyNetwork

public interface CyNetwork
extends GraphPerspective

CyNetwork is the primary class for algorithm writing.  All algorithms should take a CyNetwork as input, and do their best to only use the API of CyNetwork.  Plugins that want to affect the display of a graph can look into using CyNetworkView as well.

A CyNetwork can create Nodes or Edges.  Any Nodes or Edges that wish to be added to a CyNetwork first need to be created in Cytoscape. 

The methods that are defined by CyNetwork mostly deal with data integration and flagging of nodes/edges.  All methods that deal with graph traversal are part of the inherited API of the GraphPerspective class.  Links to which can be found at the bottom of the methods list. 

In general, all methods are supported for working with Nodes/Edges as objects, and as indices.


Method Summary
 void addCyNetworkListener(CyNetworkListener listener)
          Registers the argument as a listener to this object.
 CyEdge addEdge(Edge cytoscape_edge)
          Add a edge to this Network that already exists in Cytoscape
 int addEdge(int cytoscape_edge)
          Add a edge to this Network that already exists in Cytoscape
 int addNode(int cytoscape_node)
          Add a node to this Network that already exists in Cytoscape
 CyNode addNode(Node cytoscape_node)
          Add a node to this Network that already exists in Cytoscape
 void addSelectEventListener(SelectEventListener listener)
          Adds a listener for SelectEvents to this CyNetwork
 void appendNetwork(CyNetwork network)
          Appends all of the nodes and edges in the given Network to this Network
 Object getClientData(String data_name)
          Deprecated. Use CyAttributes directly. This method will be removed in May, 2007.
 Collection getClientDataNames()
          Deprecated. Use CyAttributes directly. This method will be removed in May, 2007.
 Set getCyNetworkListeners()
          Returns the set of listeners registered with this object.
 String getIdentifier()
          Can't Change
 Set getSelectedEdges()
          Returns the set of selected edges in this CyNetwork
 Set getSelectedNodes()
          Returns the set of selected nodes in this CyNetwork
 SelectFilter getSelectFilter()
           
 String getTitle()
          Can Change
 boolean isSelected(Edge edge)
          Returns the selected state of the given edge.
 boolean isSelected(Node node)
          Returns the selected state of the given node.
 void putClientData(String data_name, Object data)
          Deprecated. Use CyAttributes directly. This method will be removed in May, 2007.
 boolean removeCyNetworkListener(CyNetworkListener listener)
          Removes the argument from the set of listeners for this object.
 boolean removeEdge(int edge_index, boolean set_remove)
          This will remove this edge from the Network.
 boolean removeNode(int node_index, boolean set_remove)
          This will remove this node from the Network.
 void removeSelectEventListener(SelectEventListener listener)
          Removes a listener for SelectEvents from this CyNetwork
 void selectAllEdges()
          Sets the selected state of all edges in this CyNetwork to true
 void selectAllNodes()
          Sets the selected state of all nodes in this CyNetwork to true
 String setIdentifier(String new_id)
          Can't Change
 void setSelectedEdgeState(Collection edges, boolean selected_state)
          Sets the selected state of a collection of edges.
 void setSelectedEdgeState(Edge edge, boolean selected_state)
          Sets the selected state of a single edge.
 void setSelectedNodeState(Collection nodes, boolean selected_state)
          Sets the selected state of a collection of nodes.
 void setSelectedNodeState(Node node, boolean selected_state)
          Sets the selected state of a single node.
 void setTitle(String new_id)
          Can Change
 void unselectAllEdges()
          Sets the selected state of all edges in this CyNetwork to false
 void unselectAllNodes()
          Sets the selected state of all nodes in this CyNetwork to false
 
Methods inherited from interface giny.model.GraphPerspective
addGraphPerspectiveChangeListener, clone, containsEdge, containsEdge, containsNode, containsNode, createGraphPerspective, createGraphPerspective, createGraphPerspective, createGraphPerspective, edgeExists, edgeExists, edgeMetaChildrenList, edgeMetaChildrenList, edgeMetaParentsList, edgesIterator, edgesList, edgesList, edgesList, getAdjacentEdgeIndicesArray, getAdjacentEdgesList, getConnectingEdgeIndicesArray, getConnectingEdges, getConnectingNodeIndicesArray, getDegree, getDegree, getEdge, getEdgeCount, getEdgeCount, getEdgeCount, getEdgeIndex, getEdgeIndicesArray, getEdgeIndicesArray, getEdgeIndicesArray, getEdgeMetaChildIndicesArray, getEdgeMetaParentIndicesArray, getEdgeSourceIndex, getEdgeTargetIndex, getInDegree, getInDegree, getInDegree, getInDegree, getIndex, getIndex, getNode, getNodeCount, getNodeIndex, getNodeIndicesArray, getNodeMetaChildIndicesArray, getNodeMetaParentIndicesArray, getOutDegree, getOutDegree, getOutDegree, getOutDegree, getRootGraph, getRootGraphEdgeIndex, getRootGraphNodeIndex, hideEdge, hideEdge, hideEdges, hideEdges, hideNode, hideNode, hideNodes, hideNodes, isEdgeDirected, isEdgeMetaChild, isEdgeMetaParent, isMetaChild, isMetaChild, isMetaParent, isMetaParent, isNeighbor, isNeighbor, isNodeMetaChild, isNodeMetaParent, join, metaParentsList, metaParentsList, neighborsArray, neighborsList, nodeMetaChildrenList, nodeMetaChildrenList, nodeMetaParentsList, nodesIterator, nodesList, removeGraphPerspectiveChangeListener, restoreEdge, restoreEdge, restoreEdges, restoreEdges, restoreNode, restoreNode, restoreNodes, restoreNodes, restoreNodes, restoreNodes
 

Method Detail

getTitle

String getTitle()
Can Change


setTitle

void setTitle(String new_id)
Can Change


getIdentifier

String getIdentifier()
Can't Change


setIdentifier

String setIdentifier(String new_id)
Can't Change


appendNetwork

void appendNetwork(CyNetwork network)
Appends all of the nodes and edges in the given Network to this Network


addCyNetworkListener

void addCyNetworkListener(CyNetworkListener listener)
Registers the argument as a listener to this object. Does nothing if the argument is already a listener.


removeCyNetworkListener

boolean removeCyNetworkListener(CyNetworkListener listener)
Removes the argument from the set of listeners for this object. Returns true if the argument was a listener before this call, false otherwise.


getCyNetworkListeners

Set getCyNetworkListeners()
Returns the set of listeners registered with this object.


selectAllNodes

void selectAllNodes()
Sets the selected state of all nodes in this CyNetwork to true


selectAllEdges

void selectAllEdges()
Sets the selected state of all edges in this CyNetwork to true


unselectAllNodes

void unselectAllNodes()
Sets the selected state of all nodes in this CyNetwork to false


unselectAllEdges

void unselectAllEdges()
Sets the selected state of all edges in this CyNetwork to false


setSelectedNodeState

void setSelectedNodeState(Collection nodes,
                          boolean selected_state)
Sets the selected state of a collection of nodes.

Parameters:
nodes - a Collection of Nodes
selected_state - the desired selection state for the nodes

setSelectedNodeState

void setSelectedNodeState(Node node,
                          boolean selected_state)
Sets the selected state of a single node.

Parameters:
node - a single Node
selected_state - the desired selection state for the nodes

setSelectedEdgeState

void setSelectedEdgeState(Collection edges,
                          boolean selected_state)
Sets the selected state of a collection of edges.

Parameters:
edges - a Collection of Edges
selected_state - the desired selection state for the edges

setSelectedEdgeState

void setSelectedEdgeState(Edge edge,
                          boolean selected_state)
Sets the selected state of a single edge.

Parameters:
edge - a single Edge
selected_state - the desired selection state for the edges

isSelected

boolean isSelected(Node node)
Returns the selected state of the given node.

Parameters:
node - the node
Returns:
true if selected, false otherwise

isSelected

boolean isSelected(Edge edge)
Returns the selected state of the given edge.

Parameters:
edge - the edge
Returns:
true if selected, false otherwise

getSelectedNodes

Set getSelectedNodes()
Returns the set of selected nodes in this CyNetwork

Returns:
a Set of selected nodes

getSelectedEdges

Set getSelectedEdges()
Returns the set of selected edges in this CyNetwork

Returns:
a Set of selected edges

addSelectEventListener

void addSelectEventListener(SelectEventListener listener)
Adds a listener for SelectEvents to this CyNetwork

Parameters:
listener -

removeSelectEventListener

void removeSelectEventListener(SelectEventListener listener)
Removes a listener for SelectEvents from this CyNetwork

Parameters:
listener -

getSelectFilter

SelectFilter getSelectFilter()
Returns:
SelectFilter

putClientData

void putClientData(String data_name,
                   Object data)
Deprecated. Use CyAttributes directly. This method will be removed in May, 2007.

Networks can support client data.


getClientDataNames

Collection getClientDataNames()
Deprecated. Use CyAttributes directly. This method will be removed in May, 2007.

Get a list of all currently available ClientData objects


getClientData

Object getClientData(String data_name)
Deprecated. Use CyAttributes directly. This method will be removed in May, 2007.

Get Some client data


addNode

int addNode(int cytoscape_node)
Add a node to this Network that already exists in Cytoscape

Returns:
the Network Index of this node

addNode

CyNode addNode(Node cytoscape_node)
Add a node to this Network that already exists in Cytoscape

Returns:
the Network Index of this node

removeNode

boolean removeNode(int node_index,
                   boolean set_remove)
This will remove this node from the Network. However, unless forced, it will remain in Cytoscape to be possibly resused by another Network in the future.

Parameters:
set_remove - true removes this node from all of Cytoscape, false lets it be used by other CyNetworks
Returns:
true if the node is still present in Cytoscape ( i.e. in another Network )

addEdge

int addEdge(int cytoscape_edge)
Add a edge to this Network that already exists in Cytoscape

Returns:
the Network Index of this edge

addEdge

CyEdge addEdge(Edge cytoscape_edge)
Add a edge to this Network that already exists in Cytoscape

Returns:
the Network Index of this edge

removeEdge

boolean removeEdge(int edge_index,
                   boolean set_remove)
This will remove this edge from the Network. However, unless forced, it will remain in Cytoscape to be possibly resused by another Network in the future.

Parameters:
set_remove - true removes this edge from all of Cytoscape, false lets it be used by other CyNetworks
Returns:
true if the edge is still present in Cytoscape ( i.e. in another Network )

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.