Interface CyRootNetwork

All Superinterfaces:
CyDisposable, CyIdentifiable, CyNetwork

public interface CyRootNetwork extends 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. All CyNodes and CyEdges in all CySubNetworks that are part of this CyRootNetwork.
  • A CySubNetwork is a set of nodes and edges that comprise a sub-network of a CyRootNetwork. A CySubNetwork 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 Details

    • SHARED_ATTRS

      static final String 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

      static final String 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

      static final String 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

      static final String 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 empty CySubNetwork. 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 use addSubNetwork(SavePolicy).
      Returns:
      The created CySubNetwork.
    • addSubNetwork

      CySubNetwork addSubNetwork(SavePolicy policy)
      Create an empty CySubNetwork which can have a different save policy from that of this root network, as long as the root network's policy is not SavePolicy.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 is SavePolicy.DO_NOT_SAVE, and the policy argument is not the same.
    • addSubNetwork

      CySubNetwork addSubNetwork(Iterable<CyNode> nodes, Iterable<CyEdge> edges)
      Create a CySubNetwork containing the specified CyNodes and CyEdges. 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 use addSubNetwork(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

      CySubNetwork addSubNetwork(Iterable<CyNode> nodes, Iterable<CyEdge> edges, SavePolicy policy)
      Create a CySubNetwork containing the specified CyNodes and CyEdges. 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 CySubNetwork can have a different save policy from that of this root network, as long as the root network's policy is not SavePolicy.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 is SavePolicy.DO_NOT_SAVE, and the policy argument is not the same.
    • removeSubNetwork

      void removeSubNetwork(CySubNetwork sub)
      Removes the subnetwork from the root network, but not the nodes and edges contained in the subnetwork.
      Parameters:
      sub - the CySubNetwork to remove.
    • getSubNetworkList

      List<CySubNetwork> getSubNetworkList()
      Will return A list of all CySubNetworks contained in this root network.
      Returns:
      A list of all CySubNetworks contained in this root network.
    • getBaseNetwork

      CySubNetwork getBaseNetwork()
      The initial network of CyNodes and CyEdges. Every root network began with something, and this network is that something.
      Returns:
      the CySubNetwork that the root network began with.
    • containsNetwork

      boolean containsNetwork(CyNetwork n)
      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.
    • getSharedNetworkTable

      CyTable getSharedNetworkTable()
      Returns the network table shared by all subnetworks. The columns of this table are automatically made into virtual columns of the DEFAULT network table of each subnetwork of this root network.
      Returns:
      the network table shared by all subnetworks.
    • getSharedNodeTable

      CyTable getSharedNodeTable()
      Returns the node table shared by all subnetworks. The columns of this table are automatically made into virtual columns of the DEFAULT node table of each subnetwork of this root network.
      Returns:
      the network table shared by all subnetworks.
    • getSharedEdgeTable

      CyTable getSharedEdgeTable()
      Returns the edge table shared by all subnetworks. The columns of this table are automatically made into virtual columns of the DEFAULT edge table of each subnetwork of this root network.
      Returns:
      the network table shared by all subnetworks.
    • restoreNode

      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.

      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 using addSubNetwork(Iterable, Iterable).
    • restoreEdge

      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.

      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 using addSubNetwork(Iterable, Iterable).