JAL-1632 remove unused check for sequences aligned
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 12 Apr 2017 13:43:39 +0000 (14:43 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 12 Apr 2017 13:43:39 +0000 (14:43 +0100)
src/jalview/gui/PCAPanel.java

index f75c756..482dff3 100644 (file)
@@ -30,7 +30,6 @@ import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentView;
 import jalview.datamodel.ColumnSelection;
-import jalview.datamodel.SeqCigar;
 import jalview.datamodel.SequenceI;
 import jalview.jbgui.GPCAPanel;
 import jalview.util.MessageManager;
@@ -129,18 +128,6 @@ public class PCAPanel extends GPCAPanel implements Runnable,
       seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
     }
 
-    // TODO can we allow PCA on unaligned data given choice of
-    // similarity measure parameters?
-    if (!checkAligned(seqstrings))
-    {
-      JvOptionPane.showMessageDialog(Desktop.desktop,
-              MessageManager.getString("label.pca_sequences_not_aligned"),
-              MessageManager.getString("label.sequences_not_aligned"),
-              JvOptionPane.WARNING_MESSAGE);
-
-      return;
-    }
-
     pcaModel = new PCAModel(seqstrings, seqs, nucleotide, scoreModel,
             params);
     PaintRefresher.Register(this, av.getSequenceSetId());
@@ -152,28 +139,6 @@ public class PCAPanel extends GPCAPanel implements Runnable,
   }
 
   /**
-   * Answers true if all sequences have the same aligned length, else false
-   * 
-   * @param seqstrings
-   * @return
-   */
-  protected boolean checkAligned(AlignmentView seqstrings)
-  {
-    SeqCigar sq[] = seqstrings.getSequences();
-    int length = sq[0].getWidth();
-    boolean sameLength = true;
-    for (int i = 0; i < sq.length; i++)
-    {
-      if (sq[i].getWidth() != length)
-      {
-        sameLength = false;
-        break;
-      }
-    }
-    return sameLength;
-  }
-
-  /**
    * Ensure references to potentially very large objects (the PCA matrices) are
    * nulled when the frame is closed
    */