Author: scooter
Date: 2011-10-22 19:10:36 -0700 (Sat, 22 Oct 2011)
New Revision: 27275

Modified:
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AbstractClusterAlgorithm.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/AbstractAttributeClusterAlgorithm.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/AbstractAttributeClusterer.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/FeatureVector/FeatureVectorCluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/Matrix.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/autosome/AutoSOMECluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/hierarchical/HierarchicalCluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/kmeans/KMeansCluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/kmedoid/KMedoidCluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/AP/APCluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/MCL/MCLCluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/MCODE/MCODECluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/SCPS/SCPSCluster.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/glay/GLayCluster.java
Log:
Fixes for consistency in preparation for 1.10 release


Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AbstractClusterAlgorithm.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AbstractClusterAlgorithm.java
 2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AbstractClusterAlgorithm.java
 2011-10-23 02:10:36 UTC (rev 27275)
@@ -93,9 +93,9 @@
                clusterProperties.add(new Tunable("clusterAttrName", "Cluster 
attribute", 
                                                  Tunable.STRING, 
clusterAttributeName));
                clusterProperties.add(new Tunable("createGroups", "Create 
metanodes with results", 
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(createGroups)));
                clusterProperties.add(new Tunable("debug", "Enable debugging", 
-                                                  Tunable.BOOLEAN, new 
Boolean(false))); 
+                                                  Tunable.BOOLEAN, new 
Boolean(debug))); 
        }
 
        public void updateSettings(boolean force) {

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/AbstractAttributeClusterAlgorithm.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/AbstractAttributeClusterAlgorithm.java
    2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/AbstractAttributeClusterAlgorithm.java
    2011-10-23 02:10:36 UTC (rev 27275)
@@ -76,7 +76,7 @@
        protected boolean adjustDiagonals = false;
        protected boolean debug = false;
        protected boolean createGroups = false;
-       protected boolean ignoreMissing = false;
+       protected boolean ignoreMissing = true;
        protected boolean interimRun = false;
        protected boolean selectedOnly = false;
        protected boolean zeroMissing = false;

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/AbstractAttributeClusterer.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/AbstractAttributeClusterer.java
   2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/AbstractAttributeClusterer.java
   2011-10-23 02:10:36 UTC (rev 27275)
@@ -58,8 +58,8 @@
        protected String dataAttributes = null;
        protected DistanceMetric distanceMetric = DistanceMetric.EUCLIDEAN;
        protected boolean clusterAttributes = false;
-       protected boolean createGroups = true;
-       protected boolean ignoreMissing = false;
+       protected boolean createGroups = false;
+       protected boolean ignoreMissing = true;
        protected boolean selectedOnly = false;
        protected boolean adjustDiagonals = false;
        protected boolean zeroMissing = false;

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/FeatureVector/FeatureVectorCluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/FeatureVector/FeatureVectorCluster.java
   2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/FeatureVector/FeatureVectorCluster.java
   2011-10-23 02:10:36 UTC (rev 27275)
@@ -48,9 +48,12 @@
 import cytoscape.Cytoscape;
 import cytoscape.data.CyAttributes;
 import cytoscape.data.Semantics;
+import cytoscape.layout.CyLayoutAlgorithm;
+import cytoscape.layout.CyLayouts;
 import cytoscape.layout.Tunable;
 import cytoscape.layout.TunableListener;
 import cytoscape.logger.CyLogger;
+import cytoscape.view.CyNetworkView;
 import cytoscape.task.TaskMonitor;
 
 import clusterMaker.algorithms.AbstractClusterAlgorithm;
@@ -64,8 +67,8 @@
 
 public class FeatureVectorCluster extends AbstractAttributeClusterer 
implements TunableListener {
 
-       boolean createEdges = false;
-       double edgeCutoff = 0.5;
+       boolean createNewNetwork = true;
+       double edgeCutoff = 0.001;
        String dataAttributes = null;
        String edgeAttribute = null;
        final static String interaction = "distance";
@@ -77,7 +80,7 @@
        }
 
        public String getShortName() {return "featurevector";};
-       public String getName() {return "Create Edges from Node Attributes";};
+       public String getName() {return "Create Correlation Network from Node 
Attributes";};
 
        public JPanel getSettingsPanel() {
                // Everytime we ask for the panel, we want to update our 
attributes
@@ -123,24 +126,25 @@
                // Whether or not to only cluster selected nodes/edges
                clusterProperties.add(new Tunable("selectedOnly",
                                                  "Only use selected 
nodes/edges for cluster",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(selectedOnly)));
 
                // For expression data, we might want to exclude missing data
                clusterProperties.add(new Tunable("ignoreMissing",
                                                  "Ignore nodes/edges with no 
data",
-                                                 Tunable.BOOLEAN, new 
Boolean(true)));
+                                                 Tunable.BOOLEAN, new 
Boolean(ignoreMissing)));
 
                // Whether to create a new network or add values to existing 
network
-               Tunable t = new Tunable("createEdges",
-                                       "Create edges if they don't exist",
-                                       Tunable.BOOLEAN, new Boolean(false));
+               Tunable t = new Tunable("createNewNetwork",
+                                       "Create a new network",
+                                       Tunable.BOOLEAN, new 
Boolean(createNewNetwork));
                t.addTunableValueListener(this);
                clusterProperties.add(t);
 
                // If we're creating edges, do we have a cut-off value?
                t = new Tunable("edgeCutoff", "Only create edges if nodes are 
closer than this",
-                               Tunable.DOUBLE, new Double(0.5));
-               t.setImmutable(true);
+                               Tunable.DOUBLE, new Double(edgeCutoff));
+               if (!createNewNetwork)
+                       t.setImmutable(true);
                clusterProperties.add(t);
 
                clusterProperties.add(new Tunable("advancedParametersGroup",
@@ -157,7 +161,7 @@
                // How to handle missing data
                clusterProperties.add(new Tunable("zeroMissing",
                                                  "Set missing data to zero 
(not common)",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(zeroMissing)));
 
                clusterProperties.initializeProperties();
                updateSettings(true);
@@ -168,10 +172,10 @@
        }
 
        public void tunableChanged(Tunable tunable) {
-               if (tunable.getName().equals("createEdges")) {
-                       createEdges = ((Boolean) 
tunable.getValue()).booleanValue();
+               if (tunable.getName().equals("createNewNetwork")) {
+                       createNewNetwork = ((Boolean) 
tunable.getValue()).booleanValue();
                        Tunable t = clusterProperties.get("edgeCutoff");
-                       if (createEdges)
+                       if (createNewNetwork)
                                t.setImmutable(false);
                        else
                                t.setImmutable(true);
@@ -190,6 +194,10 @@
                if ((t != null) && (t.valueChanged() || force))
                        selectedOnly = ((Boolean) t.getValue()).booleanValue();
 
+               t = clusterProperties.get("ignoreMissing");
+               if ((t != null) && (t.valueChanged() || force))
+                       ignoreMissing = ((Boolean) t.getValue()).booleanValue();
+
                t = clusterProperties.get("attributeList");
                if ((t != null) && (t.valueChanged() || force)) {
                        dataAttributes = (String) t.getValue();
@@ -203,9 +211,9 @@
                if ((t != null) && (t.valueChanged() || force))
                        edgeAttribute = (String) t.getValue();
 
-               t = clusterProperties.get("createEdges");
+               t = clusterProperties.get("createNewNetwork");
                if ((t != null) && (t.valueChanged() || force))
-                       createEdges = ((Boolean) t.getValue()).booleanValue();
+                       createNewNetwork = ((Boolean) 
t.getValue()).booleanValue();
 
                t = clusterProperties.get("edgeCutoff");
                if ((t != null) && (t.valueChanged() || force))
@@ -258,8 +266,8 @@
                CyAttributes edgeAttributes = Cytoscape.getEdgeAttributes();
 
                // For each node, get the distance to all other nodes
-               double maxdistance = 0.0;
-               double mindistance = 0.0;
+               double maxdistance = Double.MIN_VALUE;
+               double mindistance = Double.MAX_VALUE;
 
                double distanceMatrix[][] = new double[nNodes][nNodes];
                for (int i = 0; i < nNodes; i++) {
@@ -280,7 +288,7 @@
                }
 
                int[] nodeArray = new int[2];
-               Map<CyEdge, Double> edgeList = new HashMap<CyEdge, Double>();
+               List<CyEdge> edgeList = new ArrayList<CyEdge>();
                double scale = maxdistance - mindistance;
 
                /* Performance tuning -- what's taking all the time!
@@ -296,7 +304,7 @@
                for (int i = 0; i < nNodes; i++) {
                        for (int j = i+1; j < nNodes; j++) {
                                // time = System.currentTimeMillis();
-                               double distance = distanceMatrix[i][j]/scale;
+                               double distance = 
(distanceMatrix[i][j]-mindistance)/scale;
                                CyNode source = 
Cytoscape.getCyNode(matrix.getRowLabel(i));
                                CyNode target = 
Cytoscape.getCyNode(matrix.getRowLabel(j));
                                nodeArray[0] = source.getRootGraphIndex();
@@ -304,34 +312,25 @@
 
                                // nodeFetchTime += 
System.currentTimeMillis()-time;
 
-                               if (createEdges == true && distance > 
edgeCutoff)
+                               if (createNewNetwork == true && distance > 
edgeCutoff)
                                        continue;
 
                                // time = System.currentTimeMillis();
-
                                CyEdge edge;
-                               int[] edgeArray = 
network.getConnectingEdgeIndicesArray(nodeArray);
-                               // edgeFetchTime += 
System.currentTimeMillis()-time;
-                               // time = System.currentTimeMillis();
-
-                               if ((edgeArray == null || edgeArray.length == 
0) && createEdges == true) {
+                               if (createNewNetwork == true) {
                                        edge = myCreateEdge(source, target, 
edgeAttributes);
-
-                                       // edgeCreateTime += 
System.currentTimeMillis()-time;
-                                       // System.out.println("Creating edge 
between "+source+" and "+target);
-                                       if (edge != null) {
-                                               // System.out.println("Adding 
edge "+edge.getIdentifier()+" to network");
-                                               // time = 
System.currentTimeMillis();
-                                               network.addEdge(edge);
-                                               // networkAddTime += 
System.currentTimeMillis()-time;
-                                       }
-                               } else if (edgeArray == null || 
edgeArray.length == 0) {
-                                       continue;
+                                       edgeList.add(edge);
                                } else {
-                                       edge = 
(CyEdge)network.getEdge(edgeArray[0]);
+                                       int[] edgeArray = 
network.getConnectingEdgeIndicesArray(nodeArray);
                                        // edgeFetchTime += 
System.currentTimeMillis()-time;
+                                       // time = System.currentTimeMillis();
+                                       if (edgeArray == null || 
edgeArray.length == 0) {
+                                               continue;
+                                       } else {
+                                               edge = 
(CyEdge)network.getEdge(edgeArray[0]);
+                                               // edgeFetchTime += 
System.currentTimeMillis()-time;
+                                       }
                                }
-
                                if (edge == null) continue;
                                // time = System.currentTimeMillis();
                                
edgeAttributes.setAttribute(edge.getIdentifier(), edgeAttribute, distance);
@@ -343,6 +342,18 @@
                        }
                }
 
+               // If we're supposed to, create the new network
+               if (createNewNetwork) {
+                       List nodeList = network.nodesList();
+                       CyNetwork net = Cytoscape.createNetwork(nodeList, 
edgeList, network.getTitle()+"--clustered",network,false);
+                       // Create the network view
+                       CyNetworkView view = Cytoscape.createNetworkView(net);
+                       // If available, do a force-directed layout
+                       CyLayoutAlgorithm alg = 
CyLayouts.getLayout("force-directed");
+                       if (alg != null)
+                               view.applyLayout(alg);
+               }
+
                /*
                System.out.println("Created "+newEdges+" edges");
                System.out.println("Edge creation time: "+edgeCreateTime+"ms");

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/Matrix.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/Matrix.java
       2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/Matrix.java
       2011-10-23 02:10:36 UTC (rev 27275)
@@ -32,12 +32,13 @@
  */
 package clusterMaker.algorithms.attributeClusterers;
 
-import java.util.List;
-import java.util.HashMap;
 import java.util.ArrayList;
-import java.util.Set;
 import java.util.Arrays;
 import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.lang.Exception;
 
 import cytoscape.CyNode;
@@ -478,7 +479,7 @@
                nodeList = sortNodeList(nodeList);
 
                // Make a map of the conditions, indexed by CyNode
-               HashMap<CyNode,HashMap<String,Double>>nodeCondMap = new 
HashMap<CyNode,HashMap<String,Double>>();
+               Map<CyNode,Map<String,Double>>nodeCondMap = new 
HashMap<CyNode,Map<String,Double>>();
 
                // Make a map of the conditions, by name
                List<String>condList = Arrays.asList(weightAttributes);
@@ -489,7 +490,7 @@
                // Iterate over all of our nodes, getting the conditions 
attributes
                for (CyNode node: nodeList) {
                        // Create the map for this node
-                       HashMap<String,Double>thisCondMap = new 
HashMap<String,Double>();
+                       Map<String,Double>thisCondMap = new 
HashMap<String,Double>();
 
                        for (int attrIndex = 0; attrIndex < 
weightAttributes.length; attrIndex++) {
                                String attr = weightAttributes[attrIndex];
@@ -505,6 +506,7 @@
                                        continue; // At some point, handle 
lists?
                                }
                                if (!ignoreMissing || value != null) {
+                                       // System.out.println("Node = 
"+node.getIdentifier()+", attribute = "+attr+", ignoreMissing = 
"+ignoreMissing+" value = "+value);
                                        // Set it
                                        thisCondMap.put(attr, value);
                                }
@@ -530,7 +532,7 @@
                                if (!nodeCondMap.containsKey(node))
                                        continue;
 
-                               HashMap<String,Double>thisCondMap = 
nodeCondMap.get(node);
+                               Map<String,Double>thisCondMap = 
nodeCondMap.get(node);
                                this.columnLabels[column] = 
node.getIdentifier();
                                this.columnNodes[column] = node;
                                for (int row=0; row < this.nRows; row++) {
@@ -558,7 +560,7 @@
                                        continue;
                                this.rowLabels[row] = node.getIdentifier();
                                this.rowNodes[row] = node;
-                               HashMap<String,Double>thisCondMap = 
nodeCondMap.get(node);
+                               Map<String,Double>thisCondMap = 
nodeCondMap.get(node);
                                for (int column=0; column < this.nColumns; 
column++) {
                                        String columnLabel = 
this.columnLabels[column];
                                        if 
(thisCondMap.containsKey(columnLabel)) {
@@ -588,7 +590,7 @@
 
        // sortNodeList does an alphabetical sort on the names of the nodes.
        private List<CyNode>sortNodeList(List<CyNode>nodeList) {
-               HashMap<String,CyNode>nodeMap = new HashMap<String, CyNode>();
+               Map<String,CyNode>nodeMap = new HashMap<String, CyNode>();
                // First build a string array
                String nodeNames[] = new String[nodeList.size()];
                int index = 0;

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/autosome/AutoSOMECluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/autosome/AutoSOMECluster.java
     2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/autosome/AutoSOMECluster.java
     2011-10-23 02:10:36 UTC (rev 27275)
@@ -137,6 +137,15 @@
                logger = CyLogger.getLogger(AutoSOMECluster.class);
                this.heatmap = heatmap;
                if (heatmap) cluster_output = 1;
+
+               // Initialize our settings
+               settings.ensemble_runs = 50;
+               settings.mst_pval = 0.05;
+               settings.threads = Runtime.getRuntime().availableProcessors();
+               settings.logNorm = false;
+               settings.unitVar = false;
+               settings.distMatrix = false;
+
                initializeProperties();
        }
 
@@ -178,7 +187,7 @@
                                                  (Object)attributeArray, 
(Object)null, Tunable.MULTISELECT));
 
                clusterProperties.add(new Tunable("selectedOnly", "Only use 
selected nodes for clustering",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(selectedNodes)));
 
                Tunable ign = new Tunable("ignoreMissing", "Ignore nodes/edges 
with no data",
                                                                                
                                  Tunable.BOOLEAN, ignoreMissing);
@@ -198,20 +207,20 @@
                // Clustering Threshold
                ensembleRuns = new Tunable("ensembleRuns",
                                                  "Number of Ensemble Runs",
-                                                 Tunable.INTEGER, new 
Integer(50),
+                                                 Tunable.INTEGER, new 
Integer(settings.ensemble_runs),
                                                  new Integer(1), (Object)null, 
0);
                clusterProperties.add(ensembleRuns);
 
                // Number of iterations
                clusterProperties.add(new Tunable("pvalueThresh",
                                                  "P-Value Threshold",
-                                                 Tunable.DOUBLE, new 
Double(0.05),
+                                                 Tunable.DOUBLE, new 
Double(settings.mst_pval),
                                                  new Double(0), new Double(1), 
0));
 
                // Number of iterations
                clusterProperties.add(new Tunable("numThreads",
                                                  "Number of Threads (No. 
CPUs)",
-                                                 Tunable.INTEGER, new 
Integer(Runtime.getRuntime().availableProcessors()),
+                                                 Tunable.INTEGER, new 
Integer(settings.threads),
                                                  new Integer(1), (Object)null, 
0));
              
 
@@ -230,12 +239,12 @@
 
                logscaling = new Tunable("logScaling",
                                                  "Log2 Scaling",
-                                                 Tunable.BOOLEAN, new 
Boolean(false));
+                                                 Tunable.BOOLEAN, new 
Boolean(settings.logNorm));
                clusterProperties.add(logscaling);
 
                unitVar = new Tunable("unitVariance",
                                                  "Unit Variance",
-                                                 Tunable.BOOLEAN, new 
Boolean(false));
+                                                 Tunable.BOOLEAN, new 
Boolean(settings.unitVar));
                clusterProperties.add(unitVar);
 
                medCent = new Tunable("medCenter",
@@ -263,7 +272,7 @@
                                                  new Boolean(true), null, 
Tunable.COLLAPSABLE));
 
                Tunable fcn = new Tunable("enableFCN", "Perform Fuzzy 
Clustering",
-                                                 Tunable.BOOLEAN, new 
Boolean(false));
+                                                 Tunable.BOOLEAN, new 
Boolean(settings.distMatrix));
                fcn.addTunableValueListener(this);
                clusterProperties.add(fcn);
 

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/hierarchical/HierarchicalCluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/hierarchical/HierarchicalCluster.java
     2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/hierarchical/HierarchicalCluster.java
     2011-10-23 02:10:36 UTC (rev 27275)
@@ -130,17 +130,17 @@
                // Whether or not to only cluster selected nodes/edges
                clusterProperties.add(new Tunable("selectedOnly",
                                                  "Only use selected 
nodes/edges for cluster",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(selectedOnly)));
 
                // Whether or not to cluster attributes as well as nodes
                clusterProperties.add(new Tunable("clusterAttributes",
                                                  "Cluster attributes as well 
as nodes", 
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(clusterAttributes)));
 
                // For expression data, we might want to exclude missing data
                clusterProperties.add(new Tunable("ignoreMissing",
                                                  "Ignore nodes/edges with no 
data",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(ignoreMissing)));
 
                clusterProperties.add(new Tunable("advancedParametersGroup",
                                                  "Advanced Parameters",
@@ -151,17 +151,17 @@
                // How to handle missing data
                clusterProperties.add(new Tunable("zeroMissing",
                                                  "Set missing data to zero 
(not common)",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(zeroMissing)));
 
                // Adjust loops
                clusterProperties.add(new Tunable("adjustDiagonals",
                                                  "Adjust loops (not common)",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(adjustDiagonals)));
 
                // Whether or not to create groups
                clusterProperties.add(new Tunable("createGroups",
                                                  "Create groups from 
clusters", 
-                                                 Tunable.BOOLEAN, new 
Boolean(true)));
+                                                 Tunable.BOOLEAN, new 
Boolean(createGroups)));
 
                clusterProperties.initializeProperties();
                updateSettings(true);

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/kmeans/KMeansCluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/kmeans/KMeansCluster.java
 2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/kmeans/KMeansCluster.java
 2011-10-23 02:10:36 UTC (rev 27275)
@@ -56,7 +56,7 @@
 // clusterMaker imports
 
 public class KMeansCluster extends AbstractAttributeClusterer {
-       int rNumber = 0;
+       int rNumber = 50;
        KnnView knnView = null;
 
        public KMeansCluster() {
@@ -100,7 +100,7 @@
                // Number of iterations
                clusterProperties.add(new Tunable("iterations",
                                                  "Number of iterations",
-                                                 Tunable.INTEGER, new 
Integer(50),
+                                                 Tunable.INTEGER, new 
Integer(rNumber),
                                                  (Object)new Integer(rNumber), 
(Object)null, 0));
 
                // The distance metric to use
@@ -123,12 +123,12 @@
                // Whether or not to only cluster selected nodes/edges
                clusterProperties.add(new Tunable("selectedOnly",
                                                  "Only use selected 
nodes/edges for cluster",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(selectedOnly)));
 
                // Whether or not to cluster attributes as well as nodes
                clusterProperties.add(new Tunable("clusterAttributes",
                                                  "Cluster attributes as well 
as nodes", 
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(clusterAttributes)));
 
 /*
                // For expression data, we might want to exclude missing data
@@ -140,7 +140,7 @@
                // Whether or not to create groups
                clusterProperties.add(new Tunable("createGroups",
                                                  "Create groups from 
clusters", 
-                                                 Tunable.BOOLEAN, new 
Boolean(true)));
+                                                 Tunable.BOOLEAN, new 
Boolean(createGroups)));
 
                clusterProperties.initializeProperties();
                updateSettings(true);

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/kmedoid/KMedoidCluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/kmedoid/KMedoidCluster.java
       2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/attributeClusterers/kmedoid/KMedoidCluster.java
       2011-10-23 02:10:36 UTC (rev 27275)
@@ -57,7 +57,7 @@
 // clusterMaker imports
 
 public class KMedoidCluster extends AbstractAttributeClusterer {
-       int rNumber = 0;
+       int rNumber = 10;
        KnnView knnView = null;
 
        public KMedoidCluster() {
@@ -101,7 +101,7 @@
                // Number of iterations
                clusterProperties.add(new Tunable("iterations",
                                                  "Number of iterations",
-                                                 Tunable.INTEGER, new 
Integer(10),
+                                                 Tunable.INTEGER, new 
Integer(rNumber),
                                                  (Object)rNumber, 
(Object)null, 0));
 
                // The distance metric to use
@@ -124,12 +124,12 @@
                // Whether or not to only cluster selected nodes/edges
                clusterProperties.add(new Tunable("selectedOnly",
                                                  "Only use selected 
nodes/edges for cluster",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(selectedOnly)));
 
                // Whether or not to cluster attributes as well as nodes
                clusterProperties.add(new Tunable("clusterAttributes",
                                                  "Cluster attributes as well 
as nodes", 
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(clusterAttributes)));
 
 /*
                // For expression data, we might want to exclude missing data
@@ -141,7 +141,7 @@
                // Whether or not to create groups
                clusterProperties.add(new Tunable("createGroups",
                                                  "Create groups from 
clusters", 
-                                                 Tunable.BOOLEAN, new 
Boolean(true)));
+                                                 Tunable.BOOLEAN, new 
Boolean(createGroups)));
 
                clusterProperties.initializeProperties();
                updateSettings(true);

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/AP/APCluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/AP/APCluster.java
   2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/AP/APCluster.java
   2011-10-23 02:10:36 UTC (rev 27275)
@@ -106,18 +106,18 @@
                // Lambda Parameter
                clusterProperties.add(new Tunable("lambda",
                                                  "Lambda Parameter",
-                                                 Tunable.DOUBLE, new 
Double(.5),
+                                                 Tunable.DOUBLE, new 
Double(lambda),
                                                  (Object)null, (Object)null, 
0));
                // Clustering Threshold
                clusterProperties.add(new Tunable("preference",
                                                  "Preference Parameter (Set to 
Avg Edge Weight if < 0)",
-                                                 Tunable.DOUBLE, new 
Double(-1),
+                                                 Tunable.DOUBLE, new 
Double(preference),
                                                  (Object)null, (Object)null, 
0));
 
                // Number of iterations
                clusterProperties.add(new Tunable("iterations",
                                                  "Number of iterations",
-                                                 Tunable.INTEGER, new 
Integer(10),
+                                                 Tunable.INTEGER, new 
Integer(rNumber),
                                                  (Object)null, (Object)null, 
0));
 
               

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/MCL/MCLCluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/MCL/MCLCluster.java
 2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/MCL/MCLCluster.java
 2011-10-23 02:10:36 UTC (rev 27275)
@@ -68,7 +68,7 @@
 public class MCLCluster extends AbstractNetworkClusterer  {
        
        double inflation_parameter = 2.0;
-       int rNumber = 8;
+       int rNumber = 16;
        double clusteringThresh = 1e-15;
        double maxResidual = 0.001;
        int maxThreads = 0;
@@ -108,7 +108,7 @@
                // Inflation Parameter
                clusterProperties.add(new Tunable("inflation_parameter",
                                                  "Granularity parameter 
(inflation value)",
-                                                 Tunable.DOUBLE, new 
Double(2.0),
+                                                 Tunable.DOUBLE, new 
Double(inflation_parameter),
                                                  (Object)null, (Object)null, 
0));
 
                // Use the standard edge attribute handling stuff....
@@ -120,25 +120,25 @@
                // Clustering Threshold
                clusterProperties.add(new Tunable("clusteringThresh",
                                                  "Weak edge weight pruning 
threshold",
-                                                 Tunable.DOUBLE, new 
Double(1e-15),
+                                                 Tunable.DOUBLE, new 
Double(clusteringThresh),
                                                  (Object)null, (Object)null, 
0));
 
                // Number of iterations
                clusterProperties.add(new Tunable("iterations",
                                                  "Number of iterations",
-                                                 Tunable.INTEGER, new 
Integer(16),
+                                                 Tunable.INTEGER, new 
Integer(rNumber),
                                                  (Object)null, (Object)null, 
0));
 
                // Number of iterations
                clusterProperties.add(new Tunable("maxResidual",
                                                  "Maximum residual value",
-                                                 Tunable.DOUBLE, new 
Double(.0001),
+                                                 Tunable.DOUBLE, new 
Double(maxResidual),
                                                  (Object)null, (Object)null, 
0));
 
                // Maximum number of CPU's to use
                clusterProperties.add(new Tunable("maxThreads",
                                                  "Maximum number of threads",
-                                                 Tunable.INTEGER, new 
Integer(0),
+                                                 Tunable.INTEGER, new 
Integer(maxThreads),
                                                  (Object)null, (Object)null, 
0));
 
                super.advancedProperties();

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/MCODE/MCODECluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/MCODE/MCODECluster.java
     2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/MCODE/MCODECluster.java
     2011-10-23 02:10:36 UTC (rev 27275)
@@ -74,6 +74,16 @@
        final static int INTERRUPTION = 3;
        int analyze = FIRST_TIME;
 
+       boolean includeLoops = false;
+       boolean haircut = true;
+       boolean fluff = false;
+       double scoreCutoff = 0.2;
+       boolean selectedOnly = false;
+       int degreeCutoff = 2;
+       int kCore = 2;
+       int maxDepth = 100;
+
+
        MCODEParameterSet currentParamsCopy;
 
        RunMCODE runMCODE;
@@ -110,7 +120,7 @@
                {
                        clusterProperties.add(new Tunable("selectedOnly",
                                                          "Cluster only 
selected nodes", 
-                                                         Tunable.BOOLEAN, new 
Boolean(false)));
+                                                         Tunable.BOOLEAN, new 
Boolean(selectedOnly)));
 
                        clusterProperties.add(new Tunable("advanced_panel",
                                                          "Advanced Tuning 
Options",
@@ -126,11 +136,11 @@
                                {
                                        clusterProperties.add(new 
Tunable("includeLoops",
                                                                          
"Include loops", 
-                                                                         
Tunable.BOOLEAN, new Boolean(false)));
+                                                                         
Tunable.BOOLEAN, new Boolean(includeLoops)));
 
                                        clusterProperties.add(new 
Tunable("degreeCutoff",
                                                                          
"Degree Cutoff", 
-                                                                         
Tunable.INTEGER, new Integer(2)));
+                                                                         
Tunable.INTEGER, new Integer(degreeCutoff)));
                                }
 
                                clusterProperties.add(new 
Tunable("cluster_panel",
@@ -141,23 +151,23 @@
                                {
                                        clusterProperties.add(new 
Tunable("haircut",
                                                                          
"Haircut", 
-                                                                         
Tunable.BOOLEAN, new Boolean(true)));
+                                                                         
Tunable.BOOLEAN, new Boolean(haircut)));
 
                                        clusterProperties.add(new 
Tunable("fluff",
                                                                          
"Fluff", 
-                                                                         
Tunable.BOOLEAN, new Boolean(false)));
+                                                                         
Tunable.BOOLEAN, new Boolean(fluff)));
 
                                        clusterProperties.add(new 
Tunable("scoreCutoff",
                                                                          "Node 
Score Cutoff", 
-                                                                         
Tunable.DOUBLE, new Double(0.2)));
+                                                                         
Tunable.DOUBLE, new Double(scoreCutoff)));
 
                                        clusterProperties.add(new 
Tunable("kCore",
                                                                          
"K-Core", 
-                                                                         
Tunable.INTEGER, new Integer(2)));
+                                                                         
Tunable.INTEGER, new Integer(kCore)));
 
                                        clusterProperties.add(new 
Tunable("maxDepth",
                                                                          "Max 
Depth", 
-                                                                         
Tunable.INTEGER, new Integer(100)));
+                                                                         
Tunable.INTEGER, new Integer(maxDepth)));
 
                                }
                        }
@@ -178,7 +188,7 @@
 
                Tunable t = clusterProperties.get("selectedOnly");
                if ((t != null) && (t.valueChanged() || force)) {
-                       boolean selectedOnly = ((Boolean) 
t.getValue()).booleanValue();
+                       selectedOnly = ((Boolean) t.getValue()).booleanValue();
                        if (selectedOnly)
                                
currentParamsCopy.setScope(MCODEParameterSet.SELECTION);
                        else
@@ -187,43 +197,43 @@
 
                t = clusterProperties.get("includeLoops");
                if ((t != null) && (t.valueChanged() || force)) {
-                       boolean includeLoops = ((Boolean) 
t.getValue()).booleanValue();
+                       includeLoops = ((Boolean) t.getValue()).booleanValue();
                        currentParamsCopy.setIncludeLoops(includeLoops);
                }
 
                t = clusterProperties.get("degreeCutoff");
                if ((t != null) && (t.valueChanged() || force)) {
-                       int degreeCutoff = ((Integer) t.getValue()).intValue();
+                       degreeCutoff = ((Integer) t.getValue()).intValue();
                        currentParamsCopy.setDegreeCutoff(degreeCutoff);
                }
 
                t = clusterProperties.get("haircut");
                if ((t != null) && (t.valueChanged() || force)) {
-                       boolean haircut = ((Boolean) 
t.getValue()).booleanValue();
+                       haircut = ((Boolean) t.getValue()).booleanValue();
                        currentParamsCopy.setHaircut(haircut);
                }
 
                t = clusterProperties.get("fluff");
                if ((t != null) && (t.valueChanged() || force)) {
-                       boolean fluff = ((Boolean) t.getValue()).booleanValue();
+                       fluff = ((Boolean) t.getValue()).booleanValue();
                        currentParamsCopy.setFluff(fluff);
                }
 
                t = clusterProperties.get("scoreCutoff");
                if ((t != null) && (t.valueChanged() || force)) {
-                       double scoreCutoff = ((Double) 
t.getValue()).doubleValue();
+                       scoreCutoff = ((Double) t.getValue()).doubleValue();
                        currentParamsCopy.setNodeScoreCutoff(scoreCutoff);
                }
 
                t = clusterProperties.get("kCore");
                if ((t != null) && (t.valueChanged() || force)) {
-                       int kCore = ((Integer) t.getValue()).intValue();
+                       kCore = ((Integer) t.getValue()).intValue();
                        currentParamsCopy.setKCore(kCore);
                }
 
                t = clusterProperties.get("maxDepth");
                if ((t != null) && (t.valueChanged() || force)) {
-                       int maxDepth = ((Integer) t.getValue()).intValue();
+                       maxDepth = ((Integer) t.getValue()).intValue();
                        currentParamsCopy.setMaxDepthFromStart(maxDepth);
                }
 

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/SCPS/SCPSCluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/SCPS/SCPSCluster.java
       2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/SCPS/SCPSCluster.java
       2011-10-23 02:10:36 UTC (rev 27275)
@@ -106,21 +106,21 @@
                // Lambda Parameter
                clusterProperties.add(new Tunable("epsilon",
                                                  "epsilon Parameter",
-                                                 Tunable.DOUBLE, new 
Double(1.02),
+                                                 Tunable.DOUBLE, new 
Double(epsilon),
                                                  (Object)null, (Object)null, 
0));
              
 
                // Number of iterations
                clusterProperties.add(new Tunable("iterations",
                                                  "Number of iterations",
-                                                 Tunable.INTEGER, new 
Integer(50),
+                                                 Tunable.INTEGER, new 
Integer(rNumber),
                                                  (Object)null, (Object)null, 
0));
 
                
                // K. Trumps epsilon if set to greater then zero
                 clusterProperties.add(new Tunable("knumber",
                                                   "Number of clusters",
-                                                  Tunable.INTEGER, new 
Integer(-1),
+                                                  Tunable.INTEGER, new 
Integer(knumber),
                                                   (Object)null, (Object)null, 
0));
 
               

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/glay/GLayCluster.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/glay/GLayCluster.java
       2011-10-22 18:46:42 UTC (rev 27274)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/networkClusterers/glay/GLayCluster.java
       2011-10-23 02:10:36 UTC (rev 27275)
@@ -98,11 +98,11 @@
 
                // Whether or not to create a new network from the results
                clusterProperties.add(new Tunable("selectedOnly","Cluster only 
selected nodes",
-                                                 Tunable.BOOLEAN, new 
Boolean(false)));
+                                                 Tunable.BOOLEAN, new 
Boolean(selectedOnly)));
 
                //Whether or not to assume the edges are undirected
                clusterProperties.add(new Tunable("undirectedEdges","Assume 
edges are undirected",
-                                                 Tunable.BOOLEAN, new 
Boolean(true)));
+                                                 Tunable.BOOLEAN, new 
Boolean(undirectedEdges)));
 
                clusterProperties.add(new Tunable("results_panel",
                                                  "Results",

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