stores reference to dataset sequence if present
authorjprocter <Jim Procter>
Tue, 1 Nov 2005 16:01:03 +0000 (16:01 +0000)
committerjprocter <Jim Procter>
Tue, 1 Nov 2005 16:01:03 +0000 (16:01 +0000)
src/jalview/analysis/SeqsetUtils.java

index 11a31be..06a8192 100755 (executable)
@@ -52,7 +52,7 @@ public class SeqsetUtils
     sqinfo.put("SeqFeatures", (seq.getSequenceFeatures() !=null) ? seq.getSequenceFeatures() : new Vector());\r
     sqinfo.put("PdbId",\r
                (seq.getPDBId() != null) ? seq.getPDBId() : new String(""));\r
-\r
+    sqinfo.put("datasetSequence", (seq.getDatasetSequence() !=null) ? seq.getDatasetSequence() : new Sequence("THISISAPLACEHOLDER",""));\r
     return sqinfo;\r
   }\r
 \r
@@ -72,7 +72,7 @@ public class SeqsetUtils
     java.util.Vector sfeatures = (java.util.Vector) sqinfo.get(\r
         "SeqFeatures");\r
     String pdbid = (String) sqinfo.get("PdbId");\r
-\r
+    Sequence seqds = (Sequence) sqinfo.get("datasetSequence");\r
     if (oldname == null)\r
     {\r
       namePresent = false;\r
@@ -97,6 +97,9 @@ public class SeqsetUtils
     {\r
       sq.setSequenceFeatures(sfeatures);\r
     }\r
+    if ((seqds!=null) && !(seqds.getName().equals("THISISAPLACEHOLDER") && seqds.getLength()==0)) {\r
+      sq.setDatasetSequence(seqds);\r
+    }\r
 \r
     return namePresent;\r
   }\r