Dont make groups of hidden sequences
authoramwaterhouse <Andrew Waterhouse>
Thu, 23 Nov 2006 18:27:11 +0000 (18:27 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 23 Nov 2006 18:27:11 +0000 (18:27 +0000)
src/jalview/datamodel/Alignment.java

index 71e76af..6051aa6 100755 (executable)
@@ -259,7 +259,26 @@ public class Alignment implements AlignmentI
     {
         if (!groups.contains(sg))
         {
-            groups.addElement(sg);
+          if(hiddenSequences.getSize()>0)
+          {
+            //We're not going to make groups of
+            //Hidden sequences
+            int i, iSize = sg.getSize(false);
+            for (i = 0; i < iSize; i++)
+            {
+              if (!sequences.contains(sg.getSequenceAt(i)))
+              {
+                sg.deleteSequence(sg.getSequenceAt(i), false);
+                iSize--;
+                i--;
+              }
+            }
+
+            if (sg.getSize(true) < 1)
+              return;
+          }
+
+          groups.addElement(sg);
         }
     }