apply version 2.7 copyright
[jalview.git] / src / jalview / analysis / PCA.java
index a14be50..ff4ed38 100755 (executable)
@@ -1,20 +1,19 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
  * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  */
 package jalview.analysis;
 
@@ -47,7 +46,7 @@ public class PCA implements Runnable
    * Creates a new PCA object.
    * 
    * @param s
-   *                Set of sequences to perform PCA on
+   *          Set of sequences to perform PCA on
    */
   public PCA(String[] s)
   {
@@ -115,7 +114,7 @@ public class PCA implements Runnable
    * Returns Eigenvalue
    * 
    * @param i
-   *                Index of diagonal within matrix
+   *          Index of diagonal within matrix
    * 
    * @return Returns value of diagonal from matrix
    */
@@ -128,13 +127,13 @@ public class PCA implements Runnable
    * DOCUMENT ME!
    * 
    * @param l
-   *                DOCUMENT ME!
+   *          DOCUMENT ME!
    * @param n
-   *                DOCUMENT ME!
+   *          DOCUMENT ME!
    * @param mm
-   *                DOCUMENT ME!
+   *          DOCUMENT ME!
    * @param factor
-   *                DOCUMENT ME!
+   *          DOCUMENT ME!
    * 
    * @return DOCUMENT ME!
    */
@@ -156,7 +155,7 @@ public class PCA implements Runnable
    * DOCUMENT ME!
    * 
    * @param n
-   *                DOCUMENT ME!
+   *          DOCUMENT ME!
    * 
    * @return DOCUMENT ME!
    */
@@ -177,9 +176,9 @@ public class PCA implements Runnable
    * DOCUMENT ME!
    * 
    * @param row
-   *                DOCUMENT ME!
+   *          DOCUMENT ME!
    * @param n
-   *                DOCUMENT ME!
+   *          DOCUMENT ME!
    * 
    * @return DOCUMENT ME!
    */
@@ -208,7 +207,8 @@ public class PCA implements Runnable
     Matrix mt = m.transpose();
 
     details.append(" --- OrigT * Orig ---- \n");
-    eigenvector = mt.preMultiply(m2);
+    // eigenvector = mt.preMultiply(m); // standard seqspace comparison matrix
+    eigenvector = mt.preMultiply(m2); // jalview variation on seqsmace method
 
     PrintStream ps = new PrintStream(System.out)
     {
@@ -241,12 +241,15 @@ public class PCA implements Runnable
     eigenvector.tqli();
 
     details.append(" --- New diagonalization matrix ---\n");
+    eigenvector.print(ps);
     details.append(" --- Eigenvalues ---\n");
     eigenvector.printD(ps);
     ps.println();
-    // taps.println();
-    // taps.println("Transformed sequences = ");
-    // Matrix trans = m.preMultiply(eigenvector);
-    // trans.print(System.out);
+    /*
+     * for (int seq=0;seq<symm.rows;seq++) { ps.print("\"Seq"+seq+"\""); for
+     * (int ev=0;ev<symm.rows; ev++) {
+     * 
+     * ps.print(","+component(seq, ev)); } ps.println(); }
+     */
   }
 }