Cytoscape 2.4.1 (c) 2006,2007 ISB, MSKCC, UCSD

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 firt 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
 void addFlagEventListener(FlagEventListener listener)
          Adds a listener for FlagEvents to this CyNetwork
 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
 void flagAllEdges()
          Deprecated. As of 2.3, replaced by selectAllEdges()
 void flagAllNodes()
          Deprecated. As of 2.3, replaced by selectAllNodes()
 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.
 int[] getFlaggedEdgeIndicesArray()
          Deprecated. As of 2.3, replaced by getSelectedEdges()
 Set getFlaggedEdges()
          Deprecated. As of 2.3, replaced by getSelectedEdges()
 int[] getFlaggedNodeIndicesArray()
          Deprecated. As of 2.3, replaced by getSelectedNodes()
 Set getFlaggedNodes()
          Deprecated. As of 2.3, replaced by getSelectedNodes()
 FlagFilter getFlagger()
          Deprecated. As of 2.3, replaced by getSelectFilter()
 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 isFlagged(Edge edge)
          Deprecated. As of 2.3, replaced by isSelected(Edge)
 boolean isFlagged(Node node)
          Deprecated. As of 2.3, replaced by isSelected(Node)
 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.
 void removeFlagEventListener(FlagEventListener listener)
          Deprecated. As of 2.3, replaced by removeSelectEventListener(SelectEventListener)
 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
 void setFlagged(Edge edge, boolean state)
          Deprecated. As of 2.3, replaced by setSelectedEdgeState(Edge,boolean)
 void setFlagged(Node node, boolean state)
          Deprecated. As of 2.3, replaced by setSelectedNodeState(Node,boolean)
 void setFlaggedEdges(Collection edges, boolean state)
          Deprecated. As of 2.3, replaced by setSelectedEdgeState(Collection,boolean)
 void setFlaggedEdges(int[] edges, boolean state)
          Deprecated. As of 2.3, replaced by setSelectedEdgeState(Collection,boolean)
 void setFlaggedNodes(Collection nodes, boolean state)
          Deprecated. As of 2.3, replaced by setSelectedNodeState(Collection,boolean)
 void setFlaggedNodes(int[] nodes, boolean state)
          Deprecated. As of 2.3, replaced by setSelectedNodeState(Collection,boolean)
 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 unFlagAllEdges()
          Deprecated. As of 2.3, replaced by unselectAllEdges()
 void unFlagAllNodes()
          Deprecated. As of 2.3, replaced by unselectAllNodes()
 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.


flagAllNodes

void flagAllNodes()
Deprecated. As of 2.3, replaced by selectAllNodes()

Flags all nodes in this CyNetwork


flagAllEdges

void flagAllEdges()
Deprecated. As of 2.3, replaced by selectAllEdges()

Flags all edges in this network


unFlagAllNodes

void unFlagAllNodes()
Deprecated. As of 2.3, replaced by unselectAllNodes()

Unflags all nodes in this CyNetwork


unFlagAllEdges

void unFlagAllEdges()
Deprecated. As of 2.3, replaced by unselectAllEdges()

Unflags all edges in this CyNetwork


setFlagged

void setFlagged(Node node,
                boolean state)
Deprecated. As of 2.3, replaced by setSelectedNodeState(Node,boolean)

Flags a node


setFlaggedNodes

void setFlaggedNodes(Collection nodes,
                     boolean state)
Deprecated. As of 2.3, replaced by setSelectedNodeState(Collection,boolean)

Flag a group of node


setFlaggedNodes

void setFlaggedNodes(int[] nodes,
                     boolean state)
Deprecated. As of 2.3, replaced by setSelectedNodeState(Collection,boolean)

Flag a group of nodes using their indices


setFlagged

void setFlagged(Edge edge,
                boolean state)
Deprecated. As of 2.3, replaced by setSelectedEdgeState(Edge,boolean)

Flags a edge


setFlaggedEdges

void setFlaggedEdges(Collection edges,
                     boolean state)
Deprecated. As of 2.3, replaced by setSelectedEdgeState(Collection,boolean)

Flag a group of edge


setFlaggedEdges

void setFlaggedEdges(int[] edges,
                     boolean state)
Deprecated. As of 2.3, replaced by setSelectedEdgeState(Collection,boolean)

Flag a group of edges using their indices


isFlagged

boolean isFlagged(Node node)
Deprecated. As of 2.3, replaced by isSelected(Node)

Whether or not the given node is flagged in this CyNetwork

Parameters:
node -
Returns:
whether or not the node has been flagged

isFlagged

boolean isFlagged(Edge edge)
Deprecated. As of 2.3, replaced by isSelected(Edge)

Whether or not the given edges is flagged in this CyNetwork

Parameters:
edge -
Returns:
whether or not the edge has been flagged

getFlaggedNodes

Set getFlaggedNodes()
Deprecated. As of 2.3, replaced by getSelectedNodes()

Returns the set of flagged nodes in this CyNetwork

Returns:
a Set of flagged nodes

getFlaggedEdges

Set getFlaggedEdges()
Deprecated. As of 2.3, replaced by getSelectedEdges()

Returns the set of flagged edges in this CyNetwork

Returns:
a Set of flagged edges

getFlaggedNodeIndicesArray

int[] getFlaggedNodeIndicesArray()
Deprecated. As of 2.3, replaced by getSelectedNodes()

Returns an array of the indices of flagged nodes in this CyNetwork

Returns:
an array of indices

getFlaggedEdgeIndicesArray

int[] getFlaggedEdgeIndicesArray()
Deprecated. As of 2.3, replaced by getSelectedEdges()

Returns an array of the indices of flagged edges in this CyNetwork

Returns:
an array of indices

addFlagEventListener

void addFlagEventListener(FlagEventListener listener)
Adds a listener for FlagEvents to this CyNetwork

Parameters:
listener -

removeFlagEventListener

void removeFlagEventListener(FlagEventListener listener)
Deprecated. As of 2.3, replaced by removeSelectEventListener(SelectEventListener)

Removes a listener fro FlagEvents from this CyNetwork

Parameters:
listener -

getFlagger

FlagFilter getFlagger()
Deprecated. As of 2.3, replaced by getSelectFilter()

Returns:
FlagFilter

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 )

www.cytoscape.org