updated mapping for EMBL_Services_V1.1.xsd and tested with basic CDS feature detection.
authorjprocter <Jim Procter>
Tue, 24 Apr 2007 14:33:28 +0000 (14:33 +0000)
committerjprocter <Jim Procter>
Tue, 24 Apr 2007 14:33:28 +0000 (14:33 +0000)
resources/embl_mapping.xml
src/jalview/datamodel/xdb/embl/EmblEntry.java
src/jalview/datamodel/xdb/embl/EmblFile.java
src/jalview/datamodel/xdb/embl/Qualifier.java

index 7238e89..84ed647 100644 (file)
@@ -1,4 +1,9 @@
 <?xml version="1.0"?>\r
+<!--\r
+       History: Originally created from EMBL_common_V1.0\r
+       Updated on 24th April 2007 for WsDBFetch Service move to EMBL_Services_V1.1.xsd\r
+       -->
+       \r
 <mapping xmlns="http://castor.exolab.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
        xsi:schemaLocation="http://castor.exolab.org/ castor-mapping.xsd">\r
        <!-- -->\r
                <field name="name">\r
                        <bind-xml name="name" node="attribute"/>\r
                </field>\r
-               <field name="value">
-                       <bind-xml node="text"/>
+               <field name="evidence" type="string" collection="array">\r
+                       <bind-xml name="evidence" node="element"/>\r
+               </field>\r
+               <field name="values" type="string" collection="array">\r
+                       <bind-xml name="value" node="element"/>\r
                </field>\r
        </class>\r
        <class name="jalview.datamodel.xdb.embl.EmblFeatureLocations">\r
index 0f4fc24..49d51ad 100644 (file)
@@ -366,24 +366,24 @@ join(1..100,J00194.1:100..202)
             Qualifier q = (Qualifier) quals.next();
             if (q.getName().equals("translation")) 
             {
-              prseq=q.getValue();
+              prseq=q.getValues()[0];
             } 
             else
               if (q.getName().equals("protein_id")) 
               {
-                prid=q.getValue();
+                prid=q.getValues()[0];
               }
               else
                 if (q.getName().equals("codon_start"))
                 {
-                  prstart = Integer.parseInt(q.getValue());
+                  prstart = Integer.parseInt(q.getValues()[0]);
                 }
                 else 
                 if (q.getName().equals("product")){
-                  prname = q.getValue();
+                  prname = q.getValues()[0];
                 } else {
                   // throw anything else into the additional properties hash
-                  vals.put(q.getName(), q.getValue());
+                  vals.put(q.getName(), q.getValues().toString());
                 }
           }
         }
index 2294ecb..52542aa 100644 (file)
@@ -83,7 +83,7 @@ public class EmblFile {
         return record;
       }
     public static void main(String args[]) {
-        EmblFile myfile = EmblFile.getEmblFile(new File("C:\\Documents and Settings\\JimP\\workspace-3.2\\Jalview Release\\schemas\\embleRecord.xml"));
+        EmblFile myfile = EmblFile.getEmblFile(new File("C:\\Documents and Settings\\JimP\\workspace-3.2\\Jalview Release\\schemas\\embleRecordV1.1.xml"));
         if (myfile!=null && myfile.entries!=null && myfile.entries.size()>0)
             System.out.println(myfile.entries.size()+" Records read.");
         }
index 8fae059..37a0239 100644 (file)
@@ -2,7 +2,8 @@ package jalview.datamodel.xdb.embl;
 
 public class Qualifier {
     String name;
-    String value;
+    String[] values;
+    String[] evidence;
     /**
      * @return the name
      */
@@ -16,16 +17,57 @@ public class Qualifier {
         this.name = name;
     }
     /**
-     * @return the value
+     * @return the values
      */
-    public String getValue() {
-        return value;
+    public String[] getValues() {
+        return values;
     }
     /**
-     * @param value the value to set
+     * @param values the values to set
      */
-    public void setValue(String value) {
-        this.value = value;
+    public void setValues(String[] values) {
+        this.values = values;
+    }
+    public void addEvidence(String qevidence)
+    {
+      if (evidence==null)
+      {
+        evidence = new String[1];
+      }
+      else
+      {
+        String[] temp = new String[evidence.length+1];
+        System.arraycopy(evidence,0,temp,0,evidence.length);
+        evidence = temp;
+      }
+      evidence[evidence.length-1] = qevidence;
+    }
+    public void addValues(String value)
+    {
+      if (values==null)
+      {
+        values = new String[1];
+      }
+      else
+      {
+        String[] temp = new String[values.length+1];
+        System.arraycopy(values,0,temp,0,values.length);
+        values = temp;
+      }
+      values[values.length-1] = value;
+    }
+    /**
+     * @return the evidence
+     */
+    public String[] getEvidence()
+    {
+      return evidence;
+    }
+    /**
+     * @param evidence the evidence to set
+     */
+    public void setEvidence(String[] evidence)
+    {
+      this.evidence = evidence;
     }
-    
 }