+ try{\r
+ pca = new PCA(seqstrings.getSequenceStrings(' '));\r
+ pca.run();\r
+\r
+ // Now find the component coordinates\r
+ int ii = 0;\r
+\r
+ while ( (ii < seqs.length) && (seqs[ii] != null))\r
+ {\r
+ ii++;\r
+ }\r
+\r
+ double[][] comps = new double[ii][ii];\r
+\r
+ for (int i = 0; i < ii; i++)\r
+ {\r
+ if (pca.getEigenvalue(i) > 1e-4)\r
+ {\r
+ comps[i] = pca.component(i);\r
+ }\r
+ }\r
+\r
+ //////////////////\r
+ xCombobox.setSelectedIndex(0);\r
+ yCombobox.setSelectedIndex(1);\r
+ zCombobox.setSelectedIndex(2);\r
+\r
+ top = pca.getM().rows - 1;\r
+\r
+ Vector points = new Vector();\r
+ float[][] scores = pca.getComponents(top - 1, top - 2, top - 3, 100);\r
+\r
+ for (int i = 0; i < pca.getM().rows; i++)\r
+ {\r
+ SequencePoint sp = new SequencePoint(seqs[i], scores[i]);\r
+ points.addElement(sp);\r
+ }\r
+\r
+ rc.setPoints(points, pca.getM().rows);\r
+ rc.repaint();\r
+ }\r
+ catch(OutOfMemoryError er)\r
+ { JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+ "Out of memory calculating PCA!!"\r
+ +\r
+ "\nSee help files for increasing Java Virtual Machine memory."\r
+ , "Out of memory",\r
+ JOptionPane.WARNING_MESSAGE);\r
+ System.out.println("PCAPanel: "+er);\r
+ System.gc();\r
+\r
+ }\r
+\r
+ }\r
+\r
+ /**\r
+ * DOCUMENT ME!\r
+ */\r
+ void doDimensionChange()\r
+ {\r
+ if (top == 0)\r
+ {\r
+ return;\r
+ }\r
+\r
+ int dim1 = top - xCombobox.getSelectedIndex();\r
+ int dim2 = top - yCombobox.getSelectedIndex();\r
+ int dim3 = top - zCombobox.getSelectedIndex();\r
+\r
+ float[][] scores = pca.getComponents(dim1, dim2, dim3, 100);\r
+\r
+ for (int i = 0; i < pca.getM().rows; i++)\r
+ {\r
+ ((SequencePoint) rc.points.elementAt(i)).coord = scores[i];\r
+ }\r
+\r
+ rc.img = null;\r
+ rc.rotmat.setIdentity();\r
+ rc.initAxes();\r
+ rc.paint(rc.getGraphics());\r
+ }\r
+\r
+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param e DOCUMENT ME!\r
+ */\r
+ protected void xCombobox_actionPerformed(ActionEvent e)\r
+ {\r
+ doDimensionChange();\r
+ }\r