From 586c640e0c55327a34d72c3cab6eb8052abc3029 Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 24 Apr 2007 14:33:28 +0000 Subject: [PATCH] updated mapping for EMBL_Services_V1.1.xsd and tested with basic CDS feature detection. --- resources/embl_mapping.xml | 12 ++++- src/jalview/datamodel/xdb/embl/EmblEntry.java | 10 ++--- src/jalview/datamodel/xdb/embl/EmblFile.java | 2 +- src/jalview/datamodel/xdb/embl/Qualifier.java | 58 +++++++++++++++++++++---- 4 files changed, 66 insertions(+), 16 deletions(-) diff --git a/resources/embl_mapping.xml b/resources/embl_mapping.xml index 7238e89..84ed647 100644 --- a/resources/embl_mapping.xml +++ b/resources/embl_mapping.xml @@ -1,4 +1,9 @@ + + @@ -89,8 +94,11 @@ - - + + + + + diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java index 0f4fc24..49d51ad 100644 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@ -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()); } } } diff --git a/src/jalview/datamodel/xdb/embl/EmblFile.java b/src/jalview/datamodel/xdb/embl/EmblFile.java index 2294ecb..52542aa 100644 --- a/src/jalview/datamodel/xdb/embl/EmblFile.java +++ b/src/jalview/datamodel/xdb/embl/EmblFile.java @@ -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."); } diff --git a/src/jalview/datamodel/xdb/embl/Qualifier.java b/src/jalview/datamodel/xdb/embl/Qualifier.java index 8fae059..37a0239 100644 --- a/src/jalview/datamodel/xdb/embl/Qualifier.java +++ b/src/jalview/datamodel/xdb/embl/Qualifier.java @@ -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; } - } -- 1.7.10.2