Author: pwang
Date: 2011-11-01 09:26:24 -0700 (Tue, 01 Nov 2011)
New Revision: 27357

Modified:
   
csplugins/trunk/ucsd/pwang/jActiveModules31/src/main/java/csplugins/jActiveModules/ActivePaths.java
Log:
More bugs fixed

Modified: 
csplugins/trunk/ucsd/pwang/jActiveModules31/src/main/java/csplugins/jActiveModules/ActivePaths.java
===================================================================
--- 
csplugins/trunk/ucsd/pwang/jActiveModules31/src/main/java/csplugins/jActiveModules/ActivePaths.java
 2011-11-01 15:23:53 UTC (rev 27356)
+++ 
csplugins/trunk/ucsd/pwang/jActiveModules31/src/main/java/csplugins/jActiveModules/ActivePaths.java
 2011-11-01 16:26:24 UTC (rev 27357)
@@ -199,7 +199,7 @@
        }
 
        public void run() {
-
+               
            System.gc();
                //long start = System.currentTimeMillis();
                HashMap expressionMap = generateExpressionMap();
@@ -214,6 +214,10 @@
                //1 . create subnetwork for each path
                CyNetwork[] subnetworks = createSubnetworks();
                
+               for (int i=0; i<subnetworks.length; i++){
+                       this.cyNetworkManager.addNetwork(subnetworks[i]);       
                
+               }
+               
                //2. create an overview network for all nested network
                final CyNetwork overview = this.cyNetworkFactory.getInstance();
                overview.getCyRow().set("name", "jActiveModules Search Result 
"+ runCount++);
@@ -232,6 +236,8 @@
                        }
                        newNode.getCyRow().set(NODE_SCORE, new 
Double(activePaths[i].getScore()));
                }
+
+               this.cyNetworkManager.addNetwork(overview);
                
                //Edges indicate that nodes in nested networks exist in both 
nested networks
                Set<CyEdge>  path_edges = getPathEdges(overview, path_nodes); 
//new HashSet<CyEdge>();
@@ -244,7 +250,6 @@
                
overview.getDefaultEdgeTable().createColumn("jActiveModules_nodeOverlapCount", 
Integer.class, false);
                overview.getDefaultEdgeTable().createColumn(EDGE_SCORE, 
Double.class, false);
                
-               
                CyTable cyEdgeAttrs = this.cyNetwork.getDefaultEdgeTable(); 
//Cytoscape.getEdgeAttributes();
                Iterator it = path_edges.iterator();
                while(it.hasNext()){
@@ -264,13 +269,21 @@
                        //cyEdgeAttrs.setAttribute(aEdge.getIdentifier(), 
EDGE_SCORE, overlapScore);
                        aEdge.getCyRow().set(EDGE_SCORE, overlapScore);
                }
-                               
+
                //4. Create an view for overview network and apply visual style
                //Cytoscape.createNetworkView(overview, 
overview.getIdentifier(), tuning(), null);
                final CyNetworkView newView = 
this.cyNetworkViewFactory.getNetworkView(overview);
+               this.cyNetworkViewManager.addNetworkView(newView);
                
-               this.visualMappingManager.setVisualStyle(overviewVS, newView);
-               newView.updateView();
+//             this.visualMappingManager.setVisualStyle(overviewVS, newView);
+
+               //newView.updateView();
+
+               // Apply layout for overview
+               CyLayoutAlgorithm alg = 
this.cyLayoutsService.getLayout("force-directed");
+               alg.setNetworkView(newView);
+               this.taskManagerService.execute(alg);                           
+
                
                // Create view for top n modules
                int n = -1;
@@ -287,14 +300,15 @@
 
                 for (int i=0; i<n; i++){
                                CyNetworkView theView = 
this.cyNetworkViewFactory.getNetworkView(subnetworks[i]);
+                               
this.cyNetworkViewManager.addNetworkView(theView);
                                
-                               
this.visualMappingManager.setVisualStyle(moduleVS, theView);
-                               theView.updateView();
+//                             
this.visualMappingManager.setVisualStyle(moduleVS, theView);
+//                             theView.updateView();
                                
-                               CyLayoutAlgorithm alg = 
this.cyLayoutsService.getLayout("force-directed");
+                               CyLayoutAlgorithm alg_f = 
this.cyLayoutsService.getLayout("force-directed");
                                alg.setNetworkView(theView);
                                
-                               this.taskManagerService.execute(alg);           
                
+                               this.taskManagerService.execute(alg_f);         
                
                 }
        }
        

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to