remove all representative seqs on delete groups
[jalview.git] / src / jalview / datamodel / Alignment.java
index 507102e..86c140f 100755 (executable)
@@ -394,7 +394,8 @@ public class Alignment implements AlignmentI
 
         while (i < sequences.size())
         {
-            SequenceI s = getSequenceAt(i);
+            Sequence s = (Sequence)getSequenceAt(i);
+            s.hiddenSequences = null;
             s.setColor(java.awt.Color.white);
             i++;
         }
@@ -405,6 +406,9 @@ public class Alignment implements AlignmentI
     {
         if (groups.contains(g))
         {
+          //remove any hidden representatives
+        //  for(int i=0; i<g.getsiz
+         //   g.getSequences()
             groups.removeElement(g);
         }
     }
@@ -427,6 +431,28 @@ public class Alignment implements AlignmentI
         return null;
     }
 
+    public SequenceI [] findSequenceMatch(String name)
+    {
+      Vector matches = new Vector();
+      int i = 0;
+
+      while (i < sequences.size())
+      {
+          if (getSequenceAt(i).getName().equals(name))
+          {
+              matches.addElement(getSequenceAt(i));
+          }
+          i++;
+      }
+
+      SequenceI [] result = new SequenceI[matches.size()];
+      for(i=0; i<result.length; i++)
+        result[i] = (SequenceI)matches.elementAt(i);
+
+      return result;
+
+    }
+
 
     /**    */
     public int findIndex(SequenceI s)
@@ -711,7 +737,8 @@ public class Alignment implements AlignmentI
                                    ),
                                    getSequenceAt(i).getStart(),
                                    getSequenceAt(i).getEnd());
-
+            seqs[i].sequenceFeatures = getSequenceAt(i).getSequenceFeatures();
+            getSequenceAt(i).setSequenceFeatures(null);
             getSequenceAt(i).setDatasetSequence(seqs[i]);
           }
         }