JAL-2046 fix: patched SeqsetUtils so sequence features aren’t duplicated when reinsta...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 13 Apr 2016 20:31:42 +0000 (21:31 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 13 Apr 2016 20:32:35 +0000 (21:32 +0100)
src/jalview/analysis/SeqsetUtils.java

index 40bedad..b0ecfde 100755 (executable)
@@ -59,13 +59,19 @@ public class SeqsetUtils
         sfeat.addElement(sfarray[i]);
       }
     }
-    sqinfo.put("SeqFeatures", sfeat);
-    sqinfo.put("PdbId",
+    if (seq.getDatasetSequence() == null)
+    {
+      sqinfo.put("SeqFeatures", sfeat);
+      sqinfo.put("PdbId",
             (seq.getAllPDBEntries() != null) ? seq.getAllPDBEntries()
                     : new Vector<PDBEntry>());
-    sqinfo.put("datasetSequence",
+    }
+    else
+    {
+      sqinfo.put("datasetSequence",
             (seq.getDatasetSequence() != null) ? seq.getDatasetSequence()
                     : new Sequence("THISISAPLACEHOLDER", ""));
+    }
     return sqinfo;
   }
 
@@ -129,6 +135,11 @@ public class SeqsetUtils
             && !(seqds.getName().equals("THISISAPLACEHOLDER") && seqds
                     .getLength() == 0))
     {
+      if (sfeatures!=null)
+      {
+        System.err
+                .println("Implementation error: setting dataset sequence for a sequence which has sequence features.\n\tDataset sequence features will not be visible.");
+      }
       sq.setDatasetSequence(seqds);
     }