JAL-1125 option to switch between Jalview and SeqSpace PCA calculation modes
[jalview.git] / src / jalview / analysis / PCA.java
index b001549..4441eeb 100755 (executable)
@@ -232,11 +232,18 @@ public class PCA implements Runnable
    */
   public void run()
   {
+    details.append("PCA Calculation Mode is "+(jvCalcMode ? "Jalview variant" : "Original SeqSpace")+"\n");
     Matrix mt = m.transpose();
 
     details.append(" --- OrigT * Orig ---- \n");
-    // eigenvector = mt.preMultiply(m); // standard seqspace comparison matrix
-    eigenvector = mt.preMultiply(m2); // jalview variation on seqsmace method
+    if (!jvCalcMode)
+    {
+      eigenvector = mt.preMultiply(m); // standard seqspace comparison matrix
+    }
+    else
+    {
+      eigenvector = mt.preMultiply(m2); // jalview variation on seqsmace method
+    }
 
     PrintStream ps = new PrintStream(System.out)
     {
@@ -280,4 +287,11 @@ public class PCA implements Runnable
      * ps.print(","+component(seq, ev)); } ps.println(); }
      */
   }
+
+  boolean jvCalcMode = true;
+
+  public void setJvCalcMode(boolean calcMode)
+  {
+    this.jvCalcMode = calcMode;
+  }
 }