Cytoscape 2.3.1 (c) 2004 ISB, MSKCC, UCSD

cytoscape
Interface CyNetwork

All Superinterfaces:
GraphPerspective

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(cytoscape.data.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(cytoscape.data.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 beginActivity(String callerID)
          Deprecated.  
 void deleteEdgeAttribute(String attribute)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 void deleteNodeAttribute(String attribute)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 void endActivity(String callerID)
          Deprecated.  
 void flagAllEdges()
          Deprecated. As of 2.3, replaced by selectAllEdges()
 void flagAllNodes()
          Deprecated. As of 2.3, replaced by selectAllNodes()
 void forceClear(String callerID)
          Deprecated.  
 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.
 cytoscape.data.GraphObjAttributes getEdgeAttributes()
          Deprecated. Use Cytoscape.getEdgeAttributes() instead. This method will be removed in September, 2006.
 String[] getEdgeAttributesList()
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 Object getEdgeAttributeValue(Edge edge, String attribute)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 Object getEdgeAttributeValue(int edge, String attribute)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 ExpressionData getExpressionData()
          Deprecated.  
 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()
 cytoscape.data.FlagFilter getFlagger()
          Deprecated. As of 2.3, replaced by getSelectFilter()
 GraphPerspective getGraphPerspective()
          Deprecated.  
 String getIdentifier()
          Can't Change
 cytoscape.data.GraphObjAttributes getNodeAttributes()
          Deprecated. Use Cytoscape.getNodeAttributes() instead. This method will be removed in September, 2006.
 String[] getNodeAttributesList()
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 String[] getNodeAttributesList(Edge[] edges)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 String[] getNodeAttributesList(Node[] nodes)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 Object getNodeAttributeValue(int node, String attribute)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 Object getNodeAttributeValue(Node node, String attribute)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 Set getSelectedEdges()
          Returns the set of selected edges in this CyNetwork
 Set getSelectedNodes()
          Returns the set of selected nodes in this CyNetwork
 cytoscape.data.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.
 boolean isStateClear()
          Deprecated.  
 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(cytoscape.data.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(cytoscape.data.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
 boolean setEdgeAttributeValue(Edge edge, String attribute, Object value)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 boolean setEdgeAttributeValue(int edge, String attribute, Object value)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 void setExpressionData(ExpressionData newData)
          Deprecated. Sets the expression data object associated with this network.
 void setFlagged(Edge edge, boolean state)
          Deprecated. As of 2.3, replaced by setSelectedEdgeState(Collection,boolean)
 void setFlagged(Node node, boolean state)
          Deprecated. As of 2.3, replaced by setSelectedNodeState(Collection,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 setNewGraphFrom(CyNetwork newNetwork, boolean replaceAttributes)
          Deprecated.  
 boolean setNodeAttributeValue(int node, String attribute, Object value)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 boolean setNodeAttributeValue(Node node, String attribute, Object value)
          Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.
 void setSelectedEdgeState(Collection edges, boolean selected_state)
          Sets the selected state of a collection of edges.
 void setSelectedNodeState(Collection nodes, boolean selected_state)
          Sets the selected state of a collection of nodes.
 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

public String getTitle()
Can Change


setTitle

public void setTitle(String new_id)
Can Change


getIdentifier

public String getIdentifier()
Can't Change


setIdentifier

public String setIdentifier(String new_id)
Can't Change


appendNetwork

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


setNewGraphFrom

public void setNewGraphFrom(CyNetwork newNetwork,
                            boolean replaceAttributes)
Deprecated.  

A new Network should be made instead.

See Also:
appendNetwork(cytoscape.CyNetwork)

beginActivity

public void beginActivity(String callerID)
Deprecated.  


endActivity

public void endActivity(String callerID)
Deprecated.  


isStateClear

public boolean isStateClear()
Deprecated.  


forceClear

public void forceClear(String callerID)
Deprecated.  


addCyNetworkListener

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


removeCyNetworkListener

public 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

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


getExpressionData

public ExpressionData getExpressionData()
Deprecated.  


setExpressionData

public void setExpressionData(ExpressionData newData)
Deprecated. Sets the expression data object associated with this network.


getNodeAttributes

public cytoscape.data.GraphObjAttributes getNodeAttributes()
Deprecated. Use Cytoscape.getNodeAttributes() instead. This method will be removed in September, 2006.

Gets Global Node Attributes: GraphObjAttributes.


getEdgeAttributes

public cytoscape.data.GraphObjAttributes getEdgeAttributes()
Deprecated. Use Cytoscape.getEdgeAttributes() instead. This method will be removed in September, 2006.

Gets Global Edge Attributes: GraphObjAttributes.


getGraphPerspective

public GraphPerspective getGraphPerspective()
Deprecated.  


flagAllNodes

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

Flags all nodes in this CyNetwork


flagAllEdges

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

Flags all edges in this network


unFlagAllNodes

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

Unflags all nodes in this CyNetwork


unFlagAllEdges

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

Unflags all edges in this CyNetwork


setFlagged

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

Flags a node


setFlaggedNodes

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

Flag a group of node


setFlaggedNodes

public 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

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

Flags a edge


setFlaggedEdges

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

Flag a group of edge


setFlaggedEdges

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public void addFlagEventListener(cytoscape.data.FlagEventListener listener)
Adds a listener for FlagEvents to this CyNetwork

Parameters:
listener -

removeFlagEventListener

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

Removes a listener fro FlagEvents from this CyNetwork

Parameters:
listener -

getFlagger

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

Returns:
FlagFilter

selectAllNodes

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


selectAllEdges

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


unselectAllNodes

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


unselectAllEdges

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


setSelectedNodeState

public 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

setSelectedEdgeState

public 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

isSelected

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

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

isSelected

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

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

getSelectedNodes

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

Returns:
a Set of selected nodes

getSelectedEdges

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

Returns:
a Set of selected edges

addSelectEventListener

public void addSelectEventListener(cytoscape.data.SelectEventListener listener)
Adds a listener for SelectEvents to this CyNetwork

Parameters:
listener -

removeSelectEventListener

public void removeSelectEventListener(cytoscape.data.SelectEventListener listener)
Removes a listener for SelectEvents from this CyNetwork

Parameters:
listener -

getSelectFilter

public cytoscape.data.SelectFilter getSelectFilter()
Returns:
SelectFilter

getNodeAttributeValue

public Object getNodeAttributeValue(Node node,
                                    String attribute)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return the requested Attribute for the given Node

Parameters:
node - the given CyNode
attribute - the name of the requested attribute
Returns:
the value for the give node, for the given attribute

getNodeAttributeValue

public Object getNodeAttributeValue(int node,
                                    String attribute)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return the requested Attribute for the given Node


getEdgeAttributeValue

public Object getEdgeAttributeValue(Edge edge,
                                    String attribute)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return the requested Attribute for the given Edge


getEdgeAttributeValue

public Object getEdgeAttributeValue(int edge,
                                    String attribute)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return the requested Attribute for the given Edge


getNodeAttributesList

public String[] getNodeAttributesList()
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return all availble Attributes for the Nodes in this CyNetwork


getNodeAttributesList

public String[] getNodeAttributesList(Node[] nodes)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return all available Attributes for the given Nodes


getEdgeAttributesList

public String[] getEdgeAttributesList()
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return all availble Attributes for the Edges in this CyNetwork


getNodeAttributesList

public String[] getNodeAttributesList(Edge[] edges)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return all available Attributes for the given Edges


setNodeAttributeValue

public boolean setNodeAttributeValue(Node node,
                                     String attribute,
                                     Object value)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return the requested Attribute for the given Node

Parameters:
node - the given CyNode
attribute - the name of the requested attribute
value - the value to be set
Returns:
if it overwrites a previous value

setNodeAttributeValue

public boolean setNodeAttributeValue(int node,
                                     String attribute,
                                     Object value)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return the requested Attribute for the given Node


setEdgeAttributeValue

public boolean setEdgeAttributeValue(Edge edge,
                                     String attribute,
                                     Object value)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return the requested Attribute for the given Edge


setEdgeAttributeValue

public boolean setEdgeAttributeValue(int edge,
                                     String attribute,
                                     Object value)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Return the requested Attribute for the given Edge


deleteNodeAttribute

public void deleteNodeAttribute(String attribute)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Deletes the attribute with the given name from node attributes


deleteEdgeAttribute

public void deleteEdgeAttribute(String attribute)
Deprecated. Use CyAttributes directly. This method will be removed in September, 2006.

Deleted the attribute with the given name from edge attributes


putClientData

public 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

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

Get a list of all currently available ClientData objects


getClientData

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

Get Some client data


addNode

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

Returns:
the Network Index of this node

addNode

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

Returns:
the Network Index of this node

removeNode

public 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

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

Returns:
the Network Index of this edge

addEdge

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

Returns:
the Network Index of this edge

removeEdge

public 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