JAL-1641 added type to BioJSON sequence object and modified seqsHash to sequenceRefs...
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Thu, 13 Aug 2015 09:46:49 +0000 (10:46 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Thu, 13 Aug 2015 09:46:49 +0000 (10:46 +0100)
src/jalview/io/JSONFile.java
src/jalview/json/binding/v1/SequenceGrpPojo.java
src/jalview/json/binding/v1/SequencePojo.java

index b8e2454..89518e5 100644 (file)
@@ -234,7 +234,8 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
           seqGrpPojo.setShowNonconserved(seqGrp.getShowNonconserved());
           for (SequenceI seq : seqGrp.getSequences())
           {
-            seqGrpPojo.getSeqsHash().add(String.valueOf(seq.hashCode()));
+            seqGrpPojo.getSequenceRefs()
+                    .add(String.valueOf(seq.hashCode()));
           }
           jsonAlignmentPojo.getSeqGroups().add(seqGrpPojo);
         }
@@ -454,12 +455,12 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
         int startRes = Integer
                 .valueOf(seqGrpObj.get("startRes").toString());
         int endRes = Integer.valueOf(seqGrpObj.get("endRes").toString());
-        JSONArray seqsHashArray = (JSONArray) seqGrpObj.get("seqsHash");
+        JSONArray sequenceRefs = (JSONArray) seqGrpObj.get("sequenceRefs");
 
         ArrayList<SequenceI> grpSeqs = new ArrayList<SequenceI>();
-        if (seqsHashArray.size() > 0)
+        if (sequenceRefs.size() > 0)
         {
-          Iterator<String> seqHashIter = seqsHashArray.iterator();
+          Iterator<String> seqHashIter = sequenceRefs.iterator();
           while (seqHashIter.hasNext())
           {
             String seqHash = seqHashIter.next();
index f19f8ba..7e4d41c 100644 (file)
@@ -24,7 +24,7 @@ public class SequenceGrpPojo
 
   private int endRes;
 
-  private ArrayList<String> seqsHash = new ArrayList<String>();
+  private ArrayList<String> sequenceRefs = new ArrayList<String>();
 
   public String getColourScheme()
   {
@@ -116,14 +116,14 @@ public class SequenceGrpPojo
     this.endRes = endRes;
   }
 
-  public ArrayList<String> getSeqsHash()
+  public ArrayList<String> getSequenceRefs()
   {
-    return seqsHash;
+    return sequenceRefs;
   }
 
-  public void setSeqsHash(ArrayList<String> seqsHash)
+  public void setSequenceRefs(ArrayList<String> sequenceRefs)
   {
-    this.seqsHash = seqsHash;
+    this.sequenceRefs = sequenceRefs;
   }
 
   public String getSvid()
index d96da2a..af57164 100644 (file)
@@ -10,6 +10,8 @@ public class SequencePojo
 
   private String name;
 
+  private String type;
+
   private String id;
 
   private int order;
@@ -95,4 +97,14 @@ public class SequencePojo
     return svid;
   }
 
+  public String getType()
+  {
+    return type;
+  }
+
+  public void setType(String type)
+  {
+    this.type = type;
+  }
+
 }