Fix buttons on the PaSiMap plot window
authorMorellThomas <morellth@yahoo.co.jp>
Mon, 18 Sep 2023 07:33:44 +0000 (09:33 +0200)
committerMorellThomas <morellth@yahoo.co.jp>
Mon, 18 Sep 2023 07:33:44 +0000 (09:33 +0200)
src/jalview/analysis/PaSiMap.java
src/jalview/viewmodel/PaSiMapModel.java

index 13bc3d2..4a670bf 100755 (executable)
@@ -170,12 +170,18 @@ public class PaSiMap implements Runnable
     /*
      * coordinates matrix, with D vector
      */
-    sb.append(" --- Coordinates ---\n");
-    eigenMatrix.print(ps, "%8.6f ");
+    sb.append(" --- Pairwise correlation coefficients ---\n");
+    pairwiseScores.print(ps, "%8.6f ");
+    ps.println();
+
     sb.append(" --- Eigenvalues ---\n");
     eigenMatrix.printD(ps, "%15.4e");
     ps.println();
 
+    sb.append(" --- Coordinates ---\n");
+    eigenMatrix.print(ps, "%8.6f ");
+    ps.println();
+
     return sb.toString();
   }
 
@@ -204,12 +210,10 @@ public class PaSiMap implements Runnable
       pairwiseScores = new Matrix(scores);
       pairwiseScores.fillDiagonal();
 
-      ccAnalysis cc = new ccAnalysis(pairwiseScores, dim);
-      pairwiseScores = cc.run();
-
       eigenMatrix = pairwiseScores.copy();
-      eigenMatrix.setD(pairwiseScores.getD());
-      
+
+      ccAnalysis cc = new ccAnalysis(pairwiseScores, dim);
+      eigenMatrix = cc.run();
 
     } catch (Exception q)
     {
@@ -253,7 +257,7 @@ public class PaSiMap implements Runnable
   public int getHeight()
   {
     // TODO can any of seqs[] be null?
-    return pairwiseScores.height();// seqs.getSequences().length;
+    return eigenMatrix.height();// seqs.getSequences().length;
   }
 
   /**
@@ -265,7 +269,7 @@ public class PaSiMap implements Runnable
   public int getWidth()
   {
     // TODO can any of seqs[] be null?
-    return pairwiseScores.width();// seqs.getSequences().length;
+    return eigenMatrix.width();// seqs.getSequences().length;
   }
 
   /**
index a97277f..4bb6d8a 100644 (file)
@@ -202,24 +202,10 @@ public class PaSiMapModel
     for (int s = 0; s < seqs.length; s++)
     {
       csv.append("\"" + seqs[s].getName() + "\"");
-      double fl[];
-      if (!transformed)
-      {
-        // output pasimap in correct order
-        fl = pasimap.component(s);
-        for (int d = fl.length - 1; d >= 0; d--)
-        {
-          csv.append(",");
-          csv.append(fl[d]);
-        }
-      }
-      else
-      {
-        Point p = points.get(s).coord;
-        csv.append(",").append(p.x);
-        csv.append(",").append(p.y);
-        csv.append(",").append(p.z);
-      }
+      Point p = points.get(s).coord;
+      csv.append(",").append(p.x);
+      csv.append(",").append(p.y);
+      csv.append(",").append(p.z);
       csv.append("\n");
     }
     return csv.toString();