JAL-2920 parse variation and original elements of the feature element, and include...
authorJim Procter <jprocter@issues.jalview.org>
Mon, 26 Feb 2018 15:59:53 +0000 (15:59 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 26 Feb 2018 15:59:53 +0000 (15:59 +0000)
resources/uniprot_mapping.xml
src/jalview/datamodel/xdb/uniprot/UniprotFeature.java

index 6344d1e..832d3e5 100755 (executable)
                </field>
                <field name="position">
                 <bind-xml name="position" node="attribute" location="location/position"/>
-                </field>
+               </field>
                <field name="begin">
                 <bind-xml name="position" node="attribute" location="location/begin"/>
-                </field>
-               <field name="end">
-                <bind-xml name="position" node="attribute" location="location/end"/>
-                </field>
+               </field>
+    <field name="end">
+      <bind-xml name="position" node="attribute" location="location/end"/>
+    </field>
+    <field name="variation">
+     <bind-xml name="variation"/>
+    </field>
+    <field name="original">
+     <bind-xml name="original"/>
+    </field>
         </class>
        
           <class name="jalview.datamodel.xdb.uniprot.UniprotSequence">
index b1ed275..6102775 100644 (file)
@@ -27,7 +27,11 @@ public class UniprotFeature
 {
   private String type;
 
-  private String description;
+  private String description = null;
+
+  private String original = null;
+
+  private String variation = null;
 
   private String status;
 
@@ -47,7 +51,13 @@ public class UniprotFeature
 
   public String getDescription()
   {
-    return description;
+    return (description == null && variation == null && original == null)
+            ? null
+            : (description == null ? "" : description)
+                    + ((variation != null)
+                            ? "Variation: '" + variation + "' "
+                    : "")
+            + ((original != null) ? "Original: '" + original + "'" : "");
   }
 
   public void setDescription(String d)
@@ -95,4 +105,24 @@ public class UniprotFeature
     this.begin = p;
     this.end = p;
   }
+
+  public String getOriginal()
+  {
+    return original;
+  }
+
+  public void setOriginal(String original)
+  {
+    this.original = original;
+  }
+
+  public String getVariation()
+  {
+    return variation;
+  }
+
+  public void setVariation(String variant)
+  {
+    this.variation = variant;
+  }
 }