Implemented least-squares optimisation in ccAnalysis
[jalview.git] / src / jalview / viewmodel / PaSiMapModel.java
index c9545a8..1f5e2dc 100644 (file)
@@ -101,14 +101,19 @@ public class PaSiMapModel
       ii++;
     }
 
+    int width = pasimap.getWidth();
     int height = pasimap.getHeight();
     // top = pasimap.getM().height() - 1;
-    top = height - 1;
+    //&!
+    //top = height - 1;
+    top = height;
 
     points = new Vector<>();
-    Point[] scores = pasimap.getComponents(top - 1, top - 2, top - 3, 100);
+    //&!
+    //Point[] scores = pasimap.getComponents(top - 1, top - 2, top - 3, 100);
+    Point[] scores = pasimap.getComponents(width - 1, width - 2, width - 3, 1);
 
-    for (int i = 0; i < height; i++)
+    for (int i = 0; i < top; i++)
     {
       SequencePoint sp = new SequencePoint(seqs[i], scores[i]);
       points.add(sp);
@@ -158,9 +163,11 @@ public class PaSiMapModel
   public void updateRcView(int dim1, int dim2, int dim3)
   {
     // note: actual indices for components are dim1-1, etc (patch for JAL-1123)
-    Point[] scores = pasimap.getComponents(dim1 - 1, dim2 - 1, dim3 - 1, 100);
+    //&!
+    //Point[] scores = pasimap.getComponents(dim1 - 1, dim2 - 1, dim3 - 1, 100);
+    Point[] scores = pasimap.getComponents(dim1 - 1, dim2 - 1, dim3 - 1, 1);
 
-    for (int i = 0; i < pasimap.getHeight(); i++)
+    for (int i = 0; i < pasimap.getWidth(); i++)
     {
       points.get(i).coord = scores[i];
     }