Author: pwang
Date: 2011-10-28 09:16:46 -0700 (Fri, 28 Oct 2011)
New Revision: 27325

Modified:
   
csplugins/trunk/ucsd/ruschein/PanGIA-impl/src/main/java/org/idekerlab/PanGIAPlugin/ModFinder/HCSearch2.java
Log:
Refactored to work with Cy3

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA-impl/src/main/java/org/idekerlab/PanGIAPlugin/ModFinder/HCSearch2.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA-impl/src/main/java/org/idekerlab/PanGIAPlugin/ModFinder/HCSearch2.java
 2011-10-27 23:51:47 UTC (rev 27324)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA-impl/src/main/java/org/idekerlab/PanGIAPlugin/ModFinder/HCSearch2.java
 2011-10-28 16:16:46 UTC (rev 27325)
@@ -10,6 +10,7 @@
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
+import org.cytoscape.work.TaskMonitor;
 import org.idekerlab.PanGIAPlugin.SearchTask;
 import org.idekerlab.PanGIAPlugin.data.DoubleVector;
 import org.idekerlab.PanGIAPlugin.networks.SFEdge;
@@ -22,17 +23,14 @@
 import org.idekerlab.PanGIAPlugin.utilities.NumberFormatter;
 import org.idekerlab.PanGIAPlugin.utilities.ThreadPriorityFactory;
 
-import cytoscape.task.Task;
-import cytoscape.task.TaskMonitor;
 
-
 public class HCSearch2 {
 
        /**
         *  @param percentAllocated up to what point to advance the task 
monitor progress bar
         */
        public static TypedLinkNetwork<TypedLinkNodeModule<String, BFEdge>, 
BFEdge> search(
-               SFNetwork pnet, SFNetwork gnet, HCScoringFunction sfunc, final 
TaskMonitor taskMonitor,
+               SFNetwork pnet, SFNetwork gnet, HCScoringFunction sfunc, 
TaskMonitor taskMonitor,
                final float percentAllocated, SearchTask parentTask)
        {
                // The scoring function needs to load several lookup matricies 
for the
@@ -41,7 +39,7 @@
                MemoryReporter.reportMemoryUsage();
 
                // Need to construct the ONetwork<HyperModule<String>,BFEdge> 
object.
-               taskMonitor.setStatus("1. Building merged network.");
+               taskMonitor.setStatusMessage("1. Building merged network.");
 
                TypedLinkNetwork<TypedLinkNodeModule<String, BFEdge>, BFEdge> 
results = constructBaseNetwork(
                                pnet, gnet);
@@ -52,7 +50,7 @@
                MemoryReporter.reportMemoryUsage();
 
                // Get the first-pass scores
-               taskMonitor.setStatus("2. Obtaining primary scores.");
+               taskMonitor.setStatusMessage("2. Obtaining primary scores.");
                computePrimaryScores(results, sfunc);
 
                if (parentTask.needsToHalt()) return null;
@@ -61,7 +59,7 @@
                MemoryReporter.reportMemoryUsage();
 
                // Merge best tree-pairs together
-               taskMonitor.setStatus("3. Forming clusters...");
+               taskMonitor.setStatusMessage("3. Forming clusters...");
 
                // MemoryReporter.reportMemoryUsage();
 
@@ -166,8 +164,8 @@
                                for (TypedLinkNodeModule<String, BFEdge> m : 
allc)
                                        csizes.add(m.size());
                                final int percentCompleted = 
Math.round((INITIAL_NODE_COUNT - results.numNodes()) * percentAllocated / 
INITIAL_NODE_COUNT);
-                               
taskMonitor.setPercentCompleted(percentCompleted);
-                               taskMonitor.setStatus("3. Forming clusters (# 
of clusters: "
+                               taskMonitor.setProgress(percentCompleted/100.0);
+                               taskMonitor.setStatusMessage("3. Forming 
clusters (# of clusters: "
                                                      + results.numNodes() + ", 
largest cluster size: "
                                                      + csizes.max(false) + 
")");
                        }
@@ -175,7 +173,7 @@
                        iter++;
                }
 
-               taskMonitor.setPercentCompleted(Math.round(percentAllocated));
+               taskMonitor.setProgress(Math.round(percentAllocated/100.0));
                System.out.println("Best score: " + global_scores.max(true));
                System.out.println("Best score index: " + global_scores.maxI());
                System.out.println("Number of edges before filtering: 
"+results.numEdges());

-- 
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