private SortedSet<String> getPathwaySetFromEnzymeReactionEdges(CyNetwork network) {
   SortedSet<String> pathwaySet = new TreeSet<String>();
   for (Object edge : network.edgesList()) {
     CyEdge cyEdge = (CyEdge) edge;
     List<?> pathways =
         Attributes.edge.getListAttribute(
             cyEdge.getIdentifier(), EnzymeReactionAttribute.PATHWAYS.toAttributeName());
     if (pathways != null) {
       for (Object pathway : pathways) pathwaySet.add(pathway.toString());
     }
   }
   return pathwaySet;
 }
 private SortedSet<String> getPathwaySetFromReactionEdges(CyNetwork network) {
   SortedSet<String> pathwaySet = new TreeSet<String>();
   for (Object edge : network.edgesList()) {
     CyEdge cyEdge = (CyEdge) edge;
     String pathway =
         Attributes.edge.getStringAttribute(
             cyEdge.getIdentifier(), ReactionAttribute.PATHWAY.toAttributeName());
     if (pathway != null) {
       pathwaySet.add(pathway);
     }
   }
   return pathwaySet;
 }
 private void applySelectionToCompoundNetwork(CyNetwork network, Set<String> selection) {
   Set<CyNode> nodesSet = new HashSet<CyNode>();
   Set<CyEdge> edgesSet = new HashSet<CyEdge>();
   for (Object edge : network.edgesList()) {
     CyEdge cyEdge = (CyEdge) edge;
     String pathway =
         Attributes.edge.getStringAttribute(
             cyEdge.getIdentifier(), ReactionAttribute.PATHWAY.toAttributeName());
     if (pathway != null && selection.contains(pathway)) {
       nodesSet.add((CyNode) cyEdge.getSource());
       nodesSet.add((CyNode) cyEdge.getTarget());
       edgesSet.add(cyEdge);
     }
   }
   network.setSelectedNodeState(nodesSet, true);
   network.setSelectedEdgeState(edgesSet, true);
 }
 private void applySelectionToCGNetwork(CyNetwork network, Set<String> selection) {
   Set<CyNode> nodesSet = new HashSet<CyNode>();
   Set<CyEdge> edgesSet = new HashSet<CyEdge>();
   for (Object edge : network.edgesList()) {
     CyEdge cyEdge = (CyEdge) edge;
     List<?> pathways =
         Attributes.edge.getListAttribute(
             cyEdge.getIdentifier(), EnzymeReactionAttribute.PATHWAYS.toAttributeName());
     for (Object pathway : pathways) {
       if (selection.contains(pathway)) {
         nodesSet.add((CyNode) cyEdge.getSource());
         nodesSet.add((CyNode) cyEdge.getTarget());
         edgesSet.add(cyEdge);
         break;
       }
     }
   }
   network.setSelectedNodeState(nodesSet, true);
   network.setSelectedEdgeState(edgesSet, true);
 }