Package org.cy3sbml.util
Class NetworkUtil
java.lang.Object
org.cy3sbml.util.NetworkUtil
Helpers for the networks of a collection: the root network, the subnetworks, and the
selection of nodes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<org.cytoscape.model.CyNetwork>findBaseNetwork(Collection<org.cytoscape.model.CyNetwork> networks, Long rootSUID) The base network of the collection with the root network SUID.static Optional<org.cytoscape.model.CyNetwork>findTargetNetwork(Collection<org.cytoscape.model.CyNetwork> networks, Long rootSUID, String cyId) The network of the collection with the root network SUID that has a node for the element with the cyId: the base network if it has the node, else the kinetic or the all network.static org.cytoscape.model.CyNetworkgetRootNetwork(org.cytoscape.model.CyNetwork network) The root network of the network.static LonggetRootNetworkSUID(org.cytoscape.model.CyNetwork network) The SUID of the root network of the network.static org.cytoscape.model.CyNetworkgetSubnetwork(org.cytoscape.model.CyNetwork[] networks, String suffix) Returns the subnetwork with the given suffix, e.g.static booleanisSBMLNetwork(org.cytoscape.model.CyNetwork cyNetwork) Whether the network was created by cy3sbml: its network table has the SBML network type column.static voidselectById(org.cytoscape.model.CyNetwork network, String id) Selects the node with the SBML id, unselecting all other nodes.static voidselectByMetaId(org.cytoscape.model.CyNetwork network, String metaId) Selects the node with the cyId (metaId), unselecting all other nodes.static voidselectNodeInNetwork(org.cytoscape.model.CyNetwork network, org.cytoscape.model.CyNode node) Selects the node in the network, unselecting all other nodes.
-
Constructor Details
-
NetworkUtil
public NetworkUtil()
-
-
Method Details
-
getRootNetworkSUID
The SUID of the root network of the network.- Parameters:
network- a subnetwork, may be null- Returns:
- the root network SUID, null if the network is null
-
getRootNetwork
public static org.cytoscape.model.CyNetwork getRootNetwork(org.cytoscape.model.CyNetwork network) The root network of the network.- Parameters:
network- a subnetwork, may be null- Returns:
- the root network, null if the network is null
-
isSBMLNetwork
public static boolean isSBMLNetwork(org.cytoscape.model.CyNetwork cyNetwork) Whether the network was created by cy3sbml: its network table has the SBML network type column. It does not require that the network is in the mapping.- Parameters:
cyNetwork- the network- Returns:
- true for an SBML network
-
getSubnetwork
public static org.cytoscape.model.CyNetwork getSubnetwork(org.cytoscape.model.CyNetwork[] networks, String suffix) Returns the subnetwork with the given suffix, e.g.SBML.SUFFIX_SUBNETWORK_KINETIC: the first network named like its root network plus the suffix. Returns null if no such network exists. -
findTargetNetwork
public static Optional<org.cytoscape.model.CyNetwork> findTargetNetwork(Collection<org.cytoscape.model.CyNetwork> networks, Long rootSUID, String cyId) The network of the collection with the root network SUID that has a node for the element with the cyId: the base network if it has the node, else the kinetic or the all network. -
findBaseNetwork
public static Optional<org.cytoscape.model.CyNetwork> findBaseNetwork(Collection<org.cytoscape.model.CyNetwork> networks, Long rootSUID) The base network of the collection with the root network SUID. -
selectByMetaId
Selects the node with the cyId (metaId), unselecting all other nodes.- Parameters:
network- the networkmetaId- the cyId of the node
-
selectById
Selects the node with the SBML id, unselecting all other nodes.- Parameters:
network- the networkid- the SBML id of the node
-
selectNodeInNetwork
public static void selectNodeInNetwork(org.cytoscape.model.CyNetwork network, org.cytoscape.model.CyNode node) Selects the node in the network, unselecting all other nodes. Does nothing for null.- Parameters:
network- the networknode- the node, may be null
-