JAL-3143 also parse "phase" from JSON response if present
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 11 Jun 2019 18:28:59 +0000 (19:28 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 11 Jun 2019 18:28:59 +0000 (19:28 +0100)
src/jalview/ext/ensembl/EnsemblFeatures.java

index 744191d..99ebc69 100644 (file)
@@ -130,6 +130,7 @@ class EnsemblFeatures extends EnsemblRestClient
           int end = Integer.parseInt(obj.get("end").toString());
           String source = obj.get("source").toString();
           String strand = obj.get("strand").toString();
+          Object phase = obj.get("phase");
           String alleles = JSONUtils
                   .arrayToList((JSONArray) obj.get("alleles"));
           String clinSig = JSONUtils
@@ -155,6 +156,10 @@ class EnsemblFeatures extends EnsemblRestClient
           SequenceFeature sf = new SequenceFeature(type, desc, start, end,
                   source);
           sf.setStrand("1".equals(strand) ? "+" : "-");
+          if (phase != null)
+          {
+            sf.setPhase(phase.toString());
+          }
           setFeatureAttribute(sf, obj, "id");
           setFeatureAttribute(sf, obj, "Parent");
           setFeatureAttribute(sf, obj, "consequence_type");