Author: scooter
Date: 2010-01-03 21:04:40 -0800 (Sun, 03 Jan 2010)
New Revision: 18813
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AbstractClusterAlgorithm.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/MCLCluster.java
Log:
More updates to pulling shared functionality out of MCL
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AbstractClusterAlgorithm.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AbstractClusterAlgorithm.java
2010-01-04 04:07:32 UTC (rev 18812)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AbstractClusterAlgorithm.java
2010-01-04 05:04:40 UTC (rev 18813)
@@ -48,6 +48,7 @@
protected ClusterProperties clusterProperties = null;
protected PropertyChangeSupport pcs;
protected boolean debug = false;
+ protected String clusterAttributeName = null;
boolean canceled = false;
public AbstractClusterAlgorithm() {
@@ -70,15 +71,25 @@
***********************************************************************/
protected void initializeProperties() {
+ }
+
+ protected void advancedProperties() {
+ clusterProperties.add(new Tunable("advancedGroup", "Advanced",
+ Tunable.GROUP, new Integer(2),
+ new Boolean(true), null,
Tunable.COLLAPSABLE));
+ clusterProperties.add(new Tunable("clusterAttrName", "Cluster
Attribute",
+ Tunable.STRING,
clusterAttributeName));
clusterProperties.add(new Tunable("debug", "Enable debugging",
- Tunable.BOOLEAN, new
Boolean(false),
- Tunable.NOINPUT));
+ Tunable.BOOLEAN, new
Boolean(false)));
}
public void updateSettings(boolean force) {
Tunable t = clusterProperties.get("debug");
if ((t != null) && (t.valueChanged() || force))
debug = ((Boolean) t.getValue()).booleanValue();
+ t = clusterProperties.get("clusterAttrName");
+ if ((t != null) && (t.valueChanged() || force))
+ clusterAttributeName = (String) t.getValue();
}
public void revertSettings() {
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
2010-01-04 04:07:32 UTC (rev 18812)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
2010-01-04 05:04:40 UTC (rev 18813)
@@ -120,8 +120,12 @@
selTune.addTunableValueListener(this);
clusterProperties.add(new Tunable("edgeCutoffGroup",
+ "Edge weight cutoff",
+ Tunable.GROUP, new
Integer(2)));
+
+ clusterProperties.add(new Tunable("edgeCutOff",
"",
- Tunable.DOUBLE, new
Double(0),
+ Tunable.DOUBLE, new Double(0),
new Double(0), new Double(1),
Tunable.USESLIDER));
clusterProperties.add(new Tunable("edgeHistogram",
@@ -164,6 +168,10 @@
if (index < 0) index = 0;
dataAttribute = attributeArray[index];
}
+ if (dataAttribute != null) {
+ Tunable et =
clusterProperties.get("edgeHistogram");
+ et.clearFlag(Tunable.IMMUTABLE);
+ }
// tunableChanged(t);
}
}
@@ -189,10 +197,8 @@
if (edgeCutOffTunable == null || dataAttribute == null)
return;
- if (dataAttribute != null) {
- Tunable t = clusterProperties.get("edgeHistogram");
- t.clearFlag(Tunable.IMMUTABLE);
- }
+ Tunable t = clusterProperties.get("edgeHistogram");
+ t.clearFlag(Tunable.IMMUTABLE);
this.matrix = new DistanceMatrix(dataAttribute, selectedOnly,
distanceValues, takeNegLOG);
double dataArray[] = matrix.getEdgeValues();
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/MCLCluster.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/MCLCluster.java
2010-01-04 04:07:32 UTC (rev 18812)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/MCLCluster.java
2010-01-04 05:04:40 UTC (rev 18813)
@@ -77,6 +77,7 @@
public MCLCluster() {
super();
+ clusterAttributeName =
Cytoscape.getCurrentNetwork().getIdentifier()+"_MCL_cluster";
logger = CyLogger.getLogger(MCLCluster.class);
initializeProperties();
}
@@ -146,6 +147,8 @@
// TODO: Add a results panel that sets the number of clusters,
average # of nodes/cluster,
// average # of inter-cluster edges, average # of
intra-cluster edges
+ super.advancedProperties();
+
clusterProperties.initializeProperties();
updateSettings(true);
}
@@ -155,7 +158,6 @@
}
public void updateSettings(boolean force) {
-
clusterProperties.updateValues();
super.updateSettings(force);
@@ -187,9 +189,8 @@
DistanceMatrix matrix = edgeAttributeHandler.getMatrix();
- String clusterAttrName =
Cytoscape.getCurrentNetwork().getIdentifier()+"_cluster";
//Cluster the nodes
- runMCL = new RunMCL(clusterAttrName, matrix,
inflation_parameter,
+ runMCL = new RunMCL(clusterAttributeName, matrix,
inflation_parameter,
rNumber, clusteringThresh, maxResidual,
logger);
if (createMetaNodes)
@@ -202,7 +203,7 @@
netAttr.setAttribute(Cytoscape.getCurrentNetwork().getIdentifier(),
ClusterMaker.CLUSTER_TYPE_ATTRIBUTE,
"mcl");
netAttr.setAttribute(Cytoscape.getCurrentNetwork().getIdentifier(),
- ClusterMaker.CLUSTER_ATTRIBUTE,
clusterAttrName);
+ ClusterMaker.CLUSTER_ATTRIBUTE,
clusterAttributeName);
// Tell any listeners that we're done
pcs.firePropertyChange(ClusterAlgorithm.CLUSTER_COMPUTED, null,
this);
--
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.