Implemented least-squares optimisation in ccAnalysis
[jalview.git] / src / jalview / analysis / Connectivity.java
index 25f9626..0f849e3 100644 (file)
@@ -57,23 +57,19 @@ public class Connectivity
         connectivity.putIfAbsent(sequences[j], 0);
        int iOld = connectivity.get(sequences[i]);
        int jOld = connectivity.get(sequences[j]); 
-        // count the connection if its score is bigger than 0.1
-       if (scores[i][j] >= 0.1)        // what is cutoff instead of just 0.1?
+        // count the connection if its score is not NaN
+       if (!Float.isNaN(scores[i][j]))
        {
          connectivity.put(sequences[i], ++iOld);
          connectivity.put(sequences[j], ++jOld);
        }
       }
     }
-    //Debug
-    for (int i = 0; i < sequences.length; i++)
-    {
-      System.out.println(connectivity.get(sequences[i]));
-    }
 
     // if a sequence has too few connections, abort
     connectivity.forEach((sequence, connection) ->
     {
+      System.out.println(String.format("%s: %d", sequence.getName(), connection));
       if (connection < dim)
       {
        // a popup saying that it failed would be nice