Use visible id for sorting
authoramwaterhouse <Andrew Waterhouse>
Fri, 4 Nov 2005 10:54:58 +0000 (10:54 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 4 Nov 2005 10:54:58 +0000 (10:54 +0000)
src/jalview/analysis/AlignmentSorter.java
src/jalview/appletgui/AlignFrame.java
src/jalview/gui/AlignFrame.java

index 20101dc..bed083e 100755 (executable)
@@ -124,7 +124,7 @@ public class AlignmentSorter
      *\r
      * @param align The alignment object to sort\r
      */\r
-    public static void sortByID(AlignmentI align)\r
+    public static void sortByID(AlignmentI align, boolean dbprefix)\r
     {\r
         int nSeq = align.getHeight();\r
 \r
@@ -133,7 +133,7 @@ public class AlignmentSorter
 \r
         for (int i = 0; i < nSeq; i++)\r
         {\r
-            ids[i] = align.getSequenceAt(i).getName();\r
+            ids[i] = align.getSequenceAt(i).getDisplayId(dbprefix, false);\r
             seqs[i] = align.getSequenceAt(i);\r
         }\r
 \r
index 6e2d32b..7c3ab49 100755 (executable)
@@ -1210,7 +1210,7 @@ public class AlignFrame
   {\r
     addHistoryItem(new HistoryItem("ID Sort", viewport.alignment,\r
                                    HistoryItem.SORT));\r
-    AlignmentSorter.sortByID(viewport.getAlignment());\r
+    AlignmentSorter.sortByID(viewport.getAlignment(), viewport.showDBPrefix);\r
     alignPanel.repaint();\r
   }\r
 \r
index 89aadac..8737c59 100755 (executable)
@@ -161,6 +161,12 @@ public class AlignFrame
 \r
   }\r
 \r
+  public AlignViewport getViewport()\r
+  {\r
+    return viewport;\r
+  }\r
+\r
+\r
   /**\r
    * DOCUMENT ME!\r
    *\r
@@ -1872,7 +1878,7 @@ public class AlignFrame
   {\r
     addHistoryItem(new HistoryItem("ID Sort", viewport.alignment,\r
                                    HistoryItem.SORT));\r
-    AlignmentSorter.sortByID(viewport.getAlignment());\r
+    AlignmentSorter.sortByID(viewport.getAlignment(), viewport.showDBPrefix);\r
     alignPanel.repaint();\r
   }\r
 \r
@@ -2464,8 +2470,8 @@ public class AlignFrame
     if (value == JalviewFileChooser.APPROVE_OPTION)\r
     {\r
       jalview.io.VamsasDatastore vs = new jalview.io.VamsasDatastore(viewport);\r
-      vs.store(chooser.getSelectedFile().getAbsolutePath()\r
-          );\r
+      //vs.store(chooser.getSelectedFile().getAbsolutePath()   );\r
+      vs.storeJalview( chooser.getSelectedFile().getAbsolutePath(), this);\r
     }\r
   }\r
 \r