Author: scooter
Date: 2011-06-01 13:41:09 -0700 (Wed, 01 Jun 2011)
New Revision: 25613
Added:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter1.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter2.java
Removed:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter.java
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AP/RunAP.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/autosome/RunAutoSOME.java
Log:
Add new edge conversion type.
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AP/RunAP.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AP/RunAP.java
2011-06-01 16:28:21 UTC (rev 25612)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/AP/RunAP.java
2011-06-01 20:41:09 UTC (rev 25613)
@@ -139,7 +139,7 @@
}
int clusterNumber = 1;
- Map<NodeCluster,NodeCluster> cMap = new HashMap();
+ Map<NodeCluster,NodeCluster> cMap = new
HashMap<NodeCluster,NodeCluster>();
for (NodeCluster cluster: NodeCluster.sortMap(clusterMap)) {
if (cMap.containsKey(cluster))
continue;
@@ -160,7 +160,7 @@
}
Set<NodeCluster>clusters = cMap.keySet();
- return new ArrayList(clusters);
+ return new ArrayList<NodeCluster>(clusters);
}
//Exchange Messages between Responsibility and Availibility Matrix for
Single Iteration of Affinity Propogation
@@ -213,7 +213,7 @@
private Map<Integer, NodeCluster> getClusterMap(){
- HashMap<Integer, NodeCluster> clusterMap = new HashMap();
+ HashMap<Integer, NodeCluster> clusterMap = new HashMap<Integer,
NodeCluster>();
for(int i = 0; i < s_matrix.rows(); i++){
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
2011-06-01 16:28:21 UTC (rev 25612)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
2011-06-01 20:41:09 UTC (rev 25613)
@@ -45,7 +45,8 @@
import clusterMaker.algorithms.edgeConverters.EdgeWeightConverter;
-import clusterMaker.algorithms.edgeConverters.DistanceConverter;
+import clusterMaker.algorithms.edgeConverters.DistanceConverter1;
+import clusterMaker.algorithms.edgeConverters.DistanceConverter2;
import clusterMaker.algorithms.edgeConverters.LogConverter;
import clusterMaker.algorithms.edgeConverters.NegLogConverter;
import clusterMaker.algorithms.edgeConverters.NoneConverter;
@@ -89,7 +90,8 @@
// Create all of our edge weight converters
converters = new ArrayList<EdgeWeightConverter>();
converters.add(new NoneConverter());
- converters.add(new DistanceConverter());
+ converters.add(new DistanceConverter1());
+ converters.add(new DistanceConverter2());
converters.add(new LogConverter());
converters.add(new NegLogConverter());
converters.add(new SCPSConverter());
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/autosome/RunAutoSOME.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/autosome/RunAutoSOME.java
2011-06-01 16:28:21 UTC (rev 25612)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/autosome/RunAutoSOME.java
2011-06-01 20:41:09 UTC (rev 25613)
@@ -177,7 +177,8 @@
List<EdgeWeightConverter>converters = new
ArrayList<EdgeWeightConverter>();
converters.add(new NoneConverter());
- converters.add(new DistanceConverter());
+ converters.add(new DistanceConverter1());
+ converters.add(new DistanceConverter2());
converters.add(new LogConverter());
converters.add(new NegLogConverter());
converters.add(new SCPSConverter());
Deleted:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter.java
2011-06-01 16:28:21 UTC (rev 25612)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter.java
2011-06-01 20:41:09 UTC (rev 25613)
@@ -1,66 +0,0 @@
-/* vim: set ts=2: */
-/**
- * Copyright (c) 2010 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions, and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions, and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * 3. Redistributions must acknowledge that this software was
- * originally developed by the UCSF Computer Graphics Laboratory
- * under support by the NIH National Center for Research Resources,
- * grant P41-RR01081.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-package clusterMaker.algorithms.edgeConverters;
-
-public class DistanceConverter implements EdgeWeightConverter {
-
- /**
- * Get the short name of this converter
- *
- * @return short-hand name for converter
- */
- public String getShortName() { return "1/value";}
- public String toString() { return "1/value";}
-
- /**
- * Get the name of this converter
- *
- * @return name for converter
- */
- public String getName() { return "Edge weights are distances
(1/value)"; }
-
- /**
- * Convert an edge weight
- *
- * @param weight the edge weight to convert
- * @param minValue the minimum value over all edge weights
- * @param maxValue the maximum value over all edge weights
- * @return the converted edge weight
- */
- public double convert(double weight, double minValue, double maxValue) {
- if (weight == 0.0)
- return Double.MAX_VALUE;
-
- return 1/weight;
- }
-}
Copied:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter1.java
(from rev 25600,
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter.java)
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter1.java
(rev 0)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter1.java
2011-06-01 20:41:09 UTC (rev 25613)
@@ -0,0 +1,66 @@
+/* vim: set ts=2: */
+/**
+ * Copyright (c) 2010 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions, and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. Redistributions must acknowledge that this software was
+ * originally developed by the UCSF Computer Graphics Laboratory
+ * under support by the NIH National Center for Research Resources,
+ * grant P41-RR01081.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+package clusterMaker.algorithms.edgeConverters;
+
+public class DistanceConverter1 implements EdgeWeightConverter {
+
+ /**
+ * Get the short name of this converter
+ *
+ * @return short-hand name for converter
+ */
+ public String getShortName() { return "1/value";}
+ public String toString() { return "1/value";}
+
+ /**
+ * Get the name of this converter
+ *
+ * @return name for converter
+ */
+ public String getName() { return "Edge weights are distances
(1/value)"; }
+
+ /**
+ * Convert an edge weight
+ *
+ * @param weight the edge weight to convert
+ * @param minValue the minimum value over all edge weights
+ * @param maxValue the maximum value over all edge weights
+ * @return the converted edge weight
+ */
+ public double convert(double weight, double minValue, double maxValue) {
+ if (weight == 0.0)
+ return Double.MAX_VALUE;
+
+ return 1.0/weight;
+ }
+}
Added:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter2.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter2.java
(rev 0)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/edgeConverters/DistanceConverter2.java
2011-06-01 20:41:09 UTC (rev 25613)
@@ -0,0 +1,63 @@
+/* vim: set ts=2: */
+/**
+ * Copyright (c) 2010 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions, and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. Redistributions must acknowledge that this software was
+ * originally developed by the UCSF Computer Graphics Laboratory
+ * under support by the NIH National Center for Research Resources,
+ * grant P41-RR01081.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+package clusterMaker.algorithms.edgeConverters;
+
+public class DistanceConverter2 implements EdgeWeightConverter {
+
+ /**
+ * Get the short name of this converter
+ *
+ * @return short-hand name for converter
+ */
+ public String getShortName() { return "1-value";}
+ public String toString() { return "1-value";}
+
+ /**
+ * Get the name of this converter
+ *
+ * @return name for converter
+ */
+ public String getName() { return "Edge weights are normalized distances
(1-value)"; }
+
+ /**
+ * Convert an edge weight
+ *
+ * @param weight the edge weight to convert
+ * @param minValue the minimum value over all edge weights
+ * @param maxValue the maximum value over all edge weights
+ * @return the converted edge weight
+ */
+ public double convert(double weight, double minValue, double maxValue) {
+ return 1.00-weight;
+ }
+}
--
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.