JAL-1950 JAL-2937 allow copy of sequences from group without annotations
authorJim Procter <jprocter@issues.jalview.org>
Fri, 1 Jun 2018 13:47:35 +0000 (14:47 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 1 Jun 2018 13:57:00 +0000 (14:57 +0100)
src/jalview/datamodel/SequenceGroup.java
src/jalview/viewmodel/AlignmentViewport.java

index b558f40..cd2b137 100755 (executable)
@@ -262,7 +262,8 @@ public class SequenceGroup implements AnnotatedCollectionI
     return showSequenceLogo;
   }
 
-  public SequenceI[] getSelectionAsNewSequences(AlignmentI align)
+  public SequenceI[] getSelectionAsNewSequences(AlignmentI align,
+          boolean copyAnnotation)
   {
     int iSize = sequences.size();
     SequenceI[] seqs = new SequenceI[iSize];
@@ -276,14 +277,8 @@ public class SequenceGroup implements AnnotatedCollectionI
       if (seqs[ipos] != null)
       {
         seqs[ipos].setDescription(seq.getDescription());
-        seqs[ipos].setDBRefs(seq.getDBRefs());
-        seqs[ipos].setSequenceFeatures(seq.getSequenceFeatures());
-        if (seq.getDatasetSequence() != null)
-        {
-          seqs[ipos].setDatasetSequence(seq.getDatasetSequence());
-        }
 
-        if (seq.getAnnotation() != null)
+        if (seq.getAnnotation() != null && copyAnnotation)
         {
           AlignmentAnnotation[] alann = align.getAlignmentAnnotation();
           // Only copy annotation that is either a score or referenced by the
index 18c2aed..abca110 100644 (file)
@@ -1759,7 +1759,8 @@ public abstract class AlignmentViewport
     }
     else
     {
-      sequences = selectionGroup.getSelectionAsNewSequences(alignment);
+      sequences = selectionGroup.getSelectionAsNewSequences(alignment,
+              true);
     }
 
     return sequences;