(JAL-1013) specify sequence type to ensure PCA calculation employs correct substituti...
[jalview.git] / src / jalview / appletgui / PCAPanel.java
index 23286db..3e87f17 100755 (executable)
@@ -40,6 +40,12 @@ public class PCAPanel extends EmbmenuFrame implements Runnable,
 
   SequenceI[] seqs;
 
+  
+  /**
+   * use the identity matrix for calculating similarity between sequences. 
+   */
+  private boolean useidentity=false;
+
 
   public PCAPanel(AlignViewport av)
   {
@@ -60,6 +66,7 @@ public class PCAPanel extends EmbmenuFrame implements Runnable,
 
     this.av = av;
     seqstrings = av.getAlignmentView(av.getSelectionGroup() != null);
+    useidentity=av.getAlignment().isNucleotide();
     if (av.getSelectionGroup() == null)
     {
       seqs = av.alignment.getSequencesArray();
@@ -97,7 +104,7 @@ public class PCAPanel extends EmbmenuFrame implements Runnable,
    */
   public void run()
   {
-    pca = new PCA(seqstrings.getSequenceStrings(' '));
+    pca = new PCA(seqstrings.getSequenceStrings(' '), useidentity);
     pca.run();
 
     // Now find the component coordinates