sort-by-score works of sequence-annotation, not alignment annotation vector
authorjprocter <Jim Procter>
Tue, 1 May 2007 10:42:59 +0000 (10:42 +0000)
committerjprocter <Jim Procter>
Tue, 1 May 2007 10:42:59 +0000 (10:42 +0000)
src/jalview/gui/AlignFrame.java

index b27a98e..58650cb 100755 (executable)
@@ -3088,12 +3088,17 @@ public class AlignFrame
       sortByAnnotScore.removeAll();
       // almost certainly a quicker way to do this - but we keep it simple
       Hashtable scoreSorts=new Hashtable();
-      AlignmentAnnotation aann[] = viewport.alignment.getAlignmentAnnotation();
-      for (int i=0;i<aann.length; i++)
+      AlignmentAnnotation aann[];
+      Enumeration sq = viewport.alignment.getSequences().elements();
+      while (sq.hasMoreElements())
       {
-        if (aann[i].hasScore() && aann[i].sequenceRef!=null)
+        aann = ((SequenceI) sq.nextElement()).getAnnotation();
+        for (int i=0;aann!=null && i<aann.length; i++)
         {
-          scoreSorts.put(aann[i].label, aann[i].label);
+          if (aann[i].hasScore() && aann[i].sequenceRef!=null)
+          {
+            scoreSorts.put(aann[i].label, aann[i].label);
+          }
         }
       }
       Enumeration labels = scoreSorts.keys();