Cytoscape 2.2 (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)
           
 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 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()
           
 void flagAllNodes()
           
 void forceClear(String callerID)
          Deprecated.  
 Object getClientData(String data_name)
          Get Some client data
 Collection getClientDataNames()
          Get a list of all currently available ClientData objects
 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. @see{getNetworkData} Returns the expression data object associated with this network.
 int[] getFlaggedEdgeIndicesArray()
           
 Set getFlaggedEdges()
           
 int[] getFlaggedNodeIndicesArray()
           
 Set getFlaggedNodes()
           
 cytoscape.data.FlagFilter getFlagger()
           
 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.
 String getTitle()
          Can Change
 boolean isFlagged(Edge edge)
           
 boolean isFlagged(Node node)
           
 boolean isStateClear()
          Deprecated.  
 void putClientData(String data_name, Object data)
          Networks can support client data.
 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)
           
 boolean removeNode(int node_index, boolean set_remove)
          This will remove this node from the Network.
 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)
          Flags a edge
 void setFlagged(Node node, boolean state)
          Flags a node
 void setFlaggedEdges(Collection edges, boolean state)
          Flag a group of edge
 void setFlaggedEdges(int[] edges, boolean state)
          Flag a group of edges using their indices
 void setFlaggedNodes(Collection nodes, boolean state)
          Flag a group of node
 void setFlaggedNodes(int[] nodes, boolean state)
          Flag a group of nodes using their indices
 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 setTitle(String new_id)
          Can Change
 void unFlagAllEdges()
           
 void unFlagAllNodes()
           
 
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. @see{getNetworkData} Returns the expression data object associated with this network.


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()

flagAllEdges

public void flagAllEdges()

unFlagAllNodes

public void unFlagAllNodes()

unFlagAllEdges

public void unFlagAllEdges()

setFlagged

public void setFlagged(Node node,
                       boolean state)
Flags a node


setFlaggedNodes

public void setFlaggedNodes(Collection nodes,
                            boolean state)
Flag a group of node


setFlaggedNodes

public void setFlaggedNodes(int[] nodes,
                            boolean state)
Flag a group of nodes using their indices


setFlagged

public void setFlagged(Edge edge,
                       boolean state)
Flags a edge


setFlaggedEdges

public void setFlaggedEdges(Collection edges,
                            boolean state)
Flag a group of edge


setFlaggedEdges

public void setFlaggedEdges(int[] edges,
                            boolean state)
Flag a group of edges using their indices


isFlagged

public boolean isFlagged(Node node)

isFlagged

public boolean isFlagged(Edge edge)

getFlaggedNodes

public Set getFlaggedNodes()

getFlaggedEdges

public Set getFlaggedEdges()

getFlaggedNodeIndicesArray

public int[] getFlaggedNodeIndicesArray()

getFlaggedEdgeIndicesArray

public int[] getFlaggedEdgeIndicesArray()

addFlagEventListener

public void addFlagEventListener(cytoscape.data.FlagEventListener listener)

removeFlagEventListener

public void removeFlagEventListener(cytoscape.data.FlagEventListener listener)

getFlagger

public cytoscape.data.FlagFilter getFlagger()

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)
Networks can support client data.

Parameters:
data_name - the name of this client data

getClientDataNames

public Collection getClientDataNames()
Get a list of all currently available ClientData objects


getClientData

public Object getClientData(String data_name)
Get Some client data

Parameters:
data_name - the data to get

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