From a547c517480867ed1bbb2334ee7c51e642588a41 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 6 Mar 2017 14:39:42 +0000 Subject: [PATCH] JAL-2428 correct order of processing in joinClusters() --- src/jalview/analysis/AverageDistanceTree.java | 7 ------- src/jalview/analysis/TreeBuilder.java | 11 ++++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/jalview/analysis/AverageDistanceTree.java b/src/jalview/analysis/AverageDistanceTree.java index 7e3cfe1..5b0e20a 100644 --- a/src/jalview/analysis/AverageDistanceTree.java +++ b/src/jalview/analysis/AverageDistanceTree.java @@ -55,9 +55,6 @@ public class AverageDistanceTree extends TreeBuilder { distances.setValue(i, ii, newdist[ii]); distances.setValue(ii, i, newdist[ii]); - System.out.println(String.format( - "findClusterDistance(%d, %d) newdist to %d is %f", i, j, ii, - newdist[ii])); } } @@ -88,8 +85,6 @@ public class AverageDistanceTree extends TreeBuilder } } } - System.out.println("findMinDistance found " + min + " at " + mini + "," - + minj); return min; } @@ -127,8 +122,6 @@ public class AverageDistanceTree extends TreeBuilder tmpi.dist = ((dist / 2) - ih); tmpj.dist = ((dist / 2) - jh); - System.out.println("findNewDistances set tmpi to " + tmpi.dist - + ", tmpj to " + tmpj.dist); } } diff --git a/src/jalview/analysis/TreeBuilder.java b/src/jalview/analysis/TreeBuilder.java index 49c56c9..f28c6bc 100644 --- a/src/jalview/analysis/TreeBuilder.java +++ b/src/jalview/analysis/TreeBuilder.java @@ -396,11 +396,6 @@ public abstract class TreeBuilder { double dist = distances.getValue(i, j); - /* - * add the members of cluster(j) to cluster(i) - */ - clusters.get(i).or(clusters.get(j)); - ri = findr(i, j); rj = findr(j, i); @@ -422,10 +417,12 @@ public abstract class TreeBuilder node.setElementAt(sn, i); /* - * mark cluster j as disposed of + * move the members of cluster(j) to cluster(i) + * and mark cluster j as out of the game */ + clusters.get(i).or(clusters.get(j)); + clusters.get(j).clear(); done.set(j); - clusters.setElementAt(null, j); } protected abstract void findNewDistances(SequenceNode tmpi, SequenceNode tmpj, -- 1.7.10.2