Author: scooter
Date: 2010-01-05 17:41:01 -0800 (Tue, 05 Jan 2010)
New Revision: 18814
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/DistanceMatrix.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/MCLCluster.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/RunMCL.java
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/ui/Histogram.java
Log:
Fix bugs that resulted from the distance matrix separation.
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/DistanceMatrix.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/DistanceMatrix.java
2010-01-04 05:04:40 UTC (rev 18813)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/DistanceMatrix.java
2010-01-06 01:41:01 UTC (rev 18814)
@@ -93,7 +93,7 @@
edgeWeight += Math.abs(minAttribute);
if(edgeWeight != 0.0 && edgeWeight !=
Double.MAX_VALUE)
- edgeWeight = -Math.log(edgeWeight);
+ edgeWeight = -Math.log10(edgeWeight);
else
edgeWeight = 500; // Assume 1e-500 as a
reasonble upper bound
}
@@ -119,6 +119,7 @@
public DoubleMatrix2D getDistanceMatrix(Double edgeCutOff, boolean
undirectedEdges) {
setEdgeCutOff(edgeCutOff);
setUndirectedEdges(undirectedEdges);
+ matrix = null;
return getDistanceMatrix();
}
@@ -129,6 +130,7 @@
matrix = DoubleFactory2D.sparse.make(nodes.size(),nodes.size());
int sourceIndex;
int targetIndex;
+
for(int edgeIndex = 0; edgeIndex < edges.size(); edgeIndex++) {
CyEdge edge = edges.get(edgeIndex);
@@ -156,10 +158,12 @@
public List<CyEdge> getEdges() {return edges;}
public void setEdgeCutOff(Double edgeCutOff) {
+ matrix = null;
this.edgeCutOff = edgeCutOff.doubleValue();
}
public void setUndirectedEdges(boolean undirectedEdges) {
+ matrix = null;
this.unDirectedEdges = undirectedEdges;
}
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
2010-01-04 05:04:40 UTC (rev 18813)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
2010-01-06 01:41:01 UTC (rev 18814)
@@ -186,7 +186,7 @@
}
public void histoValueChanged(double cutoffValue) {
- // System.out.println("Changing cutoff value to "+cutoffValue);
+ // System.out.println("New cutoff value: "+cutoffValue);
Tunable edgeCutoff = clusterProperties.get("edgeCutOff");
edgeCutoff.setValue(cutoffValue);
}
@@ -206,6 +206,7 @@
edgeCutOffTunable.setUpperBound(matrix.getMaxWeight());
edgeCutOffTunable.setLowerBound(matrix.getMinWeight());
edgeCutOffTunable.setValue(matrix.getMinWeight()+(range/1000));
+ edgeCutOff = (Double) edgeCutOffTunable.getValue();
if (histo != null) {
histo.updateData(dataArray);
@@ -236,6 +237,10 @@
}
matrix.setUndirectedEdges(undirectedEdges);
+
+ if (edgeCutOff != null)
+ matrix.setEdgeCutOff(edgeCutOff.doubleValue());
+
if (adjustLoops)
matrix.adjustLoops();
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 05:04:40 UTC (rev 18813)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/MCLCluster.java
2010-01-06 01:41:01 UTC (rev 18814)
@@ -196,6 +196,8 @@
if (createMetaNodes)
runMCL.createMetaNodes();
+ runMCL.setDebug(debug);
+
runMCL.run(monitor);
// Set up the appropriate attributes
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/RunMCL.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/RunMCL.java
2010-01-04 05:04:40 UTC (rev 18813)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/MCL/RunMCL.java
2010-01-06 01:41:01 UTC (rev 18814)
@@ -43,10 +43,10 @@
private CyLogger logger;
public final static String GROUP_ATTRIBUTE = "__MCLGroups";
protected int clusterCount = 0;
- private boolean debug = false;
private boolean createMetaNodes = false;
private DistanceMatrix distanceMatrix = null;
private DoubleMatrix2D matrix = null;
+ private boolean debug = false;
public RunMCL(String nodeClusterAttributeName, DistanceMatrix dMat,
double inflationParameter, int num_iterations,
@@ -72,6 +72,8 @@
public void halt () { canceled = true; }
public void createMetaNodes() { createMetaNodes = true; }
+
+ public void setDebug(boolean debug) { this.debug = debug; }
public void run(TaskMonitor monitor)
{
Modified:
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/ui/Histogram.java
===================================================================
---
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/ui/Histogram.java
2010-01-04 05:04:40 UTC (rev 18813)
+++
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/ui/Histogram.java
2010-01-06 01:41:01 UTC (rev 18814)
@@ -154,11 +154,11 @@
public void mouseReleased(MouseEvent e){
int histoMousePos =
(int)(((double)(e.getX()-XSTART))/xIncrement);
if(e.getX()>XSTART &&
e.getX()<(XSTART+xIncrement*histoArray.length) && boolShowLine){
- double binValue = minValue+(xInterval*histoMousePos);
- // System.out.println("histoArray["+histoMousePos+"] =
"+ histoArray[histoMousePos]+", "+form.format((binValue)));
+ double binValue = xInterval*histoMousePos;
+ // System.out.println("histoArray["+histoMousePos+"] =
"+ histoArray[histoMousePos]+", "+Double.parseDouble(form.format((binValue))));
if (listeners.size() == 0) return;
for (HistoChangeListener listener: listeners)
- listener.histoValueChanged(binValue);
+
listener.histoValueChanged(Double.parseDouble(form.format(binValue)));
}
}
@@ -194,7 +194,7 @@
g.drawLine(mX, YEND, mX, height);
g.setColor(Color.black);
g.setFont(adjFont);
-
g.drawString(toSciNotation(form.format((minValue+(xInterval*histoMousePos))).toString(),"
("+histoArray[histoMousePos]+" values)"),mX-50,YEND-5);
+
g.drawString(toSciNotation(form.format(xInterval*histoMousePos).toString(),"
("+histoArray[histoMousePos]+" values)"),mX-50,YEND-5);
}
private void createHistogram(double[] inputData){
--
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.