JAL-4206 Use All Known Alignment Files as default until a file is loaded
[jalview.git] / src / jalview / datamodel / SequenceGroup.java
index 6a0e64c..326793d 100755 (executable)
@@ -274,14 +274,6 @@ public class SequenceGroup implements AnnotatedCollectionI
               endRes + 1);
       if (seqipos != null)
       {
-        seqipos.setDescription(seq.getDescription());
-        seqipos.setDBRefs(seq.getDBRefs());
-        seqipos.setSequenceFeatures(seq.getSequenceFeatures());
-        if (seq.getDatasetSequence() != null)
-        {
-          seqipos.setDatasetSequence(seq.getDatasetSequence());
-        }
-
         if (seq.getAnnotation() != null)
         {
           AlignmentAnnotation[] alann = align.getAlignmentAnnotation();
@@ -311,6 +303,11 @@ public class SequenceGroup implements AnnotatedCollectionI
             newannot.restrict(startRes, endRes);
             newannot.setSequenceRef(seqs[ipos]);
             newannot.adjustForAlignment();
+            ContactMatrixI cm = seq.getContactMatrixFor(seq.getAnnotation()[a]);
+            if (cm!=null)
+            {
+              seqs[ipos].addContactListFor(newannot, cm);
+            }
             seqipos.addAlignmentAnnotation(newannot);
           }
         }
@@ -1499,6 +1496,12 @@ public class SequenceGroup implements AnnotatedCollectionI
   }
 
   @Override
+  public ContactMatrixI getContactMatrixFor(AlignmentAnnotation ann)
+  {
+    return cmholder.getContactMatrixFor(ann);
+  }
+
+  @Override
   public ContactListI getContactListFor(AlignmentAnnotation _aa, int column)
   {
     return cmholder.getContactListFor(_aa, column);
@@ -1519,4 +1522,12 @@ public class SequenceGroup implements AnnotatedCollectionI
     // TODO passing annotations back to context to be added
     return aa;
   }
+
+  @Override
+  public void addContactListFor(AlignmentAnnotation annotation,
+          ContactMatrixI cm)
+  {
+    cmholder.addContactListFor(annotation, cm);
+  }
+
 }