Author: scooter
Date: 2010-01-29 17:45:18 -0800 (Fri, 29 Jan 2010)
New Revision: 19079
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/DistanceMatrix.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/hierarchical/Matrix.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/kmeans/KCluster.java
Log:
Fixes for k-means problems
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/DistanceMatrix.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/DistanceMatrix.java
2010-01-30 01:36:55 UTC (rev 19078)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/DistanceMatrix.java
2010-01-30 01:45:18 UTC (rev 19079)
@@ -90,6 +90,16 @@
if (edgeWeight == Double.MIN_VALUE)
edgeCase.add(edgeIndex);
+ if (takeNegLOG) {
+ if (minAttribute < 0.0)
+ edgeWeight += Math.abs(minAttribute);
+
+ if(edgeWeight != 0.0 && edgeWeight !=
Double.MAX_VALUE)
+ edgeWeight = -Math.log10(edgeWeight);
+ else
+ edgeWeight = 500; // Assume 1e-500 as a
reasonble upper bound
+ }
+
edgeWeights[edgeIndex] = edgeWeight;
if (edgeWeight != Double.MIN_VALUE) {
minWeight = Math.min(minWeight, edgeWeight);
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/hierarchical/Matrix.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/hierarchical/Matrix.java
2010-01-30 01:36:55 UTC (rev 19078)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/hierarchical/Matrix.java
2010-01-30 01:45:18 UTC (rev 19079)
@@ -89,9 +89,9 @@
// Create our local copy of the weightAtributes array
String[] attributeArray = new String[weightAttributes.length];
-
+
// If our weightAttribute is on edges, we're looking at a
symmetrical matrix
- if (weightAttributes.length > 1 &&
weightAttributes[0].startsWith("node.")) {
+ if (weightAttributes.length >= 1 &&
weightAttributes[0].startsWith("node.")) {
// Get rid of the leading type information
for (int i = 0; i < weightAttributes.length; i++) {
attributeArray[i] =
weightAttributes[i].substring(5);
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/kmeans/KCluster.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/kmeans/KCluster.java
2010-01-30 01:36:55 UTC (rev 19078)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/kmeans/KCluster.java
2010-01-30 01:45:18 UTC (rev 19079)
@@ -179,6 +179,7 @@
int nelements = matrix.nRows();
int ifound = 1;
+
int[] tclusterid = new int[nelements];
int[] saved = new int[nelements];
@@ -194,7 +195,7 @@
// Outer initialization
if (nIterations <= 1) {
for (int i=0; i < clusterID.length; i++) {
- tclusterid = clusterID;
+ tclusterid[i] = clusterID[i];
}
nIterations = 1;
} else {
--
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.