return graph;
}
public CySubNetwork createSubNetwork(final CyNetwork net, final Collection<CyNode> nodes, final SavePolicy policy) {
final CyRootNetwork root = rootNetworkMgr.getRootNetwork(net);
final Set<CyEdge> edges = new HashSet<CyEdge>();
for (CyNode n : nodes) {
Set<CyEdge> adjacentEdges = new HashSet<CyEdge>(net.getAdjacentEdgeList(n, CyEdge.Type.ANY));
// Get only the edges that connect nodes that belong to the subnetwork:
for (CyEdge e : adjacentEdges) {
if (nodes.contains(e.getSource()) && nodes.contains(e.getTarget())) {
edges.add(e);
}
}
}
final CySubNetwork subNet = root.addSubNetwork(nodes, edges, policy);
// Save it for later disposal
Set<CySubNetwork> snSet = createdSubNetworks.get(root);
if (snSet == null) {