public class CyNetworkUtils extends Object
Constructor and Description |
---|
CyNetworkUtils() |
Modifier and Type | Method and Description |
---|---|
static Set<org.cytoscape.model.CyEdge> |
getAllConnectingEdges(org.cytoscape.model.CyNetwork aNetwork,
Collection<org.cytoscape.model.CyNode> nodes)
Checks the specified network has values for the given node attributes.
|
static Map<org.cytoscape.model.CyNode,MutInteger> |
getNeighborMap(org.cytoscape.model.CyNetwork aNetwork,
org.cytoscape.model.CyNode aNode)
Gets all the neighbors of the given node and their frequencies.
|
static Map<org.cytoscape.model.CyNode,MutInteger> |
getNeighborMap(org.cytoscape.model.CyNetwork aNetwork,
org.cytoscape.model.CyNode aNode,
List<org.cytoscape.model.CyEdge> aIncEdges)
Gets all the neighbors of the given node and their frequencies.
|
static Set<org.cytoscape.model.CyNode> |
getNeighbors(org.cytoscape.model.CyNetwork aNetwork,
org.cytoscape.model.CyNode aNode)
Gets all the neighbors of the given node.
|
static Set<org.cytoscape.model.CyNode> |
getNeighbors(org.cytoscape.model.CyNetwork aNetwork,
org.cytoscape.model.CyNode aNode,
List<org.cytoscape.model.CyEdge> aIncEdges)
Gets all the neighbors of the given node.
|
static int |
getPairConnCount(org.cytoscape.model.CyNetwork aNetwork,
Collection<org.cytoscape.model.CyNode> aNodeIndices,
boolean aIgnoreDir)
Gets the number of pair connections between the given set of nodes.
|
static int |
removeSelfLoops(org.cytoscape.model.CyNetwork aNetwork)
Removes all self-loops in a network and returns the number of removed self-loops.
|
public static Set<org.cytoscape.model.CyEdge> getAllConnectingEdges(org.cytoscape.model.CyNetwork aNetwork, Collection<org.cytoscape.model.CyNode> nodes)
aNetwork
- Network of interest.nodes
- Collection of CyNode CytoscapeaNetwork
have values; an empty
set if no such attributes are found.public static int getPairConnCount(org.cytoscape.model.CyNetwork aNetwork, Collection<org.cytoscape.model.CyNode> aNodeIndices, boolean aIgnoreDir)
This method effectively counts the number of edges between nodes in the given set, ignoring self-loops and multiple edges.
aNetwork
- Network containing the nodes of interest.aNodeIndices
- Indices of the nodes to be examined.aIgnoreDir
- Flag indicating if connections are undirected.[0, n(n-1)/2]
for undirected networks (
aIgnoreDir == true
) and [0, n(n-1)]
for directed networks (
aIgnoreDir == true
).public static Set<org.cytoscape.model.CyNode> getNeighbors(org.cytoscape.model.CyNetwork aNetwork, org.cytoscape.model.CyNode aNode)
Note that the node itself is never returned as its neighbor.
aNetwork
- Network that contains the node of interest - aNode
.aNode
- CyNode , whose neighbors are to be found.Set
of Node
instances, containing all the neighbors of
aNode
; empty set if the node specified is an isolated vertex.getNeighbors(CyNetwork, CyNode)
public static Set<org.cytoscape.model.CyNode> getNeighbors(org.cytoscape.model.CyNetwork aNetwork, org.cytoscape.model.CyNode aNode, List<org.cytoscape.model.CyEdge> aIncEdges)
Note that the node itself is never returned as its neighbor.
aNetwork
- Network that contains the node of interest - aNode
.aNode
- CyNode , whose neighbors are to be found.aIncEdges
- Array of all the edges incident on aNode
.Set
of Node
instances, containing all the neighbors of
aNode
; empty set if the node specified is an isolated vertex.public static Map<org.cytoscape.model.CyNode,MutInteger> getNeighborMap(org.cytoscape.model.CyNetwork aNetwork, org.cytoscape.model.CyNode aNode)
Note that the node itself is never counted as its neighbor.
aNetwork
- Network that contains the node of interest - aNode
.aNode
- CyNode , whose neighbors are to be found.Map
of Node
instances as keys, containing all the neighbors of
aNode
and the number of their occurrences as the values, encapsulated in
MutInteger
instances.getNeighborMap(CyNetwork, CyNode )
public static Map<org.cytoscape.model.CyNode,MutInteger> getNeighborMap(org.cytoscape.model.CyNetwork aNetwork, org.cytoscape.model.CyNode aNode, List<org.cytoscape.model.CyEdge> aIncEdges)
All types of edges incident on the node are considered - incoming, outgoing and undirected.
Note that the node itself is never counted as its neighbor.
aNetwork
- Network that contains the node of interest - aNode
.aNode
- CyNode , whose neighbors are to be found.aIncEdges
- Array of all the edges incident on aNode
.Map
of Node
instances as keys, containing all the neighbors of
aNode
and the number of their occurrences as values, encapsulated in
MutInteger
instances.public static int removeSelfLoops(org.cytoscape.model.CyNetwork aNetwork)
aNetwork
- Network from which self-loops are to be removed.Copyright © 2019. All rights reserved.