Package org.cytoscape.model.subnetwork
Interface CyRootNetwork
- All Superinterfaces:
CyDisposable
,CyIdentifiable
,CyNetwork
CyRootNetwork is an interface for managing Cytoscape's
meta-network implementation. While most applications (and users!)
will treat each
CyNetwork
created within Cytoscape
as an independent network, beginning with Cytoscape 3.0,
Cytoscape has provided a mechanism for implementing a more
complex meta-network structure that can be used for a variety
of other use cases, including implementing subnetworks
and shared nodes between subnetworks. Beyond the concepts
and methods provided by CyNetwork
a meta-network
adds three new concepts:
- A CyRootNetwork is a
CyNetwork
that adds methods for maintaining the meta-network. AllCyNode
s andCyEdge
s in allCySubNetwork
s that are part of this CyRootNetwork. - A
CySubNetwork
is a set of nodes and edges that comprise a sub-network of aCyRootNetwork
. ACySubNetwork
may be thought of as a projection of the graph implemented by the CyRootNetwork.
Module: model-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>model-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the table containing the attributes shared by all subnetworks of this root network.static final String
The name of the table that enables sharing default attributes with all subnetworks.static final String
The name of the shared interaction column found in the SHARED_ATTRS table.static final String
The name of the shared name column found in the SHARED_ATTRS table.Fields inherited from interface org.cytoscape.model.CyIdentifiable
SUID
Fields inherited from interface org.cytoscape.model.CyNetwork
DEFAULT_ATTRS, HIDDEN_ATTRS, LOCAL_ATTRS, NAME, SELECTED
-
Method Summary
Modifier and TypeMethodDescriptionCreate an emptyCySubNetwork
.addSubNetwork
(Iterable<CyNode> nodes, Iterable<CyEdge> edges) addSubNetwork
(Iterable<CyNode> nodes, Iterable<CyEdge> edges, SavePolicy policy) addSubNetwork
(SavePolicy policy) Create an emptyCySubNetwork
which can have a different save policy from that of this root network, as long as the root network's policy is notSavePolicy.DO_NOT_SAVE
.boolean
Returns true if the network to be checked is a subnetwork of this root network and returns false otherwise.Returns the edge table shared by all subnetworks.Returns the network table shared by all subnetworks.Returns the node table shared by all subnetworks.Will return A list of allCySubNetwork
s contained in this root network.void
Removes the subnetwork from the root network, but not the nodes and edges contained in the subnetwork.void
restoreEdge
(CyEdge edge) Causes the given edge to (temporarily) remain in the root network even if it has already been removed from all subnetworks.void
restoreNode
(CyNode node) Causes the given node to (temporarily) remain in the root network even if it has already been removed from all subnetworks.Methods inherited from interface org.cytoscape.model.CyDisposable
dispose
Methods inherited from interface org.cytoscape.model.CyIdentifiable
getSUID
Methods inherited from interface org.cytoscape.model.CyNetwork
addEdge, addNode, containsEdge, containsEdge, containsNode, getAdjacentEdgeIterable, getAdjacentEdgeList, getConnectingEdgeList, getDefaultEdgeTable, getDefaultNetworkTable, getDefaultNodeTable, getEdge, getEdgeCount, getEdgeList, getNeighborList, getNode, getNodeCount, getNodeList, getRow, getRow, getSavePolicy, getTable, removeEdges, removeNodes
-
Field Details
-
SHARED_ATTRS
The name of the table containing the attributes shared by all subnetworks of this root network. Direct use of this table is discouraged!- See Also:
-
SHARED_DEFAULT_ATTRS
The name of the table that enables sharing default attributes with all subnetworks. Direct use of this table is discouraged!- See Also:
-
SHARED_NAME
The name of the shared name column found in the SHARED_ATTRS table. This column value will be updated any time the value of the CyNetwork.NAME column in a default table is set. The purpose of this column is to serve as a join key for virtual columns to be added to the shared table.- See Also:
-
SHARED_INTERACTION
The name of the shared interaction column found in the SHARED_ATTRS table. This column value will be updated any time the value of the CyNetwork.EDGE column in a default table is set.- See Also:
-
-
Method Details
-
addSubNetwork
CySubNetwork addSubNetwork()Create an emptyCySubNetwork
. The new subnetwork is created with the same save policy of its root network. If you want to set a different save policy to the new subnetwork, just useaddSubNetwork(SavePolicy)
.- Returns:
- The created
CySubNetwork
.
-
addSubNetwork
Create an emptyCySubNetwork
which can have a different save policy from that of this root network, as long as the root network's policy is notSavePolicy.DO_NOT_SAVE
.- Parameters:
policy
- the save policy to follow during the life-cycle of the CyNetwork.- Returns:
- The created
CySubNetwork
. - Throws:
IllegalArgumentException
- if the save policy of this root network isSavePolicy.DO_NOT_SAVE
, and the policy argument is not the same.
-
addSubNetwork
Create aCySubNetwork
containing the specifiedCyNode
s andCyEdge
s. The nodes and edges must already exist in this root network. Nodes defining the source and target of edges that have not yet been added to the subnetwork will be added. The new subnetwork is created with the same save policy of its root network. If you want to set a different save policy to the new subnetwork, just useaddSubNetwork(Iterable, Iterable, SavePolicy)
.- Parameters:
nodes
- The nodes to be added to the network. May be null or empty.edges
- The edges to be added to the network. May be null or empty.- Returns:
- The created
CySubNetwork
.
-
addSubNetwork
Create aCySubNetwork
containing the specifiedCyNode
s andCyEdge
s. The nodes and edges must already exist in this root network. Nodes defining the source and target of edges that have not yet been added to the subnetwork will be added. The newCySubNetwork
can have a different save policy from that of this root network, as long as the root network's policy is notSavePolicy.DO_NOT_SAVE
.- Parameters:
nodes
- The nodes to be added to the network. May be null or empty.edges
- The edges to be added to the network. May be null or empty.policy
- the save policy to follow during the life-cycle of the CyNetwork.- Returns:
- The created
CySubNetwork
. - Throws:
IllegalArgumentException
- if the save policy of this root network isSavePolicy.DO_NOT_SAVE
, and the policy argument is not the same.
-
removeSubNetwork
Removes the subnetwork from the root network, but not the nodes and edges contained in the subnetwork.- Parameters:
sub
- theCySubNetwork
to remove.
-
getSubNetworkList
List<CySubNetwork> getSubNetworkList()Will return A list of allCySubNetwork
s contained in this root network.- Returns:
- A list of all
CySubNetwork
s contained in this root network.
-
getBaseNetwork
CySubNetwork getBaseNetwork()The initial network ofCyNode
s andCyEdge
s. Every root network began with something, and this network is that something.- Returns:
- the
CySubNetwork
that the root network began with.
-
containsNetwork
Returns true if the network to be checked is a subnetwork of this root network and returns false otherwise. Will return false if the network is null.- Parameters:
n
- The network to be checked.- Returns:
- true if the network to be checked is a subnetwork of this root network and returns false otherwise or if the network is null.
-
restoreNode
Causes the given node to (temporarily) remain in the root network even if it has already been removed from all subnetworks.
The root network will automatically remove nodes/edges from itself that have been removed from all subnetworks. Calling this method after removing the node from all sub-networks will cause it to remain part of the root-network.
Note: No effort is made to track nodes/edges in the root network have been restored. Certain actions may cause them to be auto-deleted again. If a node is deleted from a subnetwork that is attached to a restored edge then the edge may be auto-deleted from the root again. If an entire subnetwork is deleted then all restored nodes/edges are considered for auto-deletion again. To force nodes/edges to never be deleted from the root network put them in a hidden subnetwork usingaddSubNetwork(Iterable, Iterable)
. -
restoreEdge
Causes the given edge to (temporarily) remain in the root network even if it has already been removed from all subnetworks.
The root network will automatically remove nodes/edges from itself that have been removed from all subnetworks. Calling this method after removing the edge from all sub-networks will cause it to remain part of the root-network.
Note: No effort is made to track nodes/edges in the root network have been restored. Certain actions may cause them to be auto-deleted again. If a node is deleted from a subnetwork that is attached to a restored edge then the edge may be auto-deleted from the root again. If an entire subnetwork is deleted then all restored nodes/edges are considered for auto-deletion again. To force nodes/edges to never be deleted from the root network put them in a hidden subnetwork usingaddSubNetwork(Iterable, Iterable)
.
-