X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FPCA.java;h=47f2d0d8c1e6649cbcd4945e938c650f9765e53b;hb=7243db3d99cc1760c2d4802f3005b4f86d1b4bd6;hp=f9a034334a2b78e0be9fd50b7c89ebc20de95a5c;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git
diff --git a/src/jalview/analysis/PCA.java b/src/jalview/analysis/PCA.java
index f9a0343..47f2d0d 100755
--- a/src/jalview/analysis/PCA.java
+++ b/src/jalview/analysis/PCA.java
@@ -1,20 +1,19 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 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, J Engelhardt, LM Lui, 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 .
*/
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