JAL-1031 allow empty selections to pass through to tree builder, which will ignore...
[jalview.git] / src / jalview / appletgui / AlignFrame.java
index fce736f..bcb518f 100644 (file)
@@ -1,18 +1,18 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
- * \r
+ *\r
  * This file is part of Jalview.\r
- * \r
+ *\r
  * Jalview is free software: you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License \r
+ * modify it under the terms of the GNU General Public License\r
  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
- * \r
- * Jalview is distributed in the hope that it will be useful, but \r
- * WITHOUT ANY WARRANTY; without even the implied warranty \r
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ *\r
+ * Jalview is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty\r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
  * PURPOSE.  See the GNU General Public License for more details.\r
- * \r
+ *\r
  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 package jalview.appletgui;\r
@@ -35,6 +35,7 @@ import jalview.datamodel.AlignmentOrder;
 import jalview.datamodel.ColumnSelection;\r
 import jalview.datamodel.PDBEntry;\r
 import jalview.datamodel.Sequence;\r
+import jalview.datamodel.SequenceCollectionI;\r
 import jalview.datamodel.SequenceGroup;\r
 import jalview.datamodel.SequenceI;\r
 import jalview.io.AnnotationFile;\r
@@ -102,7 +103,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   int DEFAULT_HEIGHT = 500;\r
 \r
   String jalviewServletURL;\r
-  \r
+\r
 \r
   public AlignFrame(AlignmentI al, jalview.bin.JalviewLite applet, String title, boolean embedded)\r
   {\r
@@ -132,6 +133,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     showGroupConservation.setState(viewport.isShowGroupConservation());\r
     showConsensusHistogram.setState(viewport.isShowConsensusHistogram());\r
     showSequenceLogo.setState(viewport.isShowSequenceLogo());\r
+    normSequenceLogo.setState(viewport.isNormaliseSequenceLogo());\r
 \r
     seqLimits.setState(viewport.showJVSuffix);\r
 \r
@@ -232,7 +234,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /**\r
    * Load a features file onto the alignment\r
-   * \r
+   *\r
    * @param file file URL, content, or other resolvable path\r
    * @param type is protocol for accessing data referred to by file\r
    */\r
@@ -241,19 +243,19 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   {\r
     return parseFeaturesFile(file, type, true);\r
   }\r
-  \r
+\r
   /**\r
    * Load a features file onto the alignment\r
-   * \r
+   *\r
    * @param file file URL, content, or other resolvable path\r
    * @param type is protocol for accessing data referred to by file\r
    * @param autoenabledisplay when true, display features flag will be automatically enabled if features are loaded\r
    * @return true if data parsed as a features file\r
    */\r
   public boolean parseFeaturesFile(String file, String type, boolean autoenabledisplay)\r
-  {    \r
+  {\r
     // TODO: test if importing a features file onto an alignment which already has features with links overwrites the original links.\r
-    \r
+\r
     Hashtable featureLinks = new Hashtable();\r
     boolean featuresFile = false;\r
     try\r
@@ -288,6 +290,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     return featuresFile;\r
   }\r
 \r
+  @Override\r
   public void keyPressed(KeyEvent evt)\r
   {\r
     if (viewport.cursorMode\r
@@ -301,8 +304,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     {\r
     case 27: // escape key\r
       deselectAllSequenceMenuItem_actionPerformed();\r
-      \r
-      alignPanel.alabels.cancelDrag(); \r
+\r
+      alignPanel.alabels.cancelDrag();\r
       break;\r
     case KeyEvent.VK_X:\r
       if (evt.isControlDown() || evt.isMetaDown())\r
@@ -549,7 +552,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /**\r
    * called by key handler and the hide all/show all menu items\r
-   * \r
+   *\r
    * @param toggleSeqs\r
    * @param toggleCols\r
    */\r
@@ -614,14 +617,17 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     }\r
   }\r
 \r
+  @Override\r
   public void keyReleased(KeyEvent evt)\r
   {\r
   }\r
 \r
+  @Override\r
   public void keyTyped(KeyEvent evt)\r
   {\r
   }\r
 \r
+  @Override\r
   public void itemStateChanged(ItemEvent evt)\r
   {\r
     if (evt.getSource() == displayNonconservedMenuItem)\r
@@ -714,6 +720,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     {\r
       showSequenceLogo_actionPerformed();\r
     }\r
+    else if (evt.getSource() == normSequenceLogo)\r
+    {\r
+      normSequenceLogo_actionPerformed();\r
+    }\r
     else if (evt.getSource() == showConsensusHistogram)\r
     {\r
       showConsensusHistogram_actionPerformed();\r
@@ -738,6 +748,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     this.alignPanel.annotationPanel.repaint();\r
   }\r
 \r
+  @Override\r
   public void actionPerformed(ActionEvent evt)\r
   {\r
     Object source = evt.getSource();\r
@@ -923,6 +934,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     {\r
       showSequenceLogo_actionPerformed();\r
     }\r
+    else if (source == normSequenceLogo)\r
+    {\r
+      normSequenceLogo_actionPerformed();\r
+    }\r
     else if (source == showConsensusHistogram)\r
     {\r
       showConsensusHistogram_actionPerformed();\r
@@ -1111,7 +1126,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     jalview.bin.JalviewLite.addFrame(frame, "Paste Annotations ", 400, 300);\r
 \r
   }\r
-  \r
+\r
   public String outputAnnotations(boolean displayTextbox)\r
   {\r
     String annotation = new AnnotationFile().printAnnotations(\r
@@ -1173,7 +1188,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
         features = "# No features visible - paste some and import them here.";\r
         frimport=true;\r
       }\r
-      \r
+\r
       CutAndPasteTransfer cap = new CutAndPasteTransfer(frimport, this);\r
       if (frimport)\r
       {\r
@@ -1352,7 +1367,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   /**\r
    * TODO: JAL-1104\r
    * DOCUMENT ME!\r
-   * \r
+   *\r
    * @param e\r
    *          DOCUMENT ME!\r
    */\r
@@ -1381,7 +1396,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   /**\r
    * TODO: JAL-1104\r
    * DOCUMENT ME!\r
-   * \r
+   *\r
    * @param e\r
    *          DOCUMENT ME!\r
    */\r
@@ -1456,48 +1471,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     {\r
       return;\r
     }\r
-\r
-    if (up)\r
-    {\r
-      for (int i = 1; i < viewport.getAlignment().getHeight(); i++)\r
-      {\r
-        SequenceI seq = viewport.getAlignment().getSequenceAt(i);\r
-        if (!sg.getSequences(null).contains(seq))\r
-        {\r
-          continue;\r
-        }\r
-\r
-        SequenceI temp = viewport.getAlignment().getSequenceAt(i - 1);\r
-        if (sg.getSequences(null).contains(temp))\r
-        {\r
-          continue;\r
-        }\r
-\r
-        viewport.getAlignment().getSequences().setElementAt(temp, i);\r
-        viewport.getAlignment().getSequences().setElementAt(seq, i - 1);\r
-      }\r
-    }\r
-    else\r
-    {\r
-      for (int i = viewport.getAlignment().getHeight() - 2; i > -1; i--)\r
-      {\r
-        SequenceI seq = viewport.getAlignment().getSequenceAt(i);\r
-        if (!sg.getSequences(viewport.getHiddenRepSequences()).contains(seq))\r
-        {\r
-          continue;\r
-        }\r
-\r
-        SequenceI temp = viewport.getAlignment().getSequenceAt(i + 1);\r
-        if (sg.getSequences(viewport.getHiddenRepSequences()).contains(temp))\r
-        {\r
-          continue;\r
-        }\r
-\r
-        viewport.getAlignment().getSequences().setElementAt(temp, i);\r
-        viewport.getAlignment().getSequences().setElementAt(seq, i + 1);\r
-      }\r
-    }\r
-\r
+    viewport.getAlignment().moveSelectedSequencesByOne(sg, up ? null : viewport.getHiddenRepSequences(), up);\r
     alignPanel.paintAlignment(true);\r
   }\r
 \r
@@ -1534,7 +1508,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
     SequenceI[] seqs2 = invertGroup.toArray(new SequenceI[invertGroup.size()]);\r
     for (int i = 0; i < invertGroup.size(); i++)\r
-      seqs2[i] = (SequenceI) invertGroup.elementAt(i);\r
+      seqs2[i] = invertGroup.elementAt(i);\r
 \r
     SlideSequencesCommand ssc;\r
     if (right)\r
@@ -1826,7 +1800,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /**\r
    * group consensus toggled\r
-   * \r
+   *\r
    */\r
   protected void showGroupConsensus_actionPerformed()\r
   {\r
@@ -1846,7 +1820,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /*\r
    * (non-Javadoc)\r
-   * \r
+   *\r
    * @see\r
    * jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt\r
    * .event.ActionEvent)\r
@@ -1858,7 +1832,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   }\r
   /*\r
    * (non-Javadoc)\r
-   * \r
+   *\r
    * @see\r
    * jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt\r
    * .event.ActionEvent)\r
@@ -1868,6 +1842,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     viewport.setShowSequenceLogo(showSequenceLogo.getState());\r
     alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());\r
   }\r
+  protected void normSequenceLogo_actionPerformed()\r
+  {\r
+    showSequenceLogo.setState(true);\r
+    viewport.setShowSequenceLogo(true);\r
+    viewport.setNormaliseSequenceLogo(normSequenceLogo.getState());\r
+    alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());\r
+  }\r
 \r
   protected void applyAutoAnnotationSettings_actionPerformed()\r
   {\r
@@ -2109,7 +2090,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /**\r
    * create a new view derived from the current view\r
-   * \r
+   *\r
    * @param viewtitle\r
    * @return frame for the new view\r
    */\r
@@ -2182,7 +2163,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   }\r
 \r
   /**\r
-   * \r
+   *\r
    * @return list of feature groups on the view\r
    */\r
   public String[] getFeatureGroups()\r
@@ -2198,7 +2179,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /**\r
    * get sequence feature groups that are hidden or shown\r
-   * \r
+   *\r
    * @param visible\r
    *          true is visible\r
    * @return list\r
@@ -2216,7 +2197,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /**\r
    * Change the display state for the given feature groups\r
-   * \r
+   *\r
    * @param groups\r
    *          list of group strings\r
    * @param state\r
@@ -2287,6 +2268,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     final AlignmentPanel ap=alignPanel;\r
     frame.addWindowListener(new WindowAdapter()\r
     {\r
+      @Override\r
       public void windowClosing(WindowEvent e)\r
       {\r
         if (ap!=null) {\r
@@ -2343,7 +2325,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
       cs.setConsensus(viewport.getSequenceConsensusHash());\r
 \r
-    }             \r
+    }\r
     viewport.setGlobalColourScheme(cs);\r
 \r
 \r
@@ -2540,7 +2522,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
     if ((viewport.getSelectionGroup() != null && viewport\r
             .getSelectionGroup().getSize() > 1)\r
-            || (viewport.getSelectionGroup() == null && viewport.getAlignment()\r
+            || (viewport.getAlignment()\r
                     .getHeight() > 1))\r
     {\r
       final TreePanel tp = new TreePanel(alignPanel, type, pwType);\r
@@ -2570,7 +2552,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /**\r
    * sort the alignment using the given treePanel\r
-   * \r
+   *\r
    * @param treePanel\r
    *          tree used to sort view\r
    * @param title\r
@@ -2591,7 +2573,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   /**\r
    * Do any automatic reordering of the alignment and add the necessary bits to\r
    * the menu structure for the new tree\r
-   * \r
+   *\r
    * @param treePanel\r
    * @param title\r
    */\r
@@ -2602,14 +2584,16 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     sortByTreeMenu.add(item);\r
     item.addActionListener(new java.awt.event.ActionListener()\r
     {\r
+      @Override\r
       public void actionPerformed(ActionEvent evt)\r
       {\r
         sortByTree(treePanel, title); // treePanel.getTitle());\r
       }\r
     });\r
-    \r
+\r
     treePanel.addWindowListener(new WindowAdapter()\r
     {\r
+      @Override\r
       public void windowOpened(WindowEvent e)\r
       {\r
         if (viewport.sortByTree)\r
@@ -2619,6 +2603,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
         super.windowOpened(e);\r
       }\r
 \r
+      @Override\r
       public void windowClosing(WindowEvent e)\r
       {\r
         sortByTreeMenu.remove(item);\r
@@ -2662,6 +2647,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
         this.builddate = builddate;\r
       }\r
 \r
+      @Override\r
       public void paint(Graphics g)\r
       {\r
         g.setColor(Color.white);\r
@@ -2731,7 +2717,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   MenuItem loadTree = new MenuItem("Load Associated Tree ...");\r
 \r
   MenuItem loadAnnotations = new MenuItem("Load Features/Annotations ...");\r
-  \r
+\r
   MenuItem outputFeatures = new MenuItem("Export Features ...");\r
 \r
   MenuItem outputAnnotations = new MenuItem("Export Annotations ...");\r
@@ -2806,13 +2792,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   MenuItem purinePyrimidineColour = new MenuItem();\r
   MenuItem RNAHelixColour = new MenuItem();\r
-  \r
+\r
   MenuItem userDefinedColour = new MenuItem();\r
 \r
   MenuItem PIDColour = new MenuItem();\r
 \r
   MenuItem BLOSUM62Colour = new MenuItem();\r
-  \r
+\r
   MenuItem tcoffeeColour = new MenuItem();\r
 \r
   MenuItem njTreeBlosumMenuItem = new MenuItem();\r
@@ -2900,7 +2886,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   CheckboxMenuItem seqLimits = new CheckboxMenuItem();\r
 \r
   CheckboxMenuItem centreColumnLabelFlag = new CheckboxMenuItem();\r
-  \r
+\r
   CheckboxMenuItem followMouseOverFlag = new CheckboxMenuItem();\r
   Menu autoAnnMenu=new Menu();\r
   CheckboxMenuItem showSequenceLogo= new CheckboxMenuItem();\r
@@ -2908,6 +2894,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   CheckboxMenuItem showConsensusHistogram = new CheckboxMenuItem();\r
   CheckboxMenuItem showGroupConsensus = new CheckboxMenuItem();\r
   CheckboxMenuItem showGroupConservation = new CheckboxMenuItem();\r
+  CheckboxMenuItem normSequenceLogo = new CheckboxMenuItem();\r
 \r
   private void jbInit() throws Exception\r
   {\r
@@ -2925,6 +2912,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
       item.addActionListener(new java.awt.event.ActionListener()\r
       {\r
+        @Override\r
         public void actionPerformed(ActionEvent e)\r
         {\r
           outputText_actionPerformed(e);\r
@@ -3122,10 +3110,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     showGroupConservation.setLabel("Group Conservation");\r
     showConsensusHistogram.setLabel("Show Consensus Histogram");\r
     showSequenceLogo.setLabel("Show Consensus Logo");\r
+    normSequenceLogo.setLabel("Normalise Consensus Logo");\r
     applyAutoAnnotationSettings.setLabel("Apply to all groups");\r
     applyAutoAnnotationSettings.setState(true);\r
     autoAnnMenu.setLabel("Autocalculated Annotation");\r
-    \r
+\r
     invertColSel.addActionListener(this);\r
     showColumns.addActionListener(this);\r
     showSeqs.addActionListener(this);\r
@@ -3138,6 +3127,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     showGroupConservation.addItemListener(this);\r
     showConsensusHistogram.addItemListener(this);\r
     showSequenceLogo.addItemListener(this);\r
+    normSequenceLogo.addItemListener(this);\r
+    \r
     applyAutoAnnotationSettings.addItemListener(this);\r
     formatMenu.setLabel("Format");\r
     selectMenu.setLabel("Select");\r
@@ -3155,7 +3146,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     fileMenu.add(inputText);\r
     fileMenu.add(loadTree);\r
     fileMenu.add(loadAnnotations);\r
-    \r
+\r
     fileMenu.addSeparator();\r
     fileMenu.add(outputTextboxMenu);\r
     fileMenu.add(outputFeatures);\r
@@ -3191,6 +3182,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     autoAnnMenu.add(applyAutoAnnotationSettings);\r
     autoAnnMenu.add(showConsensusHistogram);\r
     autoAnnMenu.add(showSequenceLogo);\r
+    autoAnnMenu.add(normSequenceLogo);\r
     autoAnnMenu.addSeparator();\r
     autoAnnMenu.add(showGroupConservation);\r
     autoAnnMenu.add(showGroupConsensus);\r
@@ -3313,7 +3305,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
    * Attach the alignFrame panels after embedding menus, if necessary. This used\r
    * to be called setEmbedded, but is now creates the dropdown menus in a\r
    * platform independent manner to avoid OSX/Mac menu appendage daftness.\r
-   * \r
+   *\r
    * @param reallyEmbedded\r
    *          true to attach the view to the applet area on the page rather than\r
    *          in a new window\r
@@ -3341,14 +3333,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
       final AlignFrame me = this;\r
       viewport.applet.addFocusListener(new FocusListener()\r
       {\r
-        \r
+\r
         @Override\r
         public void focusLost(FocusEvent e)\r
         {\r
           if (me.viewport.applet.currentAlignFrame==me) {\r
                   me.viewport.applet.currentAlignFrame = null;\r
         }}\r
-        \r
+\r
         @Override\r
         public void focusGained(FocusEvent e)\r
         {\r
@@ -3383,7 +3375,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
    * structures in the original jmol window. Note This method doesn't work\r
    * without an additional javascript library to exchange messages between the\r
    * distinct applets. See http://issues.jalview.org/browse/JAL-621\r
-   * \r
+   *\r
    * @param viewer\r
    *          JmolViewer instance\r
    * @param sequenceIds\r
@@ -3448,7 +3440,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   }\r
   /**\r
    * bind a pdb file to a sequence in the current view\r
-   * \r
+   *\r
    * @param sequenceId\r
    *          - sequenceId within the dataset.\r
    * @param pdbEntryString\r
@@ -3620,7 +3612,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   /**\r
    * modify the current selection, providing the user has not made a selection already.\r
-   * @param sel - sequences from this alignment \r
+   * @param sel - sequences from this alignment\r
    * @param csel - columns to be selected on the alignment\r
    */\r
   public void select(SequenceGroup sel, ColumnSelection csel)\r
@@ -3630,15 +3622,15 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
 \r
   public void scrollTo(int row, int column)\r
   {\r
-    alignPanel.seqPanel.scrollTo(row, column);    \r
+    alignPanel.seqPanel.scrollTo(row, column);\r
   }\r
   public void scrollToRow(int row)\r
   {\r
-    alignPanel.seqPanel.scrollToRow(row);    \r
+    alignPanel.seqPanel.scrollToRow(row);\r
   }\r
   public void scrollToColumn(int column)\r
   {\r
-    alignPanel.seqPanel.scrollToColumn(column);    \r
+    alignPanel.seqPanel.scrollToColumn(column);\r
   }\r
   /**\r
    * @return the alignments unique ID.\r
@@ -3646,13 +3638,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   public String getSequenceSetId() {\r
     return viewport.getSequenceSetId();\r
   }\r
-  \r
-  \r
+\r
+\r
   /**\r
-   * Load the (T-Coffee) score file from the specified url \r
-   * \r
+   * Load the (T-Coffee) score file from the specified url\r
+   *\r
    * @param source File/URL/T-COFFEE score file contents\r
-   * @throws IOException \r
+   * @throws IOException\r
    * @return true if alignment was annotated with data from source\r
    */\r
   public boolean loadScoreFile( String source ) throws IOException {\r
@@ -3664,17 +3656,17 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
            System.err.println("Origin was:\n"+source);\r
            return false;\r
          }\r
-         \r
+\r
          /*\r
           * check that the score matrix matches the alignment dimensions\r
           */\r
-         AlignmentI aln; \r
+         AlignmentI aln;\r
          if( (aln=viewport.getAlignment()) != null && (aln.getHeight() != file.getHeight() || aln.getWidth() != file.getWidth()) ) {\r
            // TODO: raise a dialog box here rather than bomb out.\r
            System.err.println("The scores matrix does not match the alignment dimensions");\r
-                 \r
+\r
          }\r
-         \r
+\r
           // TODO add parameter to indicate if matching should be done\r
          if (file.annotateAlignment(alignPanel.getAlignment(), false))\r
          {\r
@@ -3691,6 +3683,6 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
           }\r
          return false;\r
   }\r
-  \r
-  \r
+\r
+\r
 }\r