From 1e5e507fe9402197a0e925ca71550bae0ab14c72 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 4 Nov 2005 10:54:58 +0000 Subject: [PATCH] Use visible id for sorting --- src/jalview/analysis/AlignmentSorter.java | 4 ++-- src/jalview/appletgui/AlignFrame.java | 2 +- src/jalview/gui/AlignFrame.java | 12 +++++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index 20101dc..bed083e 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -124,7 +124,7 @@ public class AlignmentSorter * * @param align The alignment object to sort */ - public static void sortByID(AlignmentI align) + public static void sortByID(AlignmentI align, boolean dbprefix) { int nSeq = align.getHeight(); @@ -133,7 +133,7 @@ public class AlignmentSorter for (int i = 0; i < nSeq; i++) { - ids[i] = align.getSequenceAt(i).getName(); + ids[i] = align.getSequenceAt(i).getDisplayId(dbprefix, false); seqs[i] = align.getSequenceAt(i); } diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 6e2d32b..7c3ab49 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -1210,7 +1210,7 @@ public class AlignFrame { addHistoryItem(new HistoryItem("ID Sort", viewport.alignment, HistoryItem.SORT)); - AlignmentSorter.sortByID(viewport.getAlignment()); + AlignmentSorter.sortByID(viewport.getAlignment(), viewport.showDBPrefix); alignPanel.repaint(); } diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 89aadac..8737c59 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -161,6 +161,12 @@ public class AlignFrame } + public AlignViewport getViewport() + { + return viewport; + } + + /** * DOCUMENT ME! * @@ -1872,7 +1878,7 @@ public class AlignFrame { addHistoryItem(new HistoryItem("ID Sort", viewport.alignment, HistoryItem.SORT)); - AlignmentSorter.sortByID(viewport.getAlignment()); + AlignmentSorter.sortByID(viewport.getAlignment(), viewport.showDBPrefix); alignPanel.repaint(); } @@ -2464,8 +2470,8 @@ public class AlignFrame if (value == JalviewFileChooser.APPROVE_OPTION) { jalview.io.VamsasDatastore vs = new jalview.io.VamsasDatastore(viewport); - vs.store(chooser.getSelectedFile().getAbsolutePath() - ); + //vs.store(chooser.getSelectedFile().getAbsolutePath() ); + vs.storeJalview( chooser.getSelectedFile().getAbsolutePath(), this); } } -- 1.7.10.2