From 546c0c9d8709e46553f54fd06f199df3903dd0d1 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Thu, 13 Aug 2015 10:46:49 +0100 Subject: [PATCH] JAL-1641 added type to BioJSON sequence object and modified seqsHash to sequenceRefs in for the sequence group object --- src/jalview/io/JSONFile.java | 9 +++++---- src/jalview/json/binding/v1/SequenceGrpPojo.java | 10 +++++----- src/jalview/json/binding/v1/SequencePojo.java | 12 ++++++++++++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/jalview/io/JSONFile.java b/src/jalview/io/JSONFile.java index b8e2454..89518e5 100644 --- a/src/jalview/io/JSONFile.java +++ b/src/jalview/io/JSONFile.java @@ -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 grpSeqs = new ArrayList(); - if (seqsHashArray.size() > 0) + if (sequenceRefs.size() > 0) { - Iterator seqHashIter = seqsHashArray.iterator(); + Iterator seqHashIter = sequenceRefs.iterator(); while (seqHashIter.hasNext()) { String seqHash = seqHashIter.next(); diff --git a/src/jalview/json/binding/v1/SequenceGrpPojo.java b/src/jalview/json/binding/v1/SequenceGrpPojo.java index f19f8ba..7e4d41c 100644 --- a/src/jalview/json/binding/v1/SequenceGrpPojo.java +++ b/src/jalview/json/binding/v1/SequenceGrpPojo.java @@ -24,7 +24,7 @@ public class SequenceGrpPojo private int endRes; - private ArrayList seqsHash = new ArrayList(); + private ArrayList sequenceRefs = new ArrayList(); public String getColourScheme() { @@ -116,14 +116,14 @@ public class SequenceGrpPojo this.endRes = endRes; } - public ArrayList getSeqsHash() + public ArrayList getSequenceRefs() { - return seqsHash; + return sequenceRefs; } - public void setSeqsHash(ArrayList seqsHash) + public void setSequenceRefs(ArrayList sequenceRefs) { - this.seqsHash = seqsHash; + this.sequenceRefs = sequenceRefs; } public String getSvid() diff --git a/src/jalview/json/binding/v1/SequencePojo.java b/src/jalview/json/binding/v1/SequencePojo.java index d96da2a..af57164 100644 --- a/src/jalview/json/binding/v1/SequencePojo.java +++ b/src/jalview/json/binding/v1/SequencePojo.java @@ -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; + } + } -- 1.7.10.2