JAL-3116 parse EMBL XML with JAXB (todo: update unit tests)
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 14 Sep 2018 16:11:40 +0000 (17:11 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 14 Sep 2018 16:11:40 +0000 (17:11 +0100)
28 files changed:
schemas/embl.xsd [new file with mode: 0644]
schemas/embl_bindings.xml [new file with mode: 0644]
schemas/uniprot.xsd
src/jalview/datamodel/xdb/embl/EmblEntry.java [deleted file]
src/jalview/datamodel/xdb/embl/EmblError.java [deleted file]
src/jalview/datamodel/xdb/embl/EmblFeature.java [deleted file]
src/jalview/datamodel/xdb/embl/EmblFile.java [deleted file]
src/jalview/datamodel/xdb/embl/EmblSequence.java [deleted file]
src/jalview/datamodel/xdb/embl/Qualifier.java [deleted file]
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/CalculationChooser.java
src/jalview/gui/FontChooser.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
src/jalview/gui/PCAPanel.java
src/jalview/gui/SplitFrame.java
src/jalview/gui/TreeCanvas.java
src/jalview/gui/TreePanel.java
src/jalview/gui/VamsasApplication.java
src/jalview/ws/dbsources/EmblXmlSource.java
src/jalview/ws/dbsources/Uniprot.java
src/jalview/xml/binding/embl/EntrySetType.java [new file with mode: 0644]
src/jalview/xml/binding/embl/EntryType.java [new file with mode: 0644]
src/jalview/xml/binding/embl/ObjectFactory.java [new file with mode: 0644]
src/jalview/xml/binding/embl/ROOT.java [new file with mode: 0644]
src/jalview/xml/binding/embl/XrefType.java [new file with mode: 0644]

diff --git a/schemas/embl.xsd b/schemas/embl.xsd
new file mode 100644 (file)
index 0000000..1baebfe
--- /dev/null
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- 
+    Retrieved for Jalview 14-Sep-2018 from ftp://ftp.sra.ebi.ac.uk/meta/xsd/sra_1_5/ENA.embl.xsd 
+       Modified to match ftp://ftp.sra.ebi.ac.uk/meta/xsd/sra_1_5/ENA.root.xsd with only ENA.embl.xsd included 
+       root element "ROOT" contains a <choice> of "entry" (single accession) or "entrySet" (one or more accessions) 
+       Java binding classes are generated by 
+               xjc schemas/embl.xsd -b schemas/embl_bindings.xml -d src -p jalview.xml.binding.embl 
+-->
+<xs:schema xmlns:ebi="http://www.ebi.ac.uk/embl/schema"
+       xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       attributeFormDefault="unqualified" elementFormDefault="qualified"
+       version="1.1">
+       <xs:complexType name="XrefType">
+               <xs:annotation>
+                       <xs:documentation>Database cross-reference.</xs:documentation>
+               </xs:annotation>
+               <xs:attribute name="db" type="xs:string" use="required" />
+               <xs:attribute name="id" type="xs:string" use="required" />
+               <xs:attribute name="secondaryId" type="xs:string"
+                       use="optional" />
+       </xs:complexType>
+       <xs:complexType name="EntrySetType">
+               <xs:sequence minOccurs="1" maxOccurs="unbounded">
+                       <xs:element name="entry" type="EntryType" />
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="EntryType">
+               <xs:sequence>
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="secondaryAccession" type="xs:string" />
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="projectAccession" type="xs:string" />
+                       <xs:element maxOccurs="1" minOccurs="1" name="description"
+                               type="xs:string" />
+                       <xs:element maxOccurs="1" minOccurs="0" name="comment"
+                               type="xs:string" />
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="keyword" type="xs:string" />
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="reference">
+                               <xs:annotation>
+                                       <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                               </xs:annotation>
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="title"
+                                                       type="xs:string" />
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="author" type="xs:string" />
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="applicant" type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>Patent applicant.</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0"
+                                                       name="consortium" type="xs:string" />
+                                               <xs:element maxOccurs="1" minOccurs="0"
+                                                       name="submissionDate" type="xs:date">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The submission date (used only for submission
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="journal"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The journal name (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="year"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The publication year (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="volume"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The volume number (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="issue"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The issue number (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0"
+                                                       name="firstPage" type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The first page (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="lastPage"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The last page (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="comment"
+                                                       type="xs:string" />
+                                               <xs:element maxOccurs="1" minOccurs="0"
+                                                       name="referenceLocation" type="xs:string" />
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="xref" type="XrefType" />
+                                       </xs:sequence>
+                                       <xs:attribute name="type" use="required">
+                                               <xs:simpleType>
+                                                       <xs:restriction base="xs:string">
+                                                               <xs:enumeration value="submission" />
+                                                               <xs:enumeration value="book" />
+                                                               <xs:enumeration value="article" />
+                                                               <xs:enumeration value="patent" />
+                                                               <xs:enumeration value="thesis" />
+                                                               <xs:enumeration value="unpublished" />
+                                                       </xs:restriction>
+                                               </xs:simpleType>
+                                       </xs:attribute>
+                                       <xs:attribute name="number" type="xs:integer"
+                                               use="required" />
+                                       <xs:attribute name="location" type="xs:string" />
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="xref" type="XrefType" />
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="feature">
+                               <xs:annotation>
+                                       <xs:documentation>Sequence feature.</xs:documentation>
+                               </xs:annotation>
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="taxon">
+                                                       <xs:complexType>
+                                                               <xs:sequence>
+                                                                       <xs:element maxOccurs="1" minOccurs="0"
+                                                                               name="lineage">
+                                                                               <xs:complexType>
+                                                                                       <xs:sequence>
+                                                                                               <xs:element maxOccurs="unbounded" minOccurs="1"
+                                                                                                       name="taxon">
+                                                                                                       <xs:complexType>
+                                                                                                               <xs:attribute name="scientificName"
+                                                                                                                       type="xs:string" use="required" />
+                                                                                                       </xs:complexType>
+                                                                                               </xs:element>
+                                                                                       </xs:sequence>
+                                                                               </xs:complexType>
+                                                                       </xs:element>
+                                                               </xs:sequence>
+                                                               <xs:attribute name="scientificName"
+                                                                       type="xs:string" use="required" />
+                                                               <xs:attribute name="commonName" type="xs:string"
+                                                                       use="optional" />
+                                                               <xs:attribute name="taxId" type="xs:integer"
+                                                                       use="optional" />
+                                                       </xs:complexType>
+                                               </xs:element>
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="xref" type="XrefType" />
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="qualifier">
+                                                       <xs:annotation>
+                                                               <xs:documentation>Sequence feature qualifier.</xs:documentation>
+                                                       </xs:annotation>
+                                                       <xs:complexType>
+                                                               <xs:sequence>
+                                                                       <xs:element maxOccurs="1" minOccurs="0" name="value"
+                                                                               type="xs:string" />
+                                                               </xs:sequence>
+                                                               <xs:attribute name="name" type="xs:string"
+                                                                       use="required" />
+                                                       </xs:complexType>
+                                               </xs:element>
+                                       </xs:sequence>
+                                       <xs:attribute name="name" type="xs:string"
+                                               use="required" />
+                                       <xs:attribute name="location" type="xs:string"
+                                               use="required" />
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element maxOccurs="1" minOccurs="0" name="assembly">
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:element maxOccurs="unbounded" minOccurs="1"
+                                                       name="range">
+                                                       <xs:complexType>
+                                                               <xs:attribute name="begin" type="xs:integer"
+                                                                       use="required" />
+                                                               <xs:attribute name="end" type="xs:integer"
+                                                                       use="required" />
+                                                               <xs:attribute name="primaryBegin" type="xs:integer"
+                                                                       use="optional" />
+                                                               <xs:attribute name="primaryEnd" type="xs:integer"
+                                                                       use="optional" />
+                                                               <xs:attribute name="accession" type="xs:string"
+                                                                       use="required" />
+                                                               <xs:attribute name="version" type="xs:integer"
+                                                                       use="required" />
+                                                               <xs:attribute default="false" name="complement"
+                                                                       type="xs:boolean" use="optional" />
+                                                       </xs:complexType>
+                                               </xs:element>
+                                       </xs:sequence>
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element maxOccurs="1" minOccurs="0" name="contig">
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:choice maxOccurs="unbounded" minOccurs="0">
+                                                       <xs:element maxOccurs="1" minOccurs="1" name="range">
+                                                               <xs:complexType>
+                                                                       <xs:attribute name="begin" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute name="end" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute name="primaryBegin"
+                                                                               type="xs:integer" use="optional" />
+                                                                       <xs:attribute name="primaryEnd" type="xs:integer"
+                                                                               use="optional" />
+                                                                       <xs:attribute name="accession" type="xs:string"
+                                                                               use="required" />
+                                                                       <xs:attribute name="version" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute default="false" name="complement"
+                                                                               type="xs:boolean" use="optional" />
+                                                               </xs:complexType>
+                                                       </xs:element>
+                                                       <xs:element maxOccurs="1" minOccurs="1" name="gap">
+                                                               <xs:complexType>
+                                                                       <xs:attribute name="begin" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute name="end" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute name="length" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute default="false" name="unknownLength"
+                                                                               type="xs:boolean" use="optional" />
+                                                               </xs:complexType>
+                                                       </xs:element>
+                                               </xs:choice>
+                                       </xs:sequence>
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element maxOccurs="1" minOccurs="0" name="sequence"
+                               type="xs:string" />
+               </xs:sequence>
+               <xs:attribute name="accession" type="xs:string"
+                       use="required" />
+               <xs:attribute name="version" type="xs:integer"
+                       use="required" />
+               <xs:attribute name="entryVersion" type="xs:integer">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+               <xs:attribute name="dataClass" type="xs:string"
+                       use="required" />
+               <xs:attribute name="taxonomicDivision" type="xs:string"
+                       use="required" />
+               <xs:attribute name="moleculeType" type="xs:string"
+                       use="required" />
+               <xs:attribute name="sequenceLength" type="xs:integer"
+                       use="required" />
+               <xs:attribute name="topology" use="required">
+                       <xs:simpleType>
+                               <xs:restriction base="xs:string">
+                                       <xs:enumeration value="circular" />
+                                       <xs:enumeration value="linear" />
+                               </xs:restriction>
+                       </xs:simpleType>
+               </xs:attribute>
+               <xs:attribute name="firstPublic" type="xs:date">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+               <xs:attribute name="firstPublicRelease" type="xs:integer">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+               <xs:attribute name="lastUpdated" type="xs:date">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+               <xs:attribute name="lastUpdatedRelease" type="xs:integer">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+       </xs:complexType>
+       <xs:element name="ROOT">
+               <xs:complexType>
+                       <xs:choice>
+                               <xs:element name="entrySet" type="EntrySetType" />
+                               <xs:element name="entry" type="EntryType" />
+                       </xs:choice>
+               </xs:complexType>
+       </xs:element>
+</xs:schema>
diff --git a/schemas/embl_bindings.xml b/schemas/embl_bindings.xml
new file mode 100644 (file)
index 0000000..0f6f669
--- /dev/null
@@ -0,0 +1,15 @@
+<!--  
+       Binding file stops the nested 'taxon' elements generating invalid Java (nested type hiding enclosing type).
+       The binding converts EntryType/feature/taxon to EntryType$Feature$FeatureTaxon.
+       EntryType/feature/taxon/lineage/taxon generates EntryType$Feature$FeatureTaxon$Lineage$Taxon.  
+-->
+<jaxb:bindings
+       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+       xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" version="2.1">
+       <jaxb:bindings schemaLocation="embl.xsd">
+               <jaxb:bindings
+                       node="/xsd:schema/xsd:complexType[@name='EntryType']/xsd:sequence/xsd:element[@name='feature']/xsd:complexType/xsd:sequence/xsd:element[@name='taxon']/xsd:complexType">
+                       <jaxb:class name="FeatureTaxon" />
+               </jaxb:bindings>
+       </jaxb:bindings>
+</jaxb:bindings>
\ No newline at end of file
index 13df214..1744d37 100644 (file)
@@ -9,6 +9,11 @@
 *******************************************************************************-->
 <xs:schema targetNamespace="http://uniprot.org/uniprot" xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns="http://uniprot.org/uniprot" elementFormDefault="qualified">
+<!--  
+       Retrieved for Jalview 13-Sep-2018 from https://www.uniprot.org/docs/uniprot.xsd 
+       Java binding classes are generated by 
+          xjc schemas/uniprot.xsd -d src -p jalview.xml.binding.uniprot 
+-->
     <!-- XML Schema definition for the UniProtKB XML format
          Tested with:
          -XSV (XML Schema Validator), http://www.w3.org/2001/03/webdata/xsv
diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java
deleted file mode 100644 (file)
index bbe6a20..0000000
+++ /dev/null
@@ -1,872 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import jalview.analysis.SequenceIdMatcher;
-import jalview.bin.Cache;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
-import jalview.datamodel.FeatureProperties;
-import jalview.datamodel.Mapping;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceFeature;
-import jalview.datamodel.SequenceI;
-import jalview.util.DBRefUtils;
-import jalview.util.DnaUtils;
-import jalview.util.MapList;
-import jalview.util.MappingUtils;
-import jalview.util.StringUtils;
-
-import java.text.ParseException;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Vector;
-import java.util.regex.Pattern;
-
-/**
- * Data model for one entry returned from an EMBL query, as marshalled by a
- * Castor binding file
- * 
- * For example: http://www.ebi.ac.uk/ena/data/view/J03321&display=xml
- * 
- * @see embl_mapping.xml
- */
-public class EmblEntry
-{
-  private static final Pattern SPACE_PATTERN = Pattern.compile(" ");
-
-  String accession;
-
-  String entryVersion;
-
-  String sequenceVersion;
-
-  String dataClass;
-
-  String moleculeType;
-
-  String topology;
-
-  String sequenceLength;
-
-  String taxonomicDivision;
-
-  String description;
-
-  String firstPublicDate;
-
-  String firstPublicRelease;
-
-  String lastUpdatedDate;
-
-  String lastUpdatedRelease;
-
-  Vector<String> keywords;
-
-  Vector<DBRefEntry> dbRefs;
-
-  Vector<EmblFeature> features;
-
-  EmblSequence sequence;
-
-  /**
-   * @return the accession
-   */
-  public String getAccession()
-  {
-    return accession;
-  }
-
-  /**
-   * @param accession
-   *          the accession to set
-   */
-  public void setAccession(String accession)
-  {
-    this.accession = accession;
-  }
-
-  /**
-   * @return the dbRefs
-   */
-  public Vector<DBRefEntry> getDbRefs()
-  {
-    return dbRefs;
-  }
-
-  /**
-   * @param dbRefs
-   *          the dbRefs to set
-   */
-  public void setDbRefs(Vector<DBRefEntry> dbRefs)
-  {
-    this.dbRefs = dbRefs;
-  }
-
-  /**
-   * @return the features
-   */
-  public Vector<EmblFeature> getFeatures()
-  {
-    return features;
-  }
-
-  /**
-   * @param features
-   *          the features to set
-   */
-  public void setFeatures(Vector<EmblFeature> features)
-  {
-    this.features = features;
-  }
-
-  /**
-   * @return the keywords
-   */
-  public Vector<String> getKeywords()
-  {
-    return keywords;
-  }
-
-  /**
-   * @param keywords
-   *          the keywords to set
-   */
-  public void setKeywords(Vector<String> keywords)
-  {
-    this.keywords = keywords;
-  }
-
-  /**
-   * @return the sequence
-   */
-  public EmblSequence getSequence()
-  {
-    return sequence;
-  }
-
-  /**
-   * @param sequence
-   *          the sequence to set
-   */
-  public void setSequence(EmblSequence sequence)
-  {
-    this.sequence = sequence;
-  }
-
-  /**
-   * Recover annotated sequences from EMBL file
-   * 
-   * @param sourceDb
-   * @param peptides
-   *          a list of protein products found so far (to add to)
-   * @return dna dataset sequence with DBRefs and features
-   */
-  public SequenceI getSequence(String sourceDb, List<SequenceI> peptides)
-  {
-    SequenceI dna = makeSequence(sourceDb);
-    if (dna == null)
-    {
-      return null;
-    }
-    dna.setDescription(description);
-    DBRefEntry retrievedref = new DBRefEntry(sourceDb, getSequenceVersion(),
-            accession);
-    dna.addDBRef(retrievedref);
-    // add map to indicate the sequence is a valid coordinate frame for the
-    // dbref
-    retrievedref
-            .setMap(new Mapping(null, new int[]
-            { 1, dna.getLength() }, new int[] { 1, dna.getLength() }, 1,
-                    1));
-
-    /*
-     * transform EMBL Database refs to canonical form
-     */
-    if (dbRefs != null)
-    {
-      for (DBRefEntry dbref : dbRefs)
-      {
-        dbref.setSource(DBRefUtils.getCanonicalName(dbref.getSource()));
-        dna.addDBRef(dbref);
-      }
-    }
-
-    SequenceIdMatcher matcher = new SequenceIdMatcher(peptides);
-    try
-    {
-      for (EmblFeature feature : features)
-      {
-        if (FeatureProperties.isCodingFeature(sourceDb, feature.getName()))
-        {
-          parseCodingFeature(feature, sourceDb, dna, peptides, matcher);
-        }
-      }
-    } catch (Exception e)
-    {
-      System.err.println("EMBL Record Features parsing error!");
-      System.err
-              .println("Please report the following to help@jalview.org :");
-      System.err.println("EMBL Record " + accession);
-      System.err.println("Resulted in exception: " + e.getMessage());
-      e.printStackTrace(System.err);
-    }
-
-    return dna;
-  }
-
-  /**
-   * @param sourceDb
-   * @return
-   */
-  SequenceI makeSequence(String sourceDb)
-  {
-    if (sequence == null)
-    {
-      System.err.println(
-              "No sequence was returned for ENA accession " + accession);
-      return null;
-    }
-    SequenceI dna = new Sequence(sourceDb + "|" + accession,
-            sequence.getSequence());
-    return dna;
-  }
-
-  /**
-   * Extracts coding region and product from a CDS feature and properly decorate
-   * it with annotations.
-   * 
-   * @param feature
-   *          coding feature
-   * @param sourceDb
-   *          source database for the EMBLXML
-   * @param dna
-   *          parent dna sequence for this record
-   * @param peptides
-   *          list of protein product sequences for Embl entry
-   * @param matcher
-   *          helper to match xrefs in already retrieved sequences
-   */
-  void parseCodingFeature(EmblFeature feature, String sourceDb,
-          SequenceI dna, List<SequenceI> peptides,
-          SequenceIdMatcher matcher)
-  {
-    boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS);
-
-    int[] exons = getCdsRanges(feature);
-
-    String translation = null;
-    String proteinName = "";
-    String proteinId = null;
-    Map<String, String> vals = new Hashtable<>();
-
-    /*
-     * codon_start 1/2/3 in EMBL corresponds to phase 0/1/2 in CDS
-     * (phase is required for CDS features in GFF3 format)
-     */
-    int codonStart = 1;
-
-    /*
-     * parse qualifiers, saving protein translation, protein id,
-     * codon start position, product (name), and 'other values'
-     */
-    if (feature.getQualifiers() != null)
-    {
-      for (Qualifier q : feature.getQualifiers())
-      {
-        String qname = q.getName();
-        if (qname.equals("translation"))
-        {
-          // remove all spaces (precompiled String.replaceAll(" ", ""))
-          translation = SPACE_PATTERN.matcher(q.getValues()[0])
-                  .replaceAll("");
-        }
-        else if (qname.equals("protein_id"))
-        {
-          proteinId = q.getValues()[0].trim();
-        }
-        else if (qname.equals("codon_start"))
-        {
-          try
-          {
-            codonStart = Integer.parseInt(q.getValues()[0].trim());
-          } catch (NumberFormatException e)
-          {
-            System.err.println("Invalid codon_start in XML for " + accession
-                    + ": " + e.getMessage());
-          }
-        }
-        else if (qname.equals("product"))
-        {
-          // sometimes name is returned e.g. for V00488
-          proteinName = q.getValues()[0].trim();
-        }
-        else
-        {
-          // throw anything else into the additional properties hash
-          String[] qvals = q.getValues();
-          if (qvals != null)
-          {
-            String commaSeparated = StringUtils.arrayToSeparatorList(qvals,
-                    ",");
-            vals.put(qname, commaSeparated);
-          }
-        }
-      }
-    }
-
-    DBRefEntry proteinToEmblProteinRef = null;
-    exons = MappingUtils.removeStartPositions(codonStart - 1, exons);
-
-    SequenceI product = null;
-    Mapping dnaToProteinMapping = null;
-    if (translation != null && proteinName != null && proteinId != null)
-    {
-      int translationLength = translation.length();
-
-      /*
-       * look for product in peptides list, if not found, add it
-       */
-      product = matcher.findIdMatch(proteinId);
-      if (product == null)
-      {
-        product = new Sequence(proteinId, translation, 1,
-                translationLength);
-        product.setDescription(((proteinName.length() == 0)
-                ? "Protein Product from " + sourceDb
-                : proteinName));
-        peptides.add(product);
-        matcher.add(product);
-      }
-
-      // we have everything - create the mapping and perhaps the protein
-      // sequence
-      if (exons == null || exons.length == 0)
-      {
-        /*
-         * workaround until we handle dna location for CDS sequence
-         * e.g. location="X53828.1:60..1058" correctly
-         */
-        System.err.println(
-                "Implementation Notice: EMBLCDS records not properly supported yet - Making up the CDNA region of this sequence... may be incorrect ("
-                        + sourceDb + ":" + getAccession() + ")");
-        int dnaLength = dna.getLength();
-        if (translationLength * 3 == (1 - codonStart + dnaLength))
-        {
-          System.err.println(
-                  "Not allowing for additional stop codon at end of cDNA fragment... !");
-          // this might occur for CDS sequences where no features are marked
-          exons = new int[] { dna.getStart() + (codonStart - 1),
-              dna.getEnd() };
-          dnaToProteinMapping = new Mapping(product, exons,
-                  new int[]
-                  { 1, translationLength }, 3, 1);
-        }
-        if ((translationLength + 1) * 3 == (1 - codonStart + dnaLength))
-        {
-          System.err.println(
-                  "Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!");
-          exons = new int[] { dna.getStart() + (codonStart - 1),
-              dna.getEnd() - 3 };
-          dnaToProteinMapping = new Mapping(product, exons,
-                  new int[]
-                  { 1, translationLength }, 3, 1);
-        }
-      }
-      else
-      {
-        // Trim the exon mapping if necessary - the given product may only be a
-        // fragment of a larger protein. (EMBL:AY043181 is an example)
-
-        if (isEmblCdna)
-        {
-          // TODO: Add a DbRef back to the parent EMBL sequence with the exon
-          // map
-          // if given a dataset reference, search dataset for parent EMBL
-          // sequence if it exists and set its map
-          // make a new feature annotating the coding contig
-        }
-        else
-        {
-          // final product length truncation check
-          int[] cdsRanges = adjustForProteinLength(translationLength,
-                  exons);
-          dnaToProteinMapping = new Mapping(product, cdsRanges,
-                  new int[]
-                  { 1, translationLength }, 3, 1);
-          if (product != null)
-          {
-            /*
-             * make xref with mapping from protein to EMBL dna
-             */
-            DBRefEntry proteinToEmblRef = new DBRefEntry(DBRefSource.EMBL,
-                    getSequenceVersion(), proteinId,
-                    new Mapping(dnaToProteinMapping.getMap().getInverse()));
-            product.addDBRef(proteinToEmblRef);
-
-            /*
-             * make xref from protein to EMBLCDS; we assume here that the 
-             * CDS sequence version is same as dna sequence (?!)
-             */
-            MapList proteinToCdsMapList = new MapList(
-                    new int[]
-                    { 1, translationLength },
-                    new int[]
-                    { 1 + (codonStart - 1),
-                        (codonStart - 1) + 3 * translationLength },
-                    1, 3);
-            DBRefEntry proteinToEmblCdsRef = new DBRefEntry(
-                    DBRefSource.EMBLCDS, getSequenceVersion(), proteinId,
-                    new Mapping(proteinToCdsMapList));
-            product.addDBRef(proteinToEmblCdsRef);
-
-            /*
-             * make 'direct' xref from protein to EMBLCDSPROTEIN
-             */
-            proteinToEmblProteinRef = new DBRefEntry(proteinToEmblCdsRef);
-            proteinToEmblProteinRef.setSource(DBRefSource.EMBLCDSProduct);
-            proteinToEmblProteinRef.setMap(null);
-            product.addDBRef(proteinToEmblProteinRef);
-          }
-        }
-      }
-
-      /*
-       * add cds features to dna sequence
-       */
-      String cds = feature.getName(); // "CDS"
-      for (int xint = 0; exons != null && xint < exons.length - 1; xint += 2)
-      {
-        int exonStart = exons[xint];
-        int exonEnd = exons[xint + 1];
-        int begin = Math.min(exonStart, exonEnd);
-        int end = Math.max(exonStart, exonEnd);
-        int exonNumber = xint / 2 + 1;
-        String desc = String.format("Exon %d for protein '%s' EMBLCDS:%s",
-                exonNumber, proteinName, proteinId);
-
-        SequenceFeature sf = makeCdsFeature(cds, desc, begin, end,
-                sourceDb, vals);
-
-        sf.setEnaLocation(feature.getLocation());
-        boolean forwardStrand = exonStart <= exonEnd;
-        sf.setStrand(forwardStrand ? "+" : "-");
-        sf.setPhase(String.valueOf(codonStart - 1));
-        sf.setValue(FeatureProperties.EXONPOS, exonNumber);
-        sf.setValue(FeatureProperties.EXONPRODUCT, proteinName);
-
-        dna.addSequenceFeature(sf);
-      }
-    }
-
-    /*
-     * add feature dbRefs to sequence, and mappings for Uniprot xrefs
-     */
-    boolean hasUniprotDbref = false;
-    if (feature.dbRefs != null)
-    {
-      boolean mappingUsed = false;
-      for (DBRefEntry ref : feature.dbRefs)
-      {
-        /*
-         * ensure UniProtKB/Swiss-Prot converted to UNIPROT
-         */
-        String source = DBRefUtils.getCanonicalName(ref.getSource());
-        ref.setSource(source);
-        DBRefEntry proteinDbRef = new DBRefEntry(ref.getSource(),
-                ref.getVersion(), ref.getAccessionId());
-        if (source.equals(DBRefSource.UNIPROT))
-        {
-          String proteinSeqName = DBRefSource.UNIPROT + "|"
-                  + ref.getAccessionId();
-          if (dnaToProteinMapping != null
-                  && dnaToProteinMapping.getTo() != null)
-          {
-            if (mappingUsed)
-            {
-              /*
-               * two or more Uniprot xrefs for the same CDS - 
-               * each needs a distinct Mapping (as to a different sequence)
-               */
-              dnaToProteinMapping = new Mapping(dnaToProteinMapping);
-            }
-            mappingUsed = true;
-
-            /*
-             * try to locate the protein mapped to (possibly by a 
-             * previous CDS feature); if not found, construct it from
-             * the EMBL translation
-             */
-            SequenceI proteinSeq = matcher.findIdMatch(proteinSeqName);
-            if (proteinSeq == null)
-            {
-              proteinSeq = new Sequence(proteinSeqName,
-                      product.getSequenceAsString());
-              matcher.add(proteinSeq);
-              peptides.add(proteinSeq);
-            }
-            dnaToProteinMapping.setTo(proteinSeq);
-            dnaToProteinMapping.setMappedFromId(proteinId);
-            proteinSeq.addDBRef(proteinDbRef);
-            ref.setMap(dnaToProteinMapping);
-          }
-          hasUniprotDbref = true;
-        }
-        if (product != null)
-        {
-          /*
-           * copy feature dbref to our protein product
-           */
-          DBRefEntry pref = proteinDbRef;
-          pref.setMap(null); // reference is direct
-          product.addDBRef(pref);
-          // Add converse mapping reference
-          if (dnaToProteinMapping != null)
-          {
-            Mapping pmap = new Mapping(dna,
-                    dnaToProteinMapping.getMap().getInverse());
-            pref = new DBRefEntry(sourceDb, getSequenceVersion(),
-                    this.getAccession());
-            pref.setMap(pmap);
-            if (dnaToProteinMapping.getTo() != null)
-            {
-              dnaToProteinMapping.getTo().addDBRef(pref);
-            }
-          }
-        }
-        dna.addDBRef(ref);
-      }
-    }
-
-    /*
-     * if we have a product (translation) but no explicit Uniprot dbref
-     * (example: EMBL AAFI02000057 protein_id EAL65544.1)
-     * then construct mappings to an assumed EMBLCDSPROTEIN accession
-     */
-    if (!hasUniprotDbref && product != null)
-    {
-      if (proteinToEmblProteinRef == null)
-      {
-        // assuming CDSPROTEIN sequence version = dna version (?!)
-        proteinToEmblProteinRef = new DBRefEntry(DBRefSource.EMBLCDSProduct,
-                getSequenceVersion(), proteinId);
-      }
-      product.addDBRef(proteinToEmblProteinRef);
-
-      if (dnaToProteinMapping != null
-              && dnaToProteinMapping.getTo() != null)
-      {
-        DBRefEntry dnaToEmblProteinRef = new DBRefEntry(
-                DBRefSource.EMBLCDSProduct, getSequenceVersion(),
-                proteinId);
-        dnaToEmblProteinRef.setMap(dnaToProteinMapping);
-        dnaToProteinMapping.setMappedFromId(proteinId);
-        dna.addDBRef(dnaToEmblProteinRef);
-      }
-    }
-  }
-
-  /**
-   * Helper method to construct a SequenceFeature for one cds range
-   * 
-   * @param type
-   *          feature type ("CDS")
-   * @param desc
-   *          description
-   * @param begin
-   *          start position
-   * @param end
-   *          end position
-   * @param group
-   *          feature group
-   * @param vals
-   *          map of 'miscellaneous values' for feature
-   * @return
-   */
-  protected SequenceFeature makeCdsFeature(String type, String desc,
-          int begin, int end, String group, Map<String, String> vals)
-  {
-    SequenceFeature sf = new SequenceFeature(type, desc, begin, end, group);
-    if (!vals.isEmpty())
-    {
-      StringBuilder sb = new StringBuilder();
-      boolean first = true;
-      for (Entry<String, String> val : vals.entrySet())
-      {
-        if (!first)
-        {
-          sb.append(";");
-        }
-        sb.append(val.getKey()).append("=").append(val.getValue());
-        first = false;
-        sf.setValue(val.getKey(), val.getValue());
-      }
-      sf.setAttributes(sb.toString());
-    }
-    return sf;
-  }
-
-  /**
-   * Returns the CDS positions as a single array of [start, end, start, end...]
-   * positions. If on the reverse strand, these will be in descending order.
-   * 
-   * @param feature
-   * @return
-   */
-  protected int[] getCdsRanges(EmblFeature feature)
-  {
-    if (feature.location == null)
-    {
-      return new int[] {};
-    }
-
-    try
-    {
-      List<int[]> ranges = DnaUtils.parseLocation(feature.location);
-      return listToArray(ranges);
-    } catch (ParseException e)
-    {
-      Cache.log.warn(
-              String.format("Not parsing inexact CDS location %s in ENA %s",
-                      feature.location, this.accession));
-      return new int[] {};
-    }
-  }
-
-  /**
-   * Converts a list of [start, end] ranges to a single array of [start, end,
-   * start, end ...]
-   * 
-   * @param ranges
-   * @return
-   */
-  int[] listToArray(List<int[]> ranges)
-  {
-    int[] result = new int[ranges.size() * 2];
-    int i = 0;
-    for (int[] range : ranges)
-    {
-      result[i++] = range[0];
-      result[i++] = range[1];
-    }
-    return result;
-  }
-
-  /**
-   * Truncates (if necessary) the exon intervals to match 3 times the length of
-   * the protein; also accepts 3 bases longer (for stop codon not included in
-   * protein)
-   * 
-   * @param proteinLength
-   * @param exon
-   *          an array of [start, end, start, end...] intervals
-   * @return the same array (if unchanged) or a truncated copy
-   */
-  static int[] adjustForProteinLength(int proteinLength, int[] exon)
-  {
-    if (proteinLength <= 0 || exon == null)
-    {
-      return exon;
-    }
-    int expectedCdsLength = proteinLength * 3;
-    int exonLength = MappingUtils.getLength(Arrays.asList(exon));
-
-    /*
-     * if exon length matches protein, or is shorter, or longer by the 
-     * length of a stop codon (3 bases), then leave it unchanged
-     */
-    if (expectedCdsLength >= exonLength
-            || expectedCdsLength == exonLength - 3)
-    {
-      return exon;
-    }
-
-    int origxon[];
-    int sxpos = -1;
-    int endxon = 0;
-    origxon = new int[exon.length];
-    System.arraycopy(exon, 0, origxon, 0, exon.length);
-    int cdspos = 0;
-    for (int x = 0; x < exon.length; x += 2)
-    {
-      cdspos += Math.abs(exon[x + 1] - exon[x]) + 1;
-      if (expectedCdsLength <= cdspos)
-      {
-        // advanced beyond last codon.
-        sxpos = x;
-        if (expectedCdsLength != cdspos)
-        {
-          // System.err
-          // .println("Truncating final exon interval on region by "
-          // + (cdspos - cdslength));
-        }
-
-        /*
-         * shrink the final exon - reduce end position if forward
-         * strand, increase it if reverse
-         */
-        if (exon[x + 1] >= exon[x])
-        {
-          endxon = exon[x + 1] - cdspos + expectedCdsLength;
-        }
-        else
-        {
-          endxon = exon[x + 1] + cdspos - expectedCdsLength;
-        }
-        break;
-      }
-    }
-
-    if (sxpos != -1)
-    {
-      // and trim the exon interval set if necessary
-      int[] nxon = new int[sxpos + 2];
-      System.arraycopy(exon, 0, nxon, 0, sxpos + 2);
-      nxon[sxpos + 1] = endxon; // update the end boundary for the new exon
-                                // set
-      exon = nxon;
-    }
-    return exon;
-  }
-
-  public String getSequenceVersion()
-  {
-    return sequenceVersion;
-  }
-
-  public void setSequenceVersion(String sequenceVersion)
-  {
-    this.sequenceVersion = sequenceVersion;
-  }
-
-  public String getSequenceLength()
-  {
-    return sequenceLength;
-  }
-
-  public void setSequenceLength(String sequenceLength)
-  {
-    this.sequenceLength = sequenceLength;
-  }
-
-  public String getEntryVersion()
-  {
-    return entryVersion;
-  }
-
-  public void setEntryVersion(String entryVersion)
-  {
-    this.entryVersion = entryVersion;
-  }
-
-  public String getMoleculeType()
-  {
-    return moleculeType;
-  }
-
-  public void setMoleculeType(String moleculeType)
-  {
-    this.moleculeType = moleculeType;
-  }
-
-  public String getTopology()
-  {
-    return topology;
-  }
-
-  public void setTopology(String topology)
-  {
-    this.topology = topology;
-  }
-
-  public String getTaxonomicDivision()
-  {
-    return taxonomicDivision;
-  }
-
-  public void setTaxonomicDivision(String taxonomicDivision)
-  {
-    this.taxonomicDivision = taxonomicDivision;
-  }
-
-  public String getDescription()
-  {
-    return description;
-  }
-
-  public void setDescription(String description)
-  {
-    this.description = description;
-  }
-
-  public String getFirstPublicDate()
-  {
-    return firstPublicDate;
-  }
-
-  public void setFirstPublicDate(String firstPublicDate)
-  {
-    this.firstPublicDate = firstPublicDate;
-  }
-
-  public String getFirstPublicRelease()
-  {
-    return firstPublicRelease;
-  }
-
-  public void setFirstPublicRelease(String firstPublicRelease)
-  {
-    this.firstPublicRelease = firstPublicRelease;
-  }
-
-  public String getLastUpdatedDate()
-  {
-    return lastUpdatedDate;
-  }
-
-  public void setLastUpdatedDate(String lastUpdatedDate)
-  {
-    this.lastUpdatedDate = lastUpdatedDate;
-  }
-
-  public String getLastUpdatedRelease()
-  {
-    return lastUpdatedRelease;
-  }
-
-  public void setLastUpdatedRelease(String lastUpdatedRelease)
-  {
-    this.lastUpdatedRelease = lastUpdatedRelease;
-  }
-
-  public String getDataClass()
-  {
-    return dataClass;
-  }
-
-  public void setDataClass(String dataClass)
-  {
-    this.dataClass = dataClass;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/EmblError.java b/src/jalview/datamodel/xdb/embl/EmblError.java
deleted file mode 100644 (file)
index 94de28f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-/**
- * Data model mapped from any &lt;error&gt; elements returned from an EMBL query
- * 
- * @see embl_mapping.xml
- */
-public class EmblError
-{
-  String accession;
-
-  /**
-   * @return the accession
-   */
-  public String getAccession()
-  {
-    return accession;
-  }
-
-  /**
-   * @param accession
-   *          the accession to set
-   */
-  public void setAccession(String accession)
-  {
-    this.accession = accession;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/EmblFeature.java b/src/jalview/datamodel/xdb/embl/EmblFeature.java
deleted file mode 100644 (file)
index 51d740b..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import jalview.datamodel.DBRefEntry;
-
-import java.util.Vector;
-
-/**
- * Data model for a &lt;feature&gt; element returned from an EMBL query reply
- * 
- * @see embl_mapping.xml
- */
-public class EmblFeature
-{
-  String name;
-
-  Vector<DBRefEntry> dbRefs;
-
-  Vector<Qualifier> qualifiers;
-
-  String location;
-
-  /**
-   * @return the dbRefs
-   */
-  public Vector<DBRefEntry> getDbRefs()
-  {
-    return dbRefs;
-  }
-
-  /**
-   * @param dbRefs
-   *          the dbRefs to set
-   */
-  public void setDbRefs(Vector<DBRefEntry> dbRefs)
-  {
-    this.dbRefs = dbRefs;
-  }
-
-  /**
-   * @return the location
-   */
-  public String getLocation()
-  {
-    return location;
-  }
-
-  /**
-   * @param loc
-   */
-  public void setLocation(String loc)
-  {
-    this.location = loc;
-  }
-
-  /**
-   * @return the name
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-  /**
-   * @param name
-   *          the name to set
-   */
-  public void setName(String name)
-  {
-    this.name = name;
-  }
-
-  /**
-   * @return the qualifiers
-   */
-  public Vector<Qualifier> getQualifiers()
-  {
-    return qualifiers;
-  }
-
-  /**
-   * @param qualifiers
-   *          the qualifiers to set
-   */
-  public void setQualifiers(Vector<Qualifier> qualifiers)
-  {
-    this.qualifiers = qualifiers;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/EmblFile.java b/src/jalview/datamodel/xdb/embl/EmblFile.java
deleted file mode 100644 (file)
index 8a32c13..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import jalview.datamodel.DBRefEntry;
-import jalview.ws.dbsources.Uniprot;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.util.Vector;
-
-import org.exolab.castor.mapping.Mapping;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Data model for entries returned from an EMBL query, as marshalled by a Castor
- * binding file
- * 
- * For example: http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/embl/x53828/emblxml
- * 
- * @see embl_mapping.xml
- */
-public class EmblFile
-{
-  Vector<EmblEntry> entries;
-
-  Vector<EmblError> errors;
-
-  String text;
-
-  /**
-   * @return the entries
-   */
-  public Vector<EmblEntry> getEntries()
-  {
-    return entries;
-  }
-
-  /**
-   * @param entries
-   *          the entries to set
-   */
-  public void setEntries(Vector<EmblEntry> entries)
-  {
-    this.entries = entries;
-  }
-
-  /**
-   * @return the errors
-   */
-  public Vector<EmblError> getErrors()
-  {
-    return errors;
-  }
-
-  /**
-   * @param errors
-   *          the errors to set
-   */
-  public void setErrors(Vector<EmblError> errors)
-  {
-    this.errors = errors;
-  }
-
-  /**
-   * Parse an EmblXML file into an EmblFile object
-   * 
-   * @param file
-   * @return parsed EmblXML or null if exceptions were raised
-   */
-  public static EmblFile getEmblFile(File file)
-  {
-    if (file == null)
-    {
-      return null;
-    }
-    try
-    {
-      return EmblFile.getEmblFile(new FileReader(file));
-    } catch (Exception e)
-    {
-      System.err.println("Exception whilst reading EMBLfile from " + file);
-      e.printStackTrace(System.err);
-    }
-    return null;
-  }
-
-  public static EmblFile getEmblFile(Reader file)
-  {
-    EmblFile record = new EmblFile();
-    try
-    {
-      // 1. Load the mapping information from the file
-      Mapping map = new Mapping(record.getClass().getClassLoader());
-
-      java.net.URL url = record.getClass().getResource("/embl_mapping.xml");
-      map.loadMapping(url);
-
-      // 2. Unmarshal the data
-      Unmarshaller unmar = new Unmarshaller(record);
-      try
-      {
-        // uncomment to DEBUG EMBLFile reading
-        if (jalview.bin.Cache
-                .getDefault(jalview.bin.Cache.CASTORLOGLEVEL, "debug")
-                .equalsIgnoreCase("DEBUG"))
-        {
-          unmar.setDebug(jalview.bin.Cache.log.isDebugEnabled());
-        }
-      } catch (Exception e)
-      {
-      }
-      unmar.setIgnoreExtraElements(true);
-      unmar.setIgnoreExtraAttributes(true);
-      unmar.setMapping(map);
-      unmar.setLogWriter(new PrintWriter(System.out));
-      record = (EmblFile) unmar.unmarshal(file);
-
-      canonicaliseDbRefs(record);
-    } catch (Exception e)
-    {
-      e.printStackTrace(System.err);
-      record = null;
-    }
-
-    return record;
-  }
-
-  /**
-   * Change blank version to "0" in any DBRefEntry, to ensure consistent
-   * comparison with other DBRefEntry in Jalview
-   * 
-   * @param record
-   * @see Uniprot#getDbVersion
-   */
-  static void canonicaliseDbRefs(EmblFile record)
-  {
-    if (record.getEntries() == null)
-    {
-      return;
-    }
-    for (EmblEntry entry : record.getEntries())
-    {
-      if (entry.getDbRefs() != null)
-      {
-        for (DBRefEntry dbref : entry.getDbRefs())
-        {
-          if ("".equals(dbref.getVersion()))
-          {
-            dbref.setVersion("0");
-          }
-        }
-      }
-
-      if (entry.getFeatures() != null)
-      {
-        for (EmblFeature feature : entry.getFeatures())
-        {
-          if (feature.getDbRefs() != null)
-          {
-            for (DBRefEntry dbref : feature.getDbRefs())
-            {
-              if ("".equals(dbref.getVersion()))
-              {
-                dbref.setVersion("0");
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-
-  public String getText()
-  {
-    return text;
-  }
-
-  public void setText(String text)
-  {
-    this.text = text;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/EmblSequence.java b/src/jalview/datamodel/xdb/embl/EmblSequence.java
deleted file mode 100644 (file)
index 92c424b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-/**
- * Data model for the sequence extracted from an EMBL query reply
- * 
- * @see embl_mapping.xml
- */
-public class EmblSequence
-{
-  String sequence;
-
-  /**
-   * @return the sequence
-   */
-  public String getSequence()
-  {
-    return sequence;
-  }
-
-  /**
-   * @param sequence
-   *          the sequence to set
-   */
-  public void setSequence(String sequence)
-  {
-    // remove spaces introduced by unmarshalling of newline characters
-    this.sequence = sequence.replace(" ", "");
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/Qualifier.java b/src/jalview/datamodel/xdb/embl/Qualifier.java
deleted file mode 100644 (file)
index 851dd48..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-/**
- * Data model for a &lt;qualifier&gt; child element of a &lt;feature&gt; read
- * from an EMBL query reply
- * 
- * @see embl_mapping.xml
- */
-public class Qualifier
-{
-  String name;
-
-  String[] values;
-
-  String[] evidence;
-
-  /**
-   * @return the name
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-  /**
-   * @param name
-   *          the name to set
-   */
-  public void setName(String name)
-  {
-    this.name = name;
-  }
-
-  /**
-   * @return the values
-   */
-  public String[] getValues()
-  {
-    return values;
-  }
-
-  /**
-   * @param values
-   *          the values to set
-   */
-  public void setValues(String[] values)
-  {
-    this.values = values;
-  }
-
-  public void addEvidence(String qevidence)
-  {
-    // TODO - not used? can remove?
-    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)
-  {
-    // TODO - not used? can remove?
-    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;
-  }
-}
index 94b38ed..a2336a0 100644 (file)
@@ -733,9 +733,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     int aSize = alignPanels.size();
 
-    tabbedPane.setVisible(aSize > 1 || ap.av.viewName != null);
+    tabbedPane.setVisible(aSize > 1 || ap.av.getViewName() != null);
 
-    if (aSize == 1 && ap.av.viewName == null)
+    if (aSize == 1 && ap.av.getViewName() == null)
     {
       this.getContentPane().add(ap, BorderLayout.CENTER);
     }
@@ -748,7 +748,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       expandViews.setEnabled(true);
       gatherViews.setEnabled(true);
-      tabbedPane.addTab(ap.av.viewName, ap);
+      tabbedPane.addTab(ap.av.getViewName(), ap);
 
       ap.setVisible(false);
     }
@@ -771,7 +771,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     gatherViews.setEnabled(true);
     tabbedPane.setVisible(true);
     AlignmentPanel first = alignPanels.get(0);
-    tabbedPane.addTab(first.av.viewName, first);
+    tabbedPane.addTab(first.av.getViewName(), first);
     this.getContentPane().add(tabbedPane, BorderLayout.CENTER);
   }
 
@@ -872,7 +872,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    * @param av
    *          AlignViewport
    */
-  void setMenusFromViewport(AlignViewport av)
+  public void setMenusFromViewport(AlignViewport av)
   {
     padGapsMenuitem.setSelected(av.isPadGaps());
     colourTextMenuItem.setSelected(av.isShowColourText());
@@ -2713,10 +2713,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     newap.av.setGatherViewsHere(false);
 
-    if (viewport.viewName == null)
+    if (viewport.getViewName() == null)
     {
-      viewport.viewName = MessageManager
-              .getString("label.view_name_original");
+      viewport.setViewName(MessageManager
+              .getString("label.view_name_original"));
     }
 
     /*
@@ -2740,7 +2740,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       newap.refresh(true); // adjust layout of annotations
     }
 
-    newap.av.viewName = getNewViewName(viewTitle);
+    newap.av.setViewName(getNewViewName(viewTitle));
 
     addAlignmentPanel(newap, true);
     newap.alignmentChanged();
@@ -2803,9 +2803,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       if (comp instanceof AlignmentPanel)
       {
         AlignmentPanel ap = (AlignmentPanel) comp;
-        if (!existingNames.contains(ap.av.viewName))
+        if (!existingNames.contains(ap.av.getViewName()))
         {
-          existingNames.add(ap.av.viewName);
+          existingNames.add(ap.av.getViewName());
         }
       }
     }
@@ -3597,9 +3597,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     frameTitle += " from ";
 
-    if (viewport.viewName != null)
+    if (viewport.getViewName() != null)
     {
-      frameTitle += viewport.viewName + " of ";
+      frameTitle += viewport.getViewName() + " of ";
     }
 
     frameTitle += this.title;
@@ -4767,7 +4767,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       if (reply != null)
       {
-        viewport.viewName = reply;
+        viewport.setViewName(reply);
         // TODO warn if reply is in getExistingViewNames()?
         tabbedPane.setTitleAt(tabbedPane.getSelectedIndex(), reply);
       }
index 7e77bec..cc533ce 100644 (file)
@@ -79,7 +79,7 @@ public class AlignViewport extends AlignmentViewport
 
   private Rectangle explodedGeometry;
 
-  String viewName;
+  private String viewName;
 
   /*
    * Flag set true on the view that should 'gather' multiple views of the same
@@ -1032,4 +1032,14 @@ public class AlignViewport extends AlignmentViewport
     }
     fr.setTransparency(featureSettings.getTransparency());
   }
+
+  public String getViewName()
+  {
+    return viewName;
+  }
+
+  public void setViewName(String viewName)
+  {
+    this.viewName = viewName;
+  }
 }
index 60ef480..c03b56d 100644 (file)
@@ -1567,7 +1567,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
   @Override
   public String getViewName()
   {
-    return av.viewName;
+    return av.getViewName();
   }
 
   /**
index f674c7e..183419e 100644 (file)
@@ -270,9 +270,9 @@ public class CalculationChooser extends JPanel
 
     setMinimumSize(new Dimension(325, height - 10));
     String title = MessageManager.getString("label.choose_calculation");
-    if (af.getViewport().viewName != null)
+    if (af.getViewport().getViewName() != null)
     {
-      title = title + " (" + af.getViewport().viewName + ")";
+      title = title + " (" + af.getViewport().getViewName() + ")";
     }
 
     Desktop.addInternalFrame(frame, title, width, height, false);
index c66f304..92cc4c6 100755 (executable)
@@ -87,7 +87,7 @@ public class FontChooser extends GFontChooser
   public FontChooser(TreePanel treePanel)
   {
     this.tp = treePanel;
-    ap = treePanel.treeCanvas.ap;
+    ap = treePanel.getTreeCanvas().getAssociatedPanel();
     oldFont = treePanel.getTreeFont();
     defaultButton.setVisible(false);
     smoothFont.setEnabled(false);
index 9285754..87b8d87 100644 (file)
@@ -1102,13 +1102,13 @@ public class Jalview2XML
           {
             TreePanel tp = (TreePanel) frames[t];
 
-            if (tp.treeCanvas.av.getAlignment() == jal)
+            if (tp.getTreeCanvas().getViewport().getAlignment() == jal)
             {
               Tree tree = new Tree();
               tree.setTitle(tp.getTitle());
               tree.setCurrentTree((av.getCurrentTree() == tp.getTree()));
               tree.setNewick(tp.getTree().print());
-              tree.setThreshold(tp.treeCanvas.threshold);
+              tree.setThreshold(tp.getTreeCanvas().getThreshold());
 
               tree.setFitToWindow(tp.fitToWindow.getState());
               tree.setFontName(tp.getTreeFont().getName());
@@ -1247,7 +1247,7 @@ public class Jalview2XML
       {
         view.setComplementId(av.getCodingComplement().getViewId());
       }
-      view.setViewName(av.viewName);
+      view.setViewName(av.getViewName());
       view.setGatheredViews(av.isGatherViewsHere());
 
       Rectangle size = ap.av.getExplodedGeometry();
@@ -3763,11 +3763,11 @@ public class Jalview2XML
           tp.setTitle(tree.getTitle());
           tp.setBounds(new Rectangle(tree.getXpos(), tree.getYpos(),
                   tree.getWidth(), tree.getHeight()));
-          tp.av = av; // af.viewport; // TODO: verify 'associate with all
+          tp.setViewport(av); // af.viewport; // TODO: verify 'associate with all
           // views'
           // works still
-          tp.treeCanvas.av = av; // af.viewport;
-          tp.treeCanvas.ap = ap; // af.alignPanel;
+          tp.getTreeCanvas().setViewport(av); // af.viewport;
+          tp.getTreeCanvas().setAssociatedPanel(ap); // af.alignPanel;
 
         }
         if (tp == null)
@@ -3795,7 +3795,7 @@ public class Jalview2XML
         tp.showBootstrap(tree.getShowBootstrap());
         tp.showDistances(tree.getShowDistances());
 
-        tp.treeCanvas.threshold = tree.getThreshold();
+        tp.getTreeCanvas().setThreshold(tree.getThreshold());
 
         if (tree.getCurrentTree())
         {
@@ -4528,7 +4528,7 @@ public class Jalview2XML
 
     if (view.getViewName() != null)
     {
-      af.viewport.viewName = view.getViewName();
+      af.viewport.setViewName(view.getViewName());
       af.setInitialTabVisible();
     }
     af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(),
index 331e738..9548839 100755 (executable)
@@ -493,7 +493,7 @@ public class Jalview2XML_V1
           tp.showBootstrap(tree.getShowBootstrap());
           tp.showDistances(tree.getShowDistances());
 
-          tp.treeCanvas.threshold = tree.getThreshold();
+          tp.getTreeCanvas().setThreshold(tree.getThreshold());
 
           if (tree.getCurrentTree())
           {
index 7ceceee..c1e935a 100644 (file)
@@ -609,7 +609,7 @@ public class PCAPanel extends GPCAPanel
     for (i = 0; i < iSize; i++)
     {
       final AlignmentPanel ap = aps[i];
-      item = new JRadioButtonMenuItem(ap.av.viewName, ap.av == rc.av);
+      item = new JRadioButtonMenuItem(ap.av.getViewName(), ap.av == rc.av);
       buttonGroup.add(item);
       item.addActionListener(new ActionListener()
       {
index 5bff407..a0d31cf 100644 (file)
@@ -539,7 +539,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI
       topFrame.setDisplayedView(newTopPanel);
     }
 
-    newBottomPanel.av.viewName = newTopPanel.av.viewName;
+    newBottomPanel.av.setViewName(newTopPanel.av.getViewName());
     newTopPanel.av.setCodingComplement(newBottomPanel.av);
 
     /*
index fa30e13..45def89 100755 (executable)
@@ -80,9 +80,9 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
   TreePanel tp;
 
-  AlignViewport av;
+  private AlignViewport av;
 
-  AlignmentPanel ap;
+  private AlignmentPanel ap;
 
   Font font;
 
@@ -100,7 +100,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
   int offy;
 
-  float threshold;
+  private float threshold;
 
   String longestName;
 
@@ -130,7 +130,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
   {
     this.tp = tp;
     this.av = ap.av;
-    this.ap = ap;
+    this.setAssociatedPanel(ap);
     font = av.getFont();
     scrollPane = scroller;
     addMouseListener(this);
@@ -847,7 +847,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
     if (col != null)
     {
       setColor(highlightNode, col);
-      PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
+      PaintRefresher.Refresh(tp, getAssociatedPanel().av.getSequenceSetId());
       repaint();
     }
   }
@@ -928,7 +928,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
     if (ob instanceof SequenceI)
     {
       treeSelectionChanged((Sequence) ob);
-      PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
+      PaintRefresher.Refresh(tp, getAssociatedPanel().av.getSequenceSetId());
       repaint();
       av.sendSelection();
       return;
@@ -973,7 +973,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
         }
       }
 
-      PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
+      PaintRefresher.Refresh(tp, getAssociatedPanel().av.getSequenceSetId());
       repaint();
     }
 
@@ -1127,7 +1127,37 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
     }
     else
     {
-      return new AlignmentPanel[] { ap };
+      return new AlignmentPanel[] { getAssociatedPanel() };
     }
   }
+
+  public AlignmentPanel getAssociatedPanel()
+  {
+    return ap;
+  }
+
+  public void setAssociatedPanel(AlignmentPanel ap)
+  {
+    this.ap = ap;
+  }
+
+  public AlignViewport getViewport()
+  {
+    return av;
+  }
+
+  public void setViewport(AlignViewport av)
+  {
+    this.av = av;
+  }
+
+  public float getThreshold()
+  {
+    return threshold;
+  }
+
+  public void setThreshold(float threshold)
+  {
+    this.threshold = threshold;
+  }
 }
index 2727db1..084f461 100755 (executable)
@@ -85,11 +85,11 @@ public class TreePanel extends GTreePanel
 
   SimilarityParamsI similarityParams;
 
-  TreeCanvas treeCanvas;
+  private TreeCanvas treeCanvas;
 
   TreeModel tree;
 
-  AlignViewport av;
+  private AlignViewport av;
 
   /**
    * Creates a new TreePanel object.
@@ -121,24 +121,24 @@ public class TreePanel extends GTreePanel
 
   public AlignmentI getAlignment()
   {
-    return treeCanvas.av.getAlignment();
+    return getTreeCanvas().getViewport().getAlignment();
   }
 
   public AlignmentViewport getViewPort()
   {
-    return treeCanvas.av;
+    return getTreeCanvas().getViewport();
   }
 
   void initTreePanel(AlignmentPanel ap, String type, String modelName,
           NewickFile newTree, AlignmentView inputData)
   {
 
-    av = ap.av;
+    setViewport(ap.av);
     this.treeType = type;
     this.scoreModelName = modelName;
 
     treeCanvas = new TreeCanvas(this, ap, scrollPane);
-    scrollPane.setViewportView(treeCanvas);
+    scrollPane.setViewportView(getTreeCanvas());
 
     PaintRefresher.Register(this, ap.av.getSequenceSetId());
 
@@ -155,9 +155,9 @@ public class TreePanel extends GTreePanel
       @Override
       public void internalFrameClosed(InternalFrameEvent evt)
       {
-        if (av != null)
+        if (getViewport() != null)
         {
-          av.removePropertyChangeListener(listener);
+          getViewport().removePropertyChangeListener(listener);
         }
       }
     });
@@ -194,13 +194,13 @@ public class TreePanel extends GTreePanel
           }
 
           tree.updatePlaceHolders((List<SequenceI>) evt.getNewValue());
-          treeCanvas.nameHash.clear(); // reset the mapping between canvas
+          getTreeCanvas().nameHash.clear(); // reset the mapping between canvas
           // rectangles and leafnodes
           repaint();
         }
       }
     };
-    av.addPropertyChangeListener(listener);
+    getViewport().addPropertyChangeListener(listener);
     return listener;
   }
 
@@ -213,8 +213,8 @@ public class TreePanel extends GTreePanel
   void buildAssociatedViewMenu()
   {
     AlignmentPanel[] aps = PaintRefresher
-            .getAssociatedPanels(av.getSequenceSetId());
-    if (aps.length == 1 && treeCanvas.ap == aps[0])
+            .getAssociatedPanels(getViewport().getSequenceSetId());
+    if (aps.length == 1 && getTreeCanvas().getAssociatedPanel() == aps[0])
     {
       associateLeavesMenu.setVisible(false);
       return;
@@ -237,16 +237,16 @@ public class TreePanel extends GTreePanel
     for (i = 0; i < iSize; i++)
     {
       final AlignmentPanel ap = aps[i];
-      item = new JRadioButtonMenuItem(ap.av.viewName, ap == treeCanvas.ap);
+      item = new JRadioButtonMenuItem(ap.av.getViewName(), ap == getTreeCanvas().getAssociatedPanel());
       buttonGroup.add(item);
       item.addActionListener(new ActionListener()
       {
         @Override
         public void actionPerformed(ActionEvent evt)
         {
-          treeCanvas.applyToAllViews = false;
-          treeCanvas.ap = ap;
-          treeCanvas.av = ap.av;
+          getTreeCanvas().applyToAllViews = false;
+          getTreeCanvas().setAssociatedPanel(ap);
+          getTreeCanvas().setViewport(ap.av);
           PaintRefresher.Register(thisTreePanel, ap.av.getSequenceSetId());
         }
       });
@@ -257,13 +257,13 @@ public class TreePanel extends GTreePanel
     final JRadioButtonMenuItem itemf = new JRadioButtonMenuItem(
             MessageManager.getString("label.all_views"));
     buttonGroup.add(itemf);
-    itemf.setSelected(treeCanvas.applyToAllViews);
+    itemf.setSelected(getTreeCanvas().applyToAllViews);
     itemf.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent evt)
       {
-        treeCanvas.applyToAllViews = itemf.isSelected();
+        getTreeCanvas().applyToAllViews = itemf.isSelected();
       }
     });
     associateLeavesMenu.add(itemf);
@@ -296,7 +296,7 @@ public class TreePanel extends GTreePanel
 
       if (newtree != null)
       {
-        tree = new TreeModel(av.getAlignment().getSequencesArray(), odata,
+        tree = new TreeModel(getViewport().getAlignment().getSequencesArray(), odata,
                 newtree);
         if (tree.getOriginalData() == null)
         {
@@ -306,20 +306,20 @@ public class TreePanel extends GTreePanel
       else
       {
         ScoreModelI sm = ScoreModels.getInstance()
-                .getScoreModel(scoreModelName, treeCanvas.ap);
+                .getScoreModel(scoreModelName, getTreeCanvas().getAssociatedPanel());
         TreeBuilder njtree = treeType.equals(TreeBuilder.NEIGHBOUR_JOINING)
-                ? new NJTree(av, sm, similarityParams)
-                : new AverageDistanceTree(av, sm, similarityParams);
+                ? new NJTree(getViewport(), sm, similarityParams)
+                : new AverageDistanceTree(getViewport(), sm, similarityParams);
         tree = new TreeModel(njtree);
         showDistances(true);
       }
 
       tree.reCount(tree.getTopNode());
       tree.findHeight(tree.getTopNode());
-      treeCanvas.setTree(tree);
-      treeCanvas.repaint();
-      av.setCurrentTree(tree);
-      if (av.getSortByTree())
+      getTreeCanvas().setTree(tree);
+      getTreeCanvas().repaint();
+      getViewport().setCurrentTree(tree);
+      if (getViewport().getSortByTree())
       {
         sortByTree_actionPerformed();
       }
@@ -328,20 +328,20 @@ public class TreePanel extends GTreePanel
 
   public void showDistances(boolean b)
   {
-    treeCanvas.setShowDistances(b);
+    getTreeCanvas().setShowDistances(b);
     distanceMenu.setSelected(b);
   }
 
   public void showBootstrap(boolean b)
   {
-    treeCanvas.setShowBootstrap(b);
+    getTreeCanvas().setShowBootstrap(b);
     bootstrapMenu.setSelected(b);
   }
 
   public void showPlaceholders(boolean b)
   {
     placeholdersMenu.setState(b);
-    treeCanvas.setMarkPlaceholders(b);
+    getTreeCanvas().setMarkPlaceholders(b);
   }
 
   /**
@@ -432,7 +432,7 @@ public class TreePanel extends GTreePanel
   public void printMenu_actionPerformed(ActionEvent e)
   {
     // Putting in a thread avoids Swing painting problems
-    treeCanvas.startPrinting();
+    getTreeCanvas().startPrinting();
   }
 
   @Override
@@ -456,7 +456,7 @@ public class TreePanel extends GTreePanel
     {
       // we try to get the associated view's gap character
       // but this may fail if the view was closed...
-      gc = av.getGapCharacter();
+      gc = getViewport().getGapCharacter();
 
     } catch (Exception ex)
     {
@@ -469,8 +469,8 @@ public class TreePanel extends GTreePanel
       // AlignmentOrder origorder = new AlignmentOrder(alAndColsel[0]);
 
       AlignmentI al = new Alignment((SequenceI[]) alAndColsel[0]);
-      AlignmentI dataset = (av != null && av.getAlignment() != null)
-              ? av.getAlignment().getDataset()
+      AlignmentI dataset = (getViewport() != null && getViewport().getAlignment() != null)
+              ? getViewport().getAlignment().getDataset()
               : null;
       if (dataset != null)
       {
@@ -507,7 +507,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void fitToWindow_actionPerformed(ActionEvent e)
   {
-    treeCanvas.fitToWindow = fitToWindow.isSelected();
+    getTreeCanvas().fitToWindow = fitToWindow.isSelected();
     repaint();
   }
 
@@ -520,15 +520,15 @@ public class TreePanel extends GTreePanel
   public void sortByTree_actionPerformed()
   {
 
-    if (treeCanvas.applyToAllViews)
+    if (getTreeCanvas().applyToAllViews)
     {
       final ArrayList<CommandI> commands = new ArrayList<>();
       for (AlignmentPanel ap : PaintRefresher
-              .getAssociatedPanels(av.getSequenceSetId()))
+              .getAssociatedPanels(getViewport().getSequenceSetId()))
       {
         commands.add(sortAlignmentIn(ap.av.getAlignPanel()));
       }
-      av.getAlignPanel().alignFrame.addHistoryItem(new CommandI()
+      getViewport().getAlignPanel().alignFrame.addHistoryItem(new CommandI()
       {
 
         @Override
@@ -563,7 +563,7 @@ public class TreePanel extends GTreePanel
         }
       });
       for (AlignmentPanel ap : PaintRefresher
-              .getAssociatedPanels(av.getSequenceSetId()))
+              .getAssociatedPanels(getViewport().getSequenceSetId()))
       {
         // ensure all the alignFrames refresh their GI after adding an undo item
         ap.alignFrame.updateEditMenuBar();
@@ -571,8 +571,8 @@ public class TreePanel extends GTreePanel
     }
     else
     {
-      treeCanvas.ap.alignFrame
-              .addHistoryItem(sortAlignmentIn(treeCanvas.ap));
+      getTreeCanvas().getAssociatedPanel().alignFrame
+              .addHistoryItem(sortAlignmentIn(getTreeCanvas().getAssociatedPanel()));
     }
 
   }
@@ -599,7 +599,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void font_actionPerformed(ActionEvent e)
   {
-    if (treeCanvas == null)
+    if (getTreeCanvas() == null)
     {
       return;
     }
@@ -609,14 +609,14 @@ public class TreePanel extends GTreePanel
 
   public Font getTreeFont()
   {
-    return treeCanvas.font;
+    return getTreeCanvas().font;
   }
 
   public void setTreeFont(Font f)
   {
-    if (treeCanvas != null)
+    if (getTreeCanvas() != null)
     {
-      treeCanvas.setFont(f);
+      getTreeCanvas().setFont(f);
     }
   }
 
@@ -629,7 +629,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void distanceMenu_actionPerformed(ActionEvent e)
   {
-    treeCanvas.setShowDistances(distanceMenu.isSelected());
+    getTreeCanvas().setShowDistances(distanceMenu.isSelected());
   }
 
   /**
@@ -641,7 +641,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void bootstrapMenu_actionPerformed(ActionEvent e)
   {
-    treeCanvas.setShowBootstrap(bootstrapMenu.isSelected());
+    getTreeCanvas().setShowBootstrap(bootstrapMenu.isSelected());
   }
 
   /**
@@ -653,7 +653,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void placeholdersMenu_actionPerformed(ActionEvent e)
   {
-    treeCanvas.setMarkPlaceholders(placeholdersMenu.isSelected());
+    getTreeCanvas().setMarkPlaceholders(placeholdersMenu.isSelected());
   }
 
   /**
@@ -691,8 +691,8 @@ public class TreePanel extends GTreePanel
       accurateText = false;
     }
 
-    int width = treeCanvas.getWidth();
-    int height = treeCanvas.getHeight();
+    int width = getTreeCanvas().getWidth();
+    int height = getTreeCanvas().getHeight();
 
     try
     {
@@ -720,7 +720,7 @@ public class TreePanel extends GTreePanel
 
       pg.setAccurateTextMode(accurateText);
 
-      treeCanvas.draw(pg, width, height);
+      getTreeCanvas().draw(pg, width, height);
 
       pg.flush();
       pg.close();
@@ -739,8 +739,8 @@ public class TreePanel extends GTreePanel
   @Override
   public void pngTree_actionPerformed(ActionEvent e)
   {
-    int width = treeCanvas.getWidth();
-    int height = treeCanvas.getHeight();
+    int width = getTreeCanvas().getWidth();
+    int height = getTreeCanvas().getHeight();
 
     try
     {
@@ -769,7 +769,7 @@ public class TreePanel extends GTreePanel
               BufferedImage.TYPE_INT_RGB);
       Graphics png = bi.getGraphics();
 
-      treeCanvas.draw(png, width, height);
+      getTreeCanvas().draw(png, width, height);
 
       ImageIO.write(bi, "png", out);
       out.close();
@@ -883,4 +883,19 @@ public class TreePanel extends GTreePanel
             treecalcnm, smn);
     return ttl;
   }
+
+  public AlignViewport getViewport()
+  {
+    return av;
+  }
+
+  public void setViewport(AlignViewport av)
+  {
+    this.av = av;
+  }
+
+  public TreeCanvas getTreeCanvas()
+  {
+    return treeCanvas;
+  }
 }
index 973cfe8..c094b1c 100644 (file)
@@ -484,8 +484,8 @@ public class VamsasApplication implements SelectionSource, VamsasSource
               errorsDuringUpdate = true;
               Cache.log.error("Exception synchronizing " + af.getTitle()
                       + " "
-                      + (af.getViewport().viewName == null ? ""
-                              : " view " + af.getViewport().viewName)
+                      + (af.getViewport().getViewName() == null ? ""
+                              : " view " + af.getViewport().getViewName())
                       + " to document.", e);
               stored = false;
             }
index ca90d60..8f55080 100644 (file)
  */
 package jalview.ws.dbsources;
 
+import jalview.analysis.SequenceIdMatcher;
+import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
+import jalview.datamodel.FeatureProperties;
+import jalview.datamodel.Mapping;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
-import jalview.datamodel.xdb.embl.EmblEntry;
-import jalview.datamodel.xdb.embl.EmblFile;
+import jalview.util.DBRefUtils;
+import jalview.util.DnaUtils;
+import jalview.util.MapList;
+import jalview.util.MappingUtils;
 import jalview.util.MessageManager;
 import jalview.ws.ebi.EBIFetchClient;
+import jalview.xml.binding.embl.EntryType;
+import jalview.xml.binding.embl.EntryType.Feature;
+import jalview.xml.binding.embl.EntryType.Feature.Qualifier;
+import jalview.xml.binding.embl.XrefType;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Hashtable;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 
 public abstract class EmblXmlSource extends EbiFileRetrievedProxy
 {
@@ -39,17 +68,19 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
    */
   private static final String EMBL_NOT_FOUND_REPLY = "ERROR 12 No entries found.";
 
+  private static final Pattern SPACE_PATTERN = Pattern.compile(" ");
+
   public EmblXmlSource()
   {
     super();
   }
 
   /**
-   * retrieve and parse an emblxml file
+   * Retrieves and parses an emblxml file, and returns an alignment containing
+   * the parsed sequences, or null if none were found
    * 
    * @param emprefx
-   *          either EMBL or EMBLCDS strings are allowed - anything else will
-   *          not retrieve emblxml
+   *          "EMBL" or "EMBLCDS" - anything else will not retrieve emblxml
    * @param query
    * @return
    * @throws Exception
@@ -90,15 +121,14 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
   public AlignmentI getEmblSequenceRecords(String emprefx, String query,
           File reply) throws Exception
   {
-    EmblFile efile = null;
-    List<SequenceI> seqs = new ArrayList<>();
-
+    List<EntryType> entries = null;
     if (reply != null && reply.exists())
     {
       file = reply.getAbsolutePath();
       if (reply.length() > EMBL_NOT_FOUND_REPLY.length())
       {
-        efile = EmblFile.getEmblFile(reply);
+        InputStream is = new FileInputStream(reply);
+        entries = getEmblEntries(is);
       }
     }
 
@@ -107,33 +137,656 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
      * EmbFile reads something like (e.g.) this ungrammatical phrase
      * Entry: <acc> display type is either not supported or entry is not found.
      */
+    AlignmentI al = null;
+    List<SequenceI> seqs = new ArrayList<>();
     List<SequenceI> peptides = new ArrayList<>();
-    if (efile != null && efile.getEntries() != null)
+    if (entries != null)
     {
-      for (EmblEntry entry : efile.getEntries())
+      for (EntryType entry : entries)
       {
-        SequenceI seq = entry.getSequence(emprefx, peptides);
+        SequenceI seq = getSequence(emprefx, entry, peptides);
         if (seq != null)
         {
           seqs.add(seq.deriveSequence());
           // place DBReferences on dataset and refer
         }
       }
+      if (!seqs.isEmpty())
+      {
+        al = new Alignment(seqs.toArray(new SequenceI[seqs.size()]));
+      }
+      else
+      {
+        System.out.println(
+                "No record found for '" + emprefx + ":" + query + "'");
+      }
     }
 
-    AlignmentI al = null;
-    if (!seqs.isEmpty())
-    {
-      al = new Alignment(seqs.toArray(new SequenceI[seqs.size()]));
-    }
     stopQuery();
     return al;
   }
 
+  /**
+   * Reads the XML reply from file and unmarshals it to Java objects. Answers a
+   * (possibly empty) list of <code>EntryType</code> objects.
+   * 
+   * is
+   * 
+   * @return
+   */
+  List<EntryType> getEmblEntries(InputStream is)
+  {
+    List<EntryType> entries = new ArrayList<>();
+    try
+    {
+      JAXBContext jc = JAXBContext.newInstance("jalview.xml.binding.embl");
+      XMLStreamReader streamReader = XMLInputFactory.newInstance()
+              .createXMLStreamReader(is);
+      javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
+      jalview.xml.binding.embl.ROOT root = (jalview.xml.binding.embl.ROOT) um
+              .unmarshal(streamReader);
+
+      /*
+       * document root contains either "entry" or "entrySet"
+       */
+      if (root == null)
+      {
+        return entries;
+      }
+      if (root.getEntrySet() != null)
+      {
+        entries = root.getEntrySet().getEntry();
+      }
+      else if (root.getEntry() != null)
+      {
+        entries.add(root.getEntry());
+      }
+    } catch (JAXBException | XMLStreamException
+            | FactoryConfigurationError e)
+    {
+      e.printStackTrace();
+    }
+    return entries;
+  }
+
+  /**
+   * A helper method to parse XML data and construct a sequence, with any
+   * available database references and features
+   * 
+   * @param emprefx
+   * @param entry
+   * @param peptides
+   * @return
+   */
+  SequenceI getSequence(String sourceDb, EntryType entry,
+          List<SequenceI> peptides)
+  {
+    String seqString = entry.getSequence();
+    if (seqString == null)
+    {
+      return null;
+    }
+    seqString = seqString.replace(" ", "").replace("\n", "").replace("\t",
+            "");
+    String accession = entry.getAccession();
+    SequenceI dna = new Sequence(sourceDb + "|" + accession, seqString);
+
+    dna.setDescription(entry.getDescription());
+    String sequenceVersion = String.valueOf(entry.getVersion().intValue());
+    DBRefEntry selfRref = new DBRefEntry(sourceDb, sequenceVersion,
+            accession);
+    dna.addDBRef(selfRref);
+    selfRref.setMap(
+            new Mapping(null, new int[]
+            { 1, dna.getLength() }, new int[] { 1, dna.getLength() }, 1,
+                    1));
+
+    /*
+     * add db references
+     */
+    List<XrefType> dbRefs = entry.getXref();
+    if (dbRefs != null)
+    {
+      for (XrefType dbref : dbRefs)
+      {
+        String acc = dbref.getId();
+        String source = DBRefUtils.getCanonicalName(dbref.getDb());
+        String version = dbref.getSecondaryId();
+        dna.addDBRef(new DBRefEntry(source, version, acc));
+      }
+    }
+
+    SequenceIdMatcher matcher = new SequenceIdMatcher(peptides);
+    try
+    {
+      List<Feature> features = entry.getFeature();
+      if (features != null)
+      {
+        for (Feature feature : features)
+        {
+          if (FeatureProperties.isCodingFeature(sourceDb,
+                  feature.getName()))
+          {
+            parseCodingFeature(entry, feature, sourceDb, dna, peptides,
+                    matcher);
+          }
+        }
+      }
+    } catch (Exception e)
+    {
+      System.err.println("EMBL Record Features parsing error!");
+      System.err
+              .println("Please report the following to help@jalview.org :");
+      System.err.println("EMBL Record " + accession);
+      System.err.println("Resulted in exception: " + e.getMessage());
+      e.printStackTrace(System.err);
+    }
+
+    return dna;
+  }
+
+  /**
+   * Extracts coding region and product from a CDS feature and decorates it with
+   * annotations
+   * 
+   * @param entry
+   * @param feature
+   * @param sourceDb
+   * @param dna
+   * @param peptides
+   * @param matcher
+   */
+  void parseCodingFeature(EntryType entry, Feature feature, String sourceDb,
+          SequenceI dna, List<SequenceI> peptides,
+          SequenceIdMatcher matcher)
+  {
+    final boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS);
+    final String accession = entry.getAccession();
+    final String sequenceVersion = entry.getVersion().toString();
+
+    int[] exons = getCdsRanges(entry.getAccession(), feature);
+
+    String translation = null;
+    String proteinName = "";
+    String proteinId = null;
+    Map<String, String> vals = new Hashtable<>();
+
+    /*
+     * codon_start 1/2/3 in EMBL corresponds to phase 0/1/2 in CDS
+     * (phase is required for CDS features in GFF3 format)
+     */
+    int codonStart = 1;
+
+    /*
+     * parse qualifiers, saving protein translation, protein id,
+     * codon start position, product (name), and 'other values'
+     */
+    if (feature.getQualifier() != null)
+    {
+      for (Qualifier q : feature.getQualifier())
+      {
+        String qname = q.getName();
+        String value = q.getValue();
+        value = value == null ? ""
+                : value.trim().replace(" ", "").replace("\n", "")
+                        .replace("\t", "");
+        if (qname.equals("translation"))
+        {
+          translation = value;
+        }
+        else if (qname.equals("protein_id"))
+        {
+          proteinId = value;
+        }
+        else if (qname.equals("codon_start"))
+        {
+          try
+          {
+            codonStart = Integer.parseInt(value.trim());
+          } catch (NumberFormatException e)
+          {
+            System.err.println("Invalid codon_start in XML for "
+                    + entry.getAccession() + ": " + e.getMessage());
+          }
+        }
+        else if (qname.equals("product"))
+        {
+          // sometimes name is returned e.g. for V00488
+          proteinName = value;
+        }
+        else
+        {
+          // throw anything else into the additional properties hash
+          if (!"".equals(value))
+          {
+            vals.put(qname, value);
+          }
+        }
+      }
+    }
+
+    DBRefEntry proteinToEmblProteinRef = null;
+    exons = MappingUtils.removeStartPositions(codonStart - 1, exons);
+
+    SequenceI product = null;
+    Mapping dnaToProteinMapping = null;
+    if (translation != null && proteinName != null && proteinId != null)
+    {
+      int translationLength = translation.length();
+
+      /*
+       * look for product in peptides list, if not found, add it
+       */
+      product = matcher.findIdMatch(proteinId);
+      if (product == null)
+      {
+        product = new Sequence(proteinId, translation, 1,
+                translationLength);
+        product.setDescription(((proteinName.length() == 0)
+                ? "Protein Product from " + sourceDb
+                : proteinName));
+        peptides.add(product);
+        matcher.add(product);
+      }
+
+      // we have everything - create the mapping and perhaps the protein
+      // sequence
+      if (exons == null || exons.length == 0)
+      {
+        /*
+         * workaround until we handle dna location for CDS sequence
+         * e.g. location="X53828.1:60..1058" correctly
+         */
+        System.err.println(
+                "Implementation Notice: EMBLCDS records not properly supported yet - Making up the CDNA region of this sequence... may be incorrect ("
+                        + sourceDb + ":" + entry.getAccession() + ")");
+        int dnaLength = dna.getLength();
+        if (translationLength * 3 == (1 - codonStart + dnaLength))
+        {
+          System.err.println(
+                  "Not allowing for additional stop codon at end of cDNA fragment... !");
+          // this might occur for CDS sequences where no features are marked
+          exons = new int[] { dna.getStart() + (codonStart - 1),
+              dna.getEnd() };
+          dnaToProteinMapping = new Mapping(product, exons,
+                  new int[]
+                  { 1, translationLength }, 3, 1);
+        }
+        if ((translationLength + 1) * 3 == (1 - codonStart + dnaLength))
+        {
+          System.err.println(
+                  "Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!");
+          exons = new int[] { dna.getStart() + (codonStart - 1),
+              dna.getEnd() - 3 };
+          dnaToProteinMapping = new Mapping(product, exons,
+                  new int[]
+                  { 1, translationLength }, 3, 1);
+        }
+      }
+      else
+      {
+        // Trim the exon mapping if necessary - the given product may only be a
+        // fragment of a larger protein. (EMBL:AY043181 is an example)
+
+        if (isEmblCdna)
+        {
+          // TODO: Add a DbRef back to the parent EMBL sequence with the exon
+          // map
+          // if given a dataset reference, search dataset for parent EMBL
+          // sequence if it exists and set its map
+          // make a new feature annotating the coding contig
+        }
+        else
+        {
+          // final product length truncation check
+          int[] cdsRanges = adjustForProteinLength(translationLength,
+                  exons);
+          dnaToProteinMapping = new Mapping(product, cdsRanges,
+                  new int[]
+                  { 1, translationLength }, 3, 1);
+          if (product != null)
+          {
+            /*
+             * make xref with mapping from protein to EMBL dna
+             */
+            DBRefEntry proteinToEmblRef = new DBRefEntry(DBRefSource.EMBL,
+                    sequenceVersion, proteinId,
+                    new Mapping(dnaToProteinMapping.getMap().getInverse()));
+            product.addDBRef(proteinToEmblRef);
+
+            /*
+             * make xref from protein to EMBLCDS; we assume here that the 
+             * CDS sequence version is same as dna sequence (?!)
+             */
+            MapList proteinToCdsMapList = new MapList(
+                    new int[]
+                    { 1, translationLength },
+                    new int[]
+                    { 1 + (codonStart - 1),
+                        (codonStart - 1) + 3 * translationLength },
+                    1, 3);
+            DBRefEntry proteinToEmblCdsRef = new DBRefEntry(
+                    DBRefSource.EMBLCDS, sequenceVersion, proteinId,
+                    new Mapping(proteinToCdsMapList));
+            product.addDBRef(proteinToEmblCdsRef);
+
+            /*
+             * make 'direct' xref from protein to EMBLCDSPROTEIN
+             */
+            proteinToEmblProteinRef = new DBRefEntry(proteinToEmblCdsRef);
+            proteinToEmblProteinRef.setSource(DBRefSource.EMBLCDSProduct);
+            proteinToEmblProteinRef.setMap(null);
+            product.addDBRef(proteinToEmblProteinRef);
+          }
+        }
+      }
+
+      /*
+       * add cds features to dna sequence
+       */
+      String cds = feature.getName(); // "CDS"
+      for (int xint = 0; exons != null
+              && xint < exons.length - 1; xint += 2)
+      {
+        int exonStart = exons[xint];
+        int exonEnd = exons[xint + 1];
+        int begin = Math.min(exonStart, exonEnd);
+        int end = Math.max(exonStart, exonEnd);
+        int exonNumber = xint / 2 + 1;
+        String desc = String.format("Exon %d for protein '%s' EMBLCDS:%s",
+                exonNumber, proteinName, proteinId);
+
+        SequenceFeature sf = makeCdsFeature(cds, desc, begin, end, sourceDb,
+                vals);
+
+        sf.setEnaLocation(feature.getLocation());
+        boolean forwardStrand = exonStart <= exonEnd;
+        sf.setStrand(forwardStrand ? "+" : "-");
+        sf.setPhase(String.valueOf(codonStart - 1));
+        sf.setValue(FeatureProperties.EXONPOS, exonNumber);
+        sf.setValue(FeatureProperties.EXONPRODUCT, proteinName);
+
+        dna.addSequenceFeature(sf);
+      }
+    }
+
+    /*
+     * add feature dbRefs to sequence, and mappings for Uniprot xrefs
+     */
+    boolean hasUniprotDbref = false;
+    List<XrefType> xrefs = feature.getXref();
+    if (xrefs != null)
+    {
+      boolean mappingUsed = false;
+      for (XrefType xref : xrefs)
+      {
+        /*
+         * ensure UniProtKB/Swiss-Prot converted to UNIPROT
+         */
+        String source = DBRefUtils.getCanonicalName(xref.getDb());
+        DBRefEntry dbref = new DBRefEntry(source, xref.getSecondaryId(),
+                xref.getId());
+        DBRefEntry proteinDbRef = new DBRefEntry(dbref.getSource(),
+                dbref.getVersion(), dbref.getAccessionId());
+        if (source.equals(DBRefSource.UNIPROT))
+        {
+          String proteinSeqName = DBRefSource.UNIPROT + "|"
+                  + dbref.getAccessionId();
+          if (dnaToProteinMapping != null
+                  && dnaToProteinMapping.getTo() != null)
+          {
+            if (mappingUsed)
+            {
+              /*
+               * two or more Uniprot xrefs for the same CDS - 
+               * each needs a distinct Mapping (as to a different sequence)
+               */
+              dnaToProteinMapping = new Mapping(dnaToProteinMapping);
+            }
+            mappingUsed = true;
+
+            /*
+             * try to locate the protein mapped to (possibly by a 
+             * previous CDS feature); if not found, construct it from
+             * the EMBL translation
+             */
+            SequenceI proteinSeq = matcher.findIdMatch(proteinSeqName);
+            if (proteinSeq == null)
+            {
+              proteinSeq = new Sequence(proteinSeqName,
+                      product.getSequenceAsString());
+              matcher.add(proteinSeq);
+              peptides.add(proteinSeq);
+            }
+            dnaToProteinMapping.setTo(proteinSeq);
+            dnaToProteinMapping.setMappedFromId(proteinId);
+            proteinSeq.addDBRef(proteinDbRef);
+            dbref.setMap(dnaToProteinMapping);
+          }
+          hasUniprotDbref = true;
+        }
+        if (product != null)
+        {
+          /*
+           * copy feature dbref to our protein product
+           */
+          DBRefEntry pref = proteinDbRef;
+          pref.setMap(null); // reference is direct
+          product.addDBRef(pref);
+          // Add converse mapping reference
+          if (dnaToProteinMapping != null)
+          {
+            Mapping pmap = new Mapping(dna,
+                    dnaToProteinMapping.getMap().getInverse());
+            pref = new DBRefEntry(sourceDb, sequenceVersion, accession);
+            pref.setMap(pmap);
+            if (dnaToProteinMapping.getTo() != null)
+            {
+              dnaToProteinMapping.getTo().addDBRef(pref);
+            }
+          }
+        }
+        dna.addDBRef(dbref);
+      }
+    }
+
+    /*
+     * if we have a product (translation) but no explicit Uniprot dbref
+     * (example: EMBL AAFI02000057 protein_id EAL65544.1)
+     * then construct mappings to an assumed EMBLCDSPROTEIN accession
+     */
+    if (!hasUniprotDbref && product != null)
+    {
+      if (proteinToEmblProteinRef == null)
+      {
+        // assuming CDSPROTEIN sequence version = dna version (?!)
+        proteinToEmblProteinRef = new DBRefEntry(DBRefSource.EMBLCDSProduct,
+                sequenceVersion, proteinId);
+      }
+      product.addDBRef(proteinToEmblProteinRef);
+
+      if (dnaToProteinMapping != null
+              && dnaToProteinMapping.getTo() != null)
+      {
+        DBRefEntry dnaToEmblProteinRef = new DBRefEntry(
+                DBRefSource.EMBLCDSProduct, sequenceVersion,
+                proteinId);
+        dnaToEmblProteinRef.setMap(dnaToProteinMapping);
+        dnaToProteinMapping.setMappedFromId(proteinId);
+        dna.addDBRef(dnaToEmblProteinRef);
+      }
+    }
+  }
+
   @Override
   public boolean isDnaCoding()
   {
     return true;
   }
 
+  /**
+   * Returns the CDS positions as a single array of [start, end, start, end...]
+   * positions. If on the reverse strand, these will be in descending order.
+   * 
+   * @param accession
+   * @param feature
+   * @return
+   */
+  protected int[] getCdsRanges(String accession, Feature feature)
+  {
+    String location = feature.getLocation();
+    if (location == null)
+    {
+      return new int[] {};
+    }
+  
+    try
+    {
+      List<int[]> ranges = DnaUtils.parseLocation(location);
+      return listToArray(ranges);
+    } catch (ParseException e)
+    {
+      Cache.log.warn(
+              String.format("Not parsing inexact CDS location %s in ENA %s",
+                      location, accession));
+      return new int[] {};
+    }
+  }
+
+  /**
+   * Converts a list of [start, end] ranges to a single array of [start, end,
+   * start, end ...]
+   * 
+   * @param ranges
+   * @return
+   */
+  int[] listToArray(List<int[]> ranges)
+  {
+    int[] result = new int[ranges.size() * 2];
+    int i = 0;
+    for (int[] range : ranges)
+    {
+      result[i++] = range[0];
+      result[i++] = range[1];
+    }
+    return result;
+  }
+
+  /**
+   * Helper method to construct a SequenceFeature for one cds range
+   * 
+   * @param type
+   *          feature type ("CDS")
+   * @param desc
+   *          description
+   * @param begin
+   *          start position
+   * @param end
+   *          end position
+   * @param group
+   *          feature group
+   * @param vals
+   *          map of 'miscellaneous values' for feature
+   * @return
+   */
+  protected SequenceFeature makeCdsFeature(String type, String desc,
+          int begin, int end, String group, Map<String, String> vals)
+  {
+    SequenceFeature sf = new SequenceFeature(type, desc, begin, end, group);
+    if (!vals.isEmpty())
+    {
+      StringBuilder sb = new StringBuilder();
+      boolean first = true;
+      for (Entry<String, String> val : vals.entrySet())
+      {
+        if (!first)
+        {
+          sb.append(";");
+        }
+        sb.append(val.getKey()).append("=").append(val.getValue());
+        first = false;
+        sf.setValue(val.getKey(), val.getValue());
+      }
+      sf.setAttributes(sb.toString());
+    }
+    return sf;
+  }
+
+  /**
+   * Truncates (if necessary) the exon intervals to match 3 times the length of
+   * the protein; also accepts 3 bases longer (for stop codon not included in
+   * protein)
+   * 
+   * @param proteinLength
+   * @param exon
+   *          an array of [start, end, start, end...] intervals
+   * @return the same array (if unchanged) or a truncated copy
+   */
+  static int[] adjustForProteinLength(int proteinLength, int[] exon)
+  {
+    if (proteinLength <= 0 || exon == null)
+    {
+      return exon;
+    }
+    int expectedCdsLength = proteinLength * 3;
+    int exonLength = MappingUtils.getLength(Arrays.asList(exon));
+  
+    /*
+     * if exon length matches protein, or is shorter, or longer by the 
+     * length of a stop codon (3 bases), then leave it unchanged
+     */
+    if (expectedCdsLength >= exonLength
+            || expectedCdsLength == exonLength - 3)
+    {
+      return exon;
+    }
+  
+    int origxon[];
+    int sxpos = -1;
+    int endxon = 0;
+    origxon = new int[exon.length];
+    System.arraycopy(exon, 0, origxon, 0, exon.length);
+    int cdspos = 0;
+    for (int x = 0; x < exon.length; x += 2)
+    {
+      cdspos += Math.abs(exon[x + 1] - exon[x]) + 1;
+      if (expectedCdsLength <= cdspos)
+      {
+        // advanced beyond last codon.
+        sxpos = x;
+        if (expectedCdsLength != cdspos)
+        {
+          // System.err
+          // .println("Truncating final exon interval on region by "
+          // + (cdspos - cdslength));
+        }
+  
+        /*
+         * shrink the final exon - reduce end position if forward
+         * strand, increase it if reverse
+         */
+        if (exon[x + 1] >= exon[x])
+        {
+          endxon = exon[x + 1] - cdspos + expectedCdsLength;
+        }
+        else
+        {
+          endxon = exon[x + 1] + cdspos - expectedCdsLength;
+        }
+        break;
+      }
+    }
+  
+    if (sxpos != -1)
+    {
+      // and trim the exon interval set if necessary
+      int[] nxon = new int[sxpos + 2];
+      System.arraycopy(exon, 0, nxon, 0, sxpos + 2);
+      nxon[sxpos + 1] = endxon; // update the end boundary for the new exon
+                                // set
+      exon = nxon;
+    }
+    return exon;
+  }
+
 }
index 74a9ea4..86282c7 100644 (file)
@@ -186,7 +186,7 @@ public class Uniprot extends DbSourceProxyImpl
      */
     if (seqString.indexOf(' ') > -1)
     {
-      seqString = seqString.replaceAll(" ", "");
+      seqString = seqString.replace(" ", "");
     }
     SequenceI sequence = new Sequence(id,
             seqString);
diff --git a/src/jalview/xml/binding/embl/EntrySetType.java b/src/jalview/xml/binding/embl/EntrySetType.java
new file mode 100644 (file)
index 0000000..09947ec
--- /dev/null
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for EntrySetType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="EntrySetType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence maxOccurs="unbounded">
+ *         &lt;element name="entry" type="{}EntryType"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EntrySetType", propOrder = {
+    "entry"
+})
+public class EntrySetType {
+
+    @XmlElement(required = true)
+    protected List<EntryType> entry;
+
+    /**
+     * Gets the value of the entry property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the entry property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEntry().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EntryType }
+     * 
+     * 
+     */
+    public List<EntryType> getEntry() {
+        if (entry == null) {
+            entry = new ArrayList<EntryType>();
+        }
+        return this.entry;
+    }
+
+}
diff --git a/src/jalview/xml/binding/embl/EntryType.java b/src/jalview/xml/binding/embl/EntryType.java
new file mode 100644 (file)
index 0000000..8964a3f
--- /dev/null
@@ -0,0 +1,2680 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for EntryType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="EntryType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="secondaryAccession" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="projectAccession" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="comment" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="keyword" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="reference" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="author" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                   &lt;element name="applicant" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                   &lt;element name="consortium" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="submissionDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
+ *                   &lt;element name="journal" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="year" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="volume" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="issue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="firstPage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="lastPage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="comment" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="referenceLocation" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="type" use="required">
+ *                   &lt;simpleType>
+ *                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *                       &lt;enumeration value="submission"/>
+ *                       &lt;enumeration value="book"/>
+ *                       &lt;enumeration value="article"/>
+ *                       &lt;enumeration value="patent"/>
+ *                       &lt;enumeration value="thesis"/>
+ *                       &lt;enumeration value="unpublished"/>
+ *                     &lt;/restriction>
+ *                   &lt;/simpleType>
+ *                 &lt;/attribute>
+ *                 &lt;attribute name="number" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                 &lt;attribute name="location" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="feature" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="taxon" minOccurs="0">
+ *                     &lt;complexType>
+ *                       &lt;complexContent>
+ *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           &lt;sequence>
+ *                             &lt;element name="lineage" minOccurs="0">
+ *                               &lt;complexType>
+ *                                 &lt;complexContent>
+ *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     &lt;sequence>
+ *                                       &lt;element name="taxon" maxOccurs="unbounded">
+ *                                         &lt;complexType>
+ *                                           &lt;complexContent>
+ *                                             &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                             &lt;/restriction>
+ *                                           &lt;/complexContent>
+ *                                         &lt;/complexType>
+ *                                       &lt;/element>
+ *                                     &lt;/sequence>
+ *                                   &lt;/restriction>
+ *                                 &lt;/complexContent>
+ *                               &lt;/complexType>
+ *                             &lt;/element>
+ *                           &lt;/sequence>
+ *                           &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           &lt;attribute name="commonName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           &lt;attribute name="taxId" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                         &lt;/restriction>
+ *                       &lt;/complexContent>
+ *                     &lt;/complexType>
+ *                   &lt;/element>
+ *                   &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+ *                   &lt;element name="qualifier" maxOccurs="unbounded" minOccurs="0">
+ *                     &lt;complexType>
+ *                       &lt;complexContent>
+ *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           &lt;sequence>
+ *                             &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                           &lt;/sequence>
+ *                           &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         &lt;/restriction>
+ *                       &lt;/complexContent>
+ *                     &lt;/complexType>
+ *                   &lt;/element>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="location" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="assembly" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="range" maxOccurs="unbounded">
+ *                     &lt;complexType>
+ *                       &lt;complexContent>
+ *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                         &lt;/restriction>
+ *                       &lt;/complexContent>
+ *                     &lt;/complexType>
+ *                   &lt;/element>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="contig" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;choice maxOccurs="unbounded" minOccurs="0">
+ *                     &lt;element name="range">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                     &lt;element name="gap">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="unknownLength" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/choice>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="sequence" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       &lt;attribute name="entryVersion" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       &lt;attribute name="dataClass" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="taxonomicDivision" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="moleculeType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="sequenceLength" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       &lt;attribute name="topology" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="circular"/>
+ *             &lt;enumeration value="linear"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="firstPublic" type="{http://www.w3.org/2001/XMLSchema}date" />
+ *       &lt;attribute name="firstPublicRelease" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       &lt;attribute name="lastUpdated" type="{http://www.w3.org/2001/XMLSchema}date" />
+ *       &lt;attribute name="lastUpdatedRelease" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EntryType", propOrder = {
+    "secondaryAccession",
+    "projectAccession",
+    "description",
+    "comment",
+    "keyword",
+    "reference",
+    "xref",
+    "feature",
+    "assembly",
+    "contig",
+    "sequence"
+})
+public class EntryType {
+
+    protected List<String> secondaryAccession;
+    protected List<String> projectAccession;
+    @XmlElement(required = true)
+    protected String description;
+    protected String comment;
+    protected List<String> keyword;
+    protected List<EntryType.Reference> reference;
+    protected List<XrefType> xref;
+    protected List<EntryType.Feature> feature;
+    protected EntryType.Assembly assembly;
+    protected EntryType.Contig contig;
+    protected String sequence;
+    @XmlAttribute(name = "accession", required = true)
+    protected String accession;
+    @XmlAttribute(name = "version", required = true)
+    protected BigInteger version;
+    @XmlAttribute(name = "entryVersion")
+    protected BigInteger entryVersion;
+    @XmlAttribute(name = "dataClass", required = true)
+    protected String dataClass;
+    @XmlAttribute(name = "taxonomicDivision", required = true)
+    protected String taxonomicDivision;
+    @XmlAttribute(name = "moleculeType", required = true)
+    protected String moleculeType;
+    @XmlAttribute(name = "sequenceLength", required = true)
+    protected BigInteger sequenceLength;
+    @XmlAttribute(name = "topology", required = true)
+    protected String topology;
+    @XmlAttribute(name = "firstPublic")
+    @XmlSchemaType(name = "date")
+    protected XMLGregorianCalendar firstPublic;
+    @XmlAttribute(name = "firstPublicRelease")
+    protected BigInteger firstPublicRelease;
+    @XmlAttribute(name = "lastUpdated")
+    @XmlSchemaType(name = "date")
+    protected XMLGregorianCalendar lastUpdated;
+    @XmlAttribute(name = "lastUpdatedRelease")
+    protected BigInteger lastUpdatedRelease;
+
+    /**
+     * Gets the value of the secondaryAccession property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the secondaryAccession property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSecondaryAccession().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getSecondaryAccession() {
+        if (secondaryAccession == null) {
+            secondaryAccession = new ArrayList<String>();
+        }
+        return this.secondaryAccession;
+    }
+
+    /**
+     * Gets the value of the projectAccession property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the projectAccession property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getProjectAccession().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getProjectAccession() {
+        if (projectAccession == null) {
+            projectAccession = new ArrayList<String>();
+        }
+        return this.projectAccession;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+    /**
+     * Gets the value of the comment property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getComment() {
+        return comment;
+    }
+
+    /**
+     * Sets the value of the comment property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setComment(String value) {
+        this.comment = value;
+    }
+
+    /**
+     * Gets the value of the keyword property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the keyword property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getKeyword().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getKeyword() {
+        if (keyword == null) {
+            keyword = new ArrayList<String>();
+        }
+        return this.keyword;
+    }
+
+    /**
+     * Gets the value of the reference property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the reference property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getReference().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EntryType.Reference }
+     * 
+     * 
+     */
+    public List<EntryType.Reference> getReference() {
+        if (reference == null) {
+            reference = new ArrayList<EntryType.Reference>();
+        }
+        return this.reference;
+    }
+
+    /**
+     * Gets the value of the xref property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the xref property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getXref().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link XrefType }
+     * 
+     * 
+     */
+    public List<XrefType> getXref() {
+        if (xref == null) {
+            xref = new ArrayList<XrefType>();
+        }
+        return this.xref;
+    }
+
+    /**
+     * Gets the value of the feature property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the feature property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getFeature().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EntryType.Feature }
+     * 
+     * 
+     */
+    public List<EntryType.Feature> getFeature() {
+        if (feature == null) {
+            feature = new ArrayList<EntryType.Feature>();
+        }
+        return this.feature;
+    }
+
+    /**
+     * Gets the value of the assembly property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EntryType.Assembly }
+     *     
+     */
+    public EntryType.Assembly getAssembly() {
+        return assembly;
+    }
+
+    /**
+     * Sets the value of the assembly property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EntryType.Assembly }
+     *     
+     */
+    public void setAssembly(EntryType.Assembly value) {
+        this.assembly = value;
+    }
+
+    /**
+     * Gets the value of the contig property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EntryType.Contig }
+     *     
+     */
+    public EntryType.Contig getContig() {
+        return contig;
+    }
+
+    /**
+     * Sets the value of the contig property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EntryType.Contig }
+     *     
+     */
+    public void setContig(EntryType.Contig value) {
+        this.contig = value;
+    }
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSequence(String value) {
+        this.sequence = value;
+    }
+
+    /**
+     * Gets the value of the accession property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAccession() {
+        return accession;
+    }
+
+    /**
+     * Sets the value of the accession property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAccession(String value) {
+        this.accession = value;
+    }
+
+    /**
+     * Gets the value of the version property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setVersion(BigInteger value) {
+        this.version = value;
+    }
+
+    /**
+     * Gets the value of the entryVersion property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getEntryVersion() {
+        return entryVersion;
+    }
+
+    /**
+     * Sets the value of the entryVersion property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setEntryVersion(BigInteger value) {
+        this.entryVersion = value;
+    }
+
+    /**
+     * Gets the value of the dataClass property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDataClass() {
+        return dataClass;
+    }
+
+    /**
+     * Sets the value of the dataClass property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDataClass(String value) {
+        this.dataClass = value;
+    }
+
+    /**
+     * Gets the value of the taxonomicDivision property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTaxonomicDivision() {
+        return taxonomicDivision;
+    }
+
+    /**
+     * Sets the value of the taxonomicDivision property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTaxonomicDivision(String value) {
+        this.taxonomicDivision = value;
+    }
+
+    /**
+     * Gets the value of the moleculeType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getMoleculeType() {
+        return moleculeType;
+    }
+
+    /**
+     * Sets the value of the moleculeType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setMoleculeType(String value) {
+        this.moleculeType = value;
+    }
+
+    /**
+     * Gets the value of the sequenceLength property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getSequenceLength() {
+        return sequenceLength;
+    }
+
+    /**
+     * Sets the value of the sequenceLength property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setSequenceLength(BigInteger value) {
+        this.sequenceLength = value;
+    }
+
+    /**
+     * Gets the value of the topology property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTopology() {
+        return topology;
+    }
+
+    /**
+     * Sets the value of the topology property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTopology(String value) {
+        this.topology = value;
+    }
+
+    /**
+     * Gets the value of the firstPublic property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getFirstPublic() {
+        return firstPublic;
+    }
+
+    /**
+     * Sets the value of the firstPublic property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setFirstPublic(XMLGregorianCalendar value) {
+        this.firstPublic = value;
+    }
+
+    /**
+     * Gets the value of the firstPublicRelease property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getFirstPublicRelease() {
+        return firstPublicRelease;
+    }
+
+    /**
+     * Sets the value of the firstPublicRelease property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setFirstPublicRelease(BigInteger value) {
+        this.firstPublicRelease = value;
+    }
+
+    /**
+     * Gets the value of the lastUpdated property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getLastUpdated() {
+        return lastUpdated;
+    }
+
+    /**
+     * Sets the value of the lastUpdated property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setLastUpdated(XMLGregorianCalendar value) {
+        this.lastUpdated = value;
+    }
+
+    /**
+     * Gets the value of the lastUpdatedRelease property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getLastUpdatedRelease() {
+        return lastUpdatedRelease;
+    }
+
+    /**
+     * Sets the value of the lastUpdatedRelease property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setLastUpdatedRelease(BigInteger value) {
+        this.lastUpdatedRelease = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="range" maxOccurs="unbounded">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "range"
+    })
+    public static class Assembly {
+
+        @XmlElement(required = true)
+        protected List<EntryType.Assembly.Range> range;
+
+        /**
+         * Gets the value of the range property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the range property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getRange().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EntryType.Assembly.Range }
+         * 
+         * 
+         */
+        public List<EntryType.Assembly.Range> getRange() {
+            if (range == null) {
+                range = new ArrayList<EntryType.Assembly.Range>();
+            }
+            return this.range;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Range {
+
+            @XmlAttribute(name = "begin", required = true)
+            protected BigInteger begin;
+            @XmlAttribute(name = "end", required = true)
+            protected BigInteger end;
+            @XmlAttribute(name = "primaryBegin")
+            protected BigInteger primaryBegin;
+            @XmlAttribute(name = "primaryEnd")
+            protected BigInteger primaryEnd;
+            @XmlAttribute(name = "accession", required = true)
+            protected String accession;
+            @XmlAttribute(name = "version", required = true)
+            protected BigInteger version;
+            @XmlAttribute(name = "complement")
+            protected Boolean complement;
+
+            /**
+             * Gets the value of the begin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getBegin() {
+                return begin;
+            }
+
+            /**
+             * Sets the value of the begin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setBegin(BigInteger value) {
+                this.begin = value;
+            }
+
+            /**
+             * Gets the value of the end property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getEnd() {
+                return end;
+            }
+
+            /**
+             * Sets the value of the end property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setEnd(BigInteger value) {
+                this.end = value;
+            }
+
+            /**
+             * Gets the value of the primaryBegin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getPrimaryBegin() {
+                return primaryBegin;
+            }
+
+            /**
+             * Sets the value of the primaryBegin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setPrimaryBegin(BigInteger value) {
+                this.primaryBegin = value;
+            }
+
+            /**
+             * Gets the value of the primaryEnd property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getPrimaryEnd() {
+                return primaryEnd;
+            }
+
+            /**
+             * Sets the value of the primaryEnd property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setPrimaryEnd(BigInteger value) {
+                this.primaryEnd = value;
+            }
+
+            /**
+             * Gets the value of the accession property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getAccession() {
+                return accession;
+            }
+
+            /**
+             * Sets the value of the accession property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setAccession(String value) {
+                this.accession = value;
+            }
+
+            /**
+             * Gets the value of the version property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getVersion() {
+                return version;
+            }
+
+            /**
+             * Sets the value of the version property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setVersion(BigInteger value) {
+                this.version = value;
+            }
+
+            /**
+             * Gets the value of the complement property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public boolean isComplement() {
+                if (complement == null) {
+                    return false;
+                } else {
+                    return complement;
+                }
+            }
+
+            /**
+             * Sets the value of the complement property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setComplement(Boolean value) {
+                this.complement = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;choice maxOccurs="unbounded" minOccurs="0">
+     *           &lt;element name="range">
+     *             &lt;complexType>
+     *               &lt;complexContent>
+     *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                   &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                   &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *                 &lt;/restriction>
+     *               &lt;/complexContent>
+     *             &lt;/complexType>
+     *           &lt;/element>
+     *           &lt;element name="gap">
+     *             &lt;complexType>
+     *               &lt;complexContent>
+     *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                   &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="unknownLength" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *                 &lt;/restriction>
+     *               &lt;/complexContent>
+     *             &lt;/complexType>
+     *           &lt;/element>
+     *         &lt;/choice>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "rangeOrGap"
+    })
+    public static class Contig {
+
+        @XmlElements({
+            @XmlElement(name = "range", type = EntryType.Contig.Range.class),
+            @XmlElement(name = "gap", type = EntryType.Contig.Gap.class)
+        })
+        protected List<Object> rangeOrGap;
+
+        /**
+         * Gets the value of the rangeOrGap property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the rangeOrGap property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getRangeOrGap().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EntryType.Contig.Range }
+         * {@link EntryType.Contig.Gap }
+         * 
+         * 
+         */
+        public List<Object> getRangeOrGap() {
+            if (rangeOrGap == null) {
+                rangeOrGap = new ArrayList<Object>();
+            }
+            return this.rangeOrGap;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="unknownLength" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Gap {
+
+            @XmlAttribute(name = "begin", required = true)
+            protected BigInteger begin;
+            @XmlAttribute(name = "end", required = true)
+            protected BigInteger end;
+            @XmlAttribute(name = "length", required = true)
+            protected BigInteger length;
+            @XmlAttribute(name = "unknownLength")
+            protected Boolean unknownLength;
+
+            /**
+             * Gets the value of the begin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getBegin() {
+                return begin;
+            }
+
+            /**
+             * Sets the value of the begin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setBegin(BigInteger value) {
+                this.begin = value;
+            }
+
+            /**
+             * Gets the value of the end property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getEnd() {
+                return end;
+            }
+
+            /**
+             * Sets the value of the end property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setEnd(BigInteger value) {
+                this.end = value;
+            }
+
+            /**
+             * Gets the value of the length property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getLength() {
+                return length;
+            }
+
+            /**
+             * Sets the value of the length property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setLength(BigInteger value) {
+                this.length = value;
+            }
+
+            /**
+             * Gets the value of the unknownLength property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public boolean isUnknownLength() {
+                if (unknownLength == null) {
+                    return false;
+                } else {
+                    return unknownLength;
+                }
+            }
+
+            /**
+             * Sets the value of the unknownLength property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setUnknownLength(Boolean value) {
+                this.unknownLength = value;
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Range {
+
+            @XmlAttribute(name = "begin", required = true)
+            protected BigInteger begin;
+            @XmlAttribute(name = "end", required = true)
+            protected BigInteger end;
+            @XmlAttribute(name = "primaryBegin")
+            protected BigInteger primaryBegin;
+            @XmlAttribute(name = "primaryEnd")
+            protected BigInteger primaryEnd;
+            @XmlAttribute(name = "accession", required = true)
+            protected String accession;
+            @XmlAttribute(name = "version", required = true)
+            protected BigInteger version;
+            @XmlAttribute(name = "complement")
+            protected Boolean complement;
+
+            /**
+             * Gets the value of the begin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getBegin() {
+                return begin;
+            }
+
+            /**
+             * Sets the value of the begin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setBegin(BigInteger value) {
+                this.begin = value;
+            }
+
+            /**
+             * Gets the value of the end property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getEnd() {
+                return end;
+            }
+
+            /**
+             * Sets the value of the end property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setEnd(BigInteger value) {
+                this.end = value;
+            }
+
+            /**
+             * Gets the value of the primaryBegin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getPrimaryBegin() {
+                return primaryBegin;
+            }
+
+            /**
+             * Sets the value of the primaryBegin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setPrimaryBegin(BigInteger value) {
+                this.primaryBegin = value;
+            }
+
+            /**
+             * Gets the value of the primaryEnd property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getPrimaryEnd() {
+                return primaryEnd;
+            }
+
+            /**
+             * Sets the value of the primaryEnd property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setPrimaryEnd(BigInteger value) {
+                this.primaryEnd = value;
+            }
+
+            /**
+             * Gets the value of the accession property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getAccession() {
+                return accession;
+            }
+
+            /**
+             * Sets the value of the accession property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setAccession(String value) {
+                this.accession = value;
+            }
+
+            /**
+             * Gets the value of the version property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getVersion() {
+                return version;
+            }
+
+            /**
+             * Sets the value of the version property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setVersion(BigInteger value) {
+                this.version = value;
+            }
+
+            /**
+             * Gets the value of the complement property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public boolean isComplement() {
+                if (complement == null) {
+                    return false;
+                } else {
+                    return complement;
+                }
+            }
+
+            /**
+             * Sets the value of the complement property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setComplement(Boolean value) {
+                this.complement = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="taxon" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;sequence>
+     *                   &lt;element name="lineage" minOccurs="0">
+     *                     &lt;complexType>
+     *                       &lt;complexContent>
+     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           &lt;sequence>
+     *                             &lt;element name="taxon" maxOccurs="unbounded">
+     *                               &lt;complexType>
+     *                                 &lt;complexContent>
+     *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                                   &lt;/restriction>
+     *                                 &lt;/complexContent>
+     *                               &lt;/complexType>
+     *                             &lt;/element>
+     *                           &lt;/sequence>
+     *                         &lt;/restriction>
+     *                       &lt;/complexContent>
+     *                     &lt;/complexType>
+     *                   &lt;/element>
+     *                 &lt;/sequence>
+     *                 &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="commonName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="taxId" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *         &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="qualifier" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;sequence>
+     *                   &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                 &lt;/sequence>
+     *                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="location" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "taxon",
+        "xref",
+        "qualifier"
+    })
+    public static class Feature {
+
+        protected EntryType.Feature.FeatureTaxon taxon;
+        protected List<XrefType> xref;
+        protected List<EntryType.Feature.Qualifier> qualifier;
+        @XmlAttribute(name = "name", required = true)
+        protected String name;
+        @XmlAttribute(name = "location", required = true)
+        protected String location;
+
+        /**
+         * Gets the value of the taxon property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EntryType.Feature.FeatureTaxon }
+         *     
+         */
+        public EntryType.Feature.FeatureTaxon getTaxon() {
+            return taxon;
+        }
+
+        /**
+         * Sets the value of the taxon property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EntryType.Feature.FeatureTaxon }
+         *     
+         */
+        public void setTaxon(EntryType.Feature.FeatureTaxon value) {
+            this.taxon = value;
+        }
+
+        /**
+         * Gets the value of the xref property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the xref property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getXref().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link XrefType }
+         * 
+         * 
+         */
+        public List<XrefType> getXref() {
+            if (xref == null) {
+                xref = new ArrayList<XrefType>();
+            }
+            return this.xref;
+        }
+
+        /**
+         * Gets the value of the qualifier property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the qualifier property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getQualifier().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EntryType.Feature.Qualifier }
+         * 
+         * 
+         */
+        public List<EntryType.Feature.Qualifier> getQualifier() {
+            if (qualifier == null) {
+                qualifier = new ArrayList<EntryType.Feature.Qualifier>();
+            }
+            return this.qualifier;
+        }
+
+        /**
+         * Gets the value of the name property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the value of the name property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setName(String value) {
+            this.name = value;
+        }
+
+        /**
+         * Gets the value of the location property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getLocation() {
+            return location;
+        }
+
+        /**
+         * Sets the value of the location property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setLocation(String value) {
+            this.location = value;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;sequence>
+         *         &lt;element name="lineage" minOccurs="0">
+         *           &lt;complexType>
+         *             &lt;complexContent>
+         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 &lt;sequence>
+         *                   &lt;element name="taxon" maxOccurs="unbounded">
+         *                     &lt;complexType>
+         *                       &lt;complexContent>
+         *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                         &lt;/restriction>
+         *                       &lt;/complexContent>
+         *                     &lt;/complexType>
+         *                   &lt;/element>
+         *                 &lt;/sequence>
+         *               &lt;/restriction>
+         *             &lt;/complexContent>
+         *           &lt;/complexType>
+         *         &lt;/element>
+         *       &lt;/sequence>
+         *       &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="commonName" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="taxId" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "lineage"
+        })
+        public static class FeatureTaxon {
+
+            protected EntryType.Feature.FeatureTaxon.Lineage lineage;
+            @XmlAttribute(name = "scientificName", required = true)
+            protected String scientificName;
+            @XmlAttribute(name = "commonName")
+            protected String commonName;
+            @XmlAttribute(name = "taxId")
+            protected BigInteger taxId;
+
+            /**
+             * Gets the value of the lineage property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link EntryType.Feature.FeatureTaxon.Lineage }
+             *     
+             */
+            public EntryType.Feature.FeatureTaxon.Lineage getLineage() {
+                return lineage;
+            }
+
+            /**
+             * Sets the value of the lineage property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link EntryType.Feature.FeatureTaxon.Lineage }
+             *     
+             */
+            public void setLineage(EntryType.Feature.FeatureTaxon.Lineage value) {
+                this.lineage = value;
+            }
+
+            /**
+             * Gets the value of the scientificName property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getScientificName() {
+                return scientificName;
+            }
+
+            /**
+             * Sets the value of the scientificName property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setScientificName(String value) {
+                this.scientificName = value;
+            }
+
+            /**
+             * Gets the value of the commonName property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getCommonName() {
+                return commonName;
+            }
+
+            /**
+             * Sets the value of the commonName property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setCommonName(String value) {
+                this.commonName = value;
+            }
+
+            /**
+             * Gets the value of the taxId property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getTaxId() {
+                return taxId;
+            }
+
+            /**
+             * Sets the value of the taxId property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setTaxId(BigInteger value) {
+                this.taxId = value;
+            }
+
+
+            /**
+             * <p>Java class for anonymous complex type.
+             * 
+             * <p>The following schema fragment specifies the expected content contained within this class.
+             * 
+             * <pre>
+             * &lt;complexType>
+             *   &lt;complexContent>
+             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       &lt;sequence>
+             *         &lt;element name="taxon" maxOccurs="unbounded">
+             *           &lt;complexType>
+             *             &lt;complexContent>
+             *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *               &lt;/restriction>
+             *             &lt;/complexContent>
+             *           &lt;/complexType>
+             *         &lt;/element>
+             *       &lt;/sequence>
+             *     &lt;/restriction>
+             *   &lt;/complexContent>
+             * &lt;/complexType>
+             * </pre>
+             * 
+             * 
+             */
+            @XmlAccessorType(XmlAccessType.FIELD)
+            @XmlType(name = "", propOrder = {
+                "taxon"
+            })
+            public static class Lineage {
+
+                @XmlElement(required = true)
+                protected List<EntryType.Feature.FeatureTaxon.Lineage.Taxon> taxon;
+
+                /**
+                 * Gets the value of the taxon property.
+                 * 
+                 * <p>
+                 * This accessor method returns a reference to the live list,
+                 * not a snapshot. Therefore any modification you make to the
+                 * returned list will be present inside the JAXB object.
+                 * This is why there is not a <CODE>set</CODE> method for the taxon property.
+                 * 
+                 * <p>
+                 * For example, to add a new item, do as follows:
+                 * <pre>
+                 *    getTaxon().add(newItem);
+                 * </pre>
+                 * 
+                 * 
+                 * <p>
+                 * Objects of the following type(s) are allowed in the list
+                 * {@link EntryType.Feature.FeatureTaxon.Lineage.Taxon }
+                 * 
+                 * 
+                 */
+                public List<EntryType.Feature.FeatureTaxon.Lineage.Taxon> getTaxon() {
+                    if (taxon == null) {
+                        taxon = new ArrayList<EntryType.Feature.FeatureTaxon.Lineage.Taxon>();
+                    }
+                    return this.taxon;
+                }
+
+
+                /**
+                 * <p>Java class for anonymous complex type.
+                 * 
+                 * <p>The following schema fragment specifies the expected content contained within this class.
+                 * 
+                 * <pre>
+                 * &lt;complexType>
+                 *   &lt;complexContent>
+                 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+                 *     &lt;/restriction>
+                 *   &lt;/complexContent>
+                 * &lt;/complexType>
+                 * </pre>
+                 * 
+                 * 
+                 */
+                @XmlAccessorType(XmlAccessType.FIELD)
+                @XmlType(name = "")
+                public static class Taxon {
+
+                    @XmlAttribute(name = "scientificName", required = true)
+                    protected String scientificName;
+
+                    /**
+                     * Gets the value of the scientificName property.
+                     * 
+                     * @return
+                     *     possible object is
+                     *     {@link String }
+                     *     
+                     */
+                    public String getScientificName() {
+                        return scientificName;
+                    }
+
+                    /**
+                     * Sets the value of the scientificName property.
+                     * 
+                     * @param value
+                     *     allowed object is
+                     *     {@link String }
+                     *     
+                     */
+                    public void setScientificName(String value) {
+                        this.scientificName = value;
+                    }
+
+                }
+
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;sequence>
+         *         &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *       &lt;/sequence>
+         *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "value"
+        })
+        public static class Qualifier {
+
+            protected String value;
+            @XmlAttribute(name = "name", required = true)
+            protected String name;
+
+            /**
+             * Gets the value of the value property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getValue() {
+                return value;
+            }
+
+            /**
+             * Sets the value of the value property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setValue(String value) {
+                this.value = value;
+            }
+
+            /**
+             * Gets the value of the name property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getName() {
+                return name;
+            }
+
+            /**
+             * Sets the value of the name property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setName(String value) {
+                this.name = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="author" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="applicant" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="consortium" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="submissionDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
+     *         &lt;element name="journal" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="year" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="volume" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="issue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="firstPage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="lastPage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="comment" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="referenceLocation" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="type" use="required">
+     *         &lt;simpleType>
+     *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+     *             &lt;enumeration value="submission"/>
+     *             &lt;enumeration value="book"/>
+     *             &lt;enumeration value="article"/>
+     *             &lt;enumeration value="patent"/>
+     *             &lt;enumeration value="thesis"/>
+     *             &lt;enumeration value="unpublished"/>
+     *           &lt;/restriction>
+     *         &lt;/simpleType>
+     *       &lt;/attribute>
+     *       &lt;attribute name="number" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *       &lt;attribute name="location" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "title",
+        "author",
+        "applicant",
+        "consortium",
+        "submissionDate",
+        "journal",
+        "year",
+        "volume",
+        "issue",
+        "firstPage",
+        "lastPage",
+        "comment",
+        "referenceLocation",
+        "xref"
+    })
+    public static class Reference {
+
+        protected String title;
+        protected List<String> author;
+        protected List<String> applicant;
+        protected String consortium;
+        @XmlSchemaType(name = "date")
+        protected XMLGregorianCalendar submissionDate;
+        protected String journal;
+        protected String year;
+        protected String volume;
+        protected String issue;
+        protected String firstPage;
+        protected String lastPage;
+        protected String comment;
+        protected String referenceLocation;
+        protected List<XrefType> xref;
+        @XmlAttribute(name = "type", required = true)
+        protected String type;
+        @XmlAttribute(name = "number", required = true)
+        protected BigInteger number;
+        @XmlAttribute(name = "location")
+        protected String location;
+
+        /**
+         * Gets the value of the title property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getTitle() {
+            return title;
+        }
+
+        /**
+         * Sets the value of the title property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setTitle(String value) {
+            this.title = value;
+        }
+
+        /**
+         * Gets the value of the author property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the author property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getAuthor().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link String }
+         * 
+         * 
+         */
+        public List<String> getAuthor() {
+            if (author == null) {
+                author = new ArrayList<String>();
+            }
+            return this.author;
+        }
+
+        /**
+         * Gets the value of the applicant property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the applicant property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getApplicant().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link String }
+         * 
+         * 
+         */
+        public List<String> getApplicant() {
+            if (applicant == null) {
+                applicant = new ArrayList<String>();
+            }
+            return this.applicant;
+        }
+
+        /**
+         * Gets the value of the consortium property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getConsortium() {
+            return consortium;
+        }
+
+        /**
+         * Sets the value of the consortium property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setConsortium(String value) {
+            this.consortium = value;
+        }
+
+        /**
+         * Gets the value of the submissionDate property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link XMLGregorianCalendar }
+         *     
+         */
+        public XMLGregorianCalendar getSubmissionDate() {
+            return submissionDate;
+        }
+
+        /**
+         * Sets the value of the submissionDate property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link XMLGregorianCalendar }
+         *     
+         */
+        public void setSubmissionDate(XMLGregorianCalendar value) {
+            this.submissionDate = value;
+        }
+
+        /**
+         * Gets the value of the journal property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getJournal() {
+            return journal;
+        }
+
+        /**
+         * Sets the value of the journal property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setJournal(String value) {
+            this.journal = value;
+        }
+
+        /**
+         * Gets the value of the year property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getYear() {
+            return year;
+        }
+
+        /**
+         * Sets the value of the year property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setYear(String value) {
+            this.year = value;
+        }
+
+        /**
+         * Gets the value of the volume property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getVolume() {
+            return volume;
+        }
+
+        /**
+         * Sets the value of the volume property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setVolume(String value) {
+            this.volume = value;
+        }
+
+        /**
+         * Gets the value of the issue property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getIssue() {
+            return issue;
+        }
+
+        /**
+         * Sets the value of the issue property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setIssue(String value) {
+            this.issue = value;
+        }
+
+        /**
+         * Gets the value of the firstPage property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getFirstPage() {
+            return firstPage;
+        }
+
+        /**
+         * Sets the value of the firstPage property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setFirstPage(String value) {
+            this.firstPage = value;
+        }
+
+        /**
+         * Gets the value of the lastPage property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getLastPage() {
+            return lastPage;
+        }
+
+        /**
+         * Sets the value of the lastPage property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setLastPage(String value) {
+            this.lastPage = value;
+        }
+
+        /**
+         * Gets the value of the comment property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getComment() {
+            return comment;
+        }
+
+        /**
+         * Sets the value of the comment property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setComment(String value) {
+            this.comment = value;
+        }
+
+        /**
+         * Gets the value of the referenceLocation property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getReferenceLocation() {
+            return referenceLocation;
+        }
+
+        /**
+         * Sets the value of the referenceLocation property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setReferenceLocation(String value) {
+            this.referenceLocation = value;
+        }
+
+        /**
+         * Gets the value of the xref property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the xref property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getXref().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link XrefType }
+         * 
+         * 
+         */
+        public List<XrefType> getXref() {
+            if (xref == null) {
+                xref = new ArrayList<XrefType>();
+            }
+            return this.xref;
+        }
+
+        /**
+         * Gets the value of the type property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getType() {
+            return type;
+        }
+
+        /**
+         * Sets the value of the type property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setType(String value) {
+            this.type = value;
+        }
+
+        /**
+         * Gets the value of the number property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link BigInteger }
+         *     
+         */
+        public BigInteger getNumber() {
+            return number;
+        }
+
+        /**
+         * Sets the value of the number property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link BigInteger }
+         *     
+         */
+        public void setNumber(BigInteger value) {
+            this.number = value;
+        }
+
+        /**
+         * Gets the value of the location property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getLocation() {
+            return location;
+        }
+
+        /**
+         * Sets the value of the location property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setLocation(String value) {
+            this.location = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/embl/ObjectFactory.java b/src/jalview/xml/binding/embl/ObjectFactory.java
new file mode 100644 (file)
index 0000000..d5629ca
--- /dev/null
@@ -0,0 +1,159 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the jalview.xml.binding.embl package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: jalview.xml.binding.embl
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link EntryType }
+     * 
+     */
+    public EntryType createEntryType() {
+        return new EntryType();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Contig }
+     * 
+     */
+    public EntryType.Contig createEntryTypeContig() {
+        return new EntryType.Contig();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Assembly }
+     * 
+     */
+    public EntryType.Assembly createEntryTypeAssembly() {
+        return new EntryType.Assembly();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature }
+     * 
+     */
+    public EntryType.Feature createEntryTypeFeature() {
+        return new EntryType.Feature();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature.FeatureTaxon }
+     * 
+     */
+    public EntryType.Feature.FeatureTaxon createEntryTypeFeatureFeatureTaxon() {
+        return new EntryType.Feature.FeatureTaxon();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature.FeatureTaxon.Lineage }
+     * 
+     */
+    public EntryType.Feature.FeatureTaxon.Lineage createEntryTypeFeatureFeatureTaxonLineage() {
+        return new EntryType.Feature.FeatureTaxon.Lineage();
+    }
+
+    /**
+     * Create an instance of {@link ROOT }
+     * 
+     */
+    public ROOT createROOT() {
+        return new ROOT();
+    }
+
+    /**
+     * Create an instance of {@link EntrySetType }
+     * 
+     */
+    public EntrySetType createEntrySetType() {
+        return new EntrySetType();
+    }
+
+    /**
+     * Create an instance of {@link XrefType }
+     * 
+     */
+    public XrefType createXrefType() {
+        return new XrefType();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Reference }
+     * 
+     */
+    public EntryType.Reference createEntryTypeReference() {
+        return new EntryType.Reference();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Contig.Range }
+     * 
+     */
+    public EntryType.Contig.Range createEntryTypeContigRange() {
+        return new EntryType.Contig.Range();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Contig.Gap }
+     * 
+     */
+    public EntryType.Contig.Gap createEntryTypeContigGap() {
+        return new EntryType.Contig.Gap();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Assembly.Range }
+     * 
+     */
+    public EntryType.Assembly.Range createEntryTypeAssemblyRange() {
+        return new EntryType.Assembly.Range();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature.Qualifier }
+     * 
+     */
+    public EntryType.Feature.Qualifier createEntryTypeFeatureQualifier() {
+        return new EntryType.Feature.Qualifier();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature.FeatureTaxon.Lineage.Taxon }
+     * 
+     */
+    public EntryType.Feature.FeatureTaxon.Lineage.Taxon createEntryTypeFeatureFeatureTaxonLineageTaxon() {
+        return new EntryType.Feature.FeatureTaxon.Lineage.Taxon();
+    }
+
+}
diff --git a/src/jalview/xml/binding/embl/ROOT.java b/src/jalview/xml/binding/embl/ROOT.java
new file mode 100644 (file)
index 0000000..f7f522d
--- /dev/null
@@ -0,0 +1,96 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;choice>
+ *         &lt;element name="entrySet" type="{}EntrySetType"/>
+ *         &lt;element name="entry" type="{}EntryType"/>
+ *       &lt;/choice>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "entrySet",
+    "entry"
+})
+@XmlRootElement(name = "ROOT")
+public class ROOT {
+
+    protected EntrySetType entrySet;
+    protected EntryType entry;
+
+    /**
+     * Gets the value of the entrySet property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EntrySetType }
+     *     
+     */
+    public EntrySetType getEntrySet() {
+        return entrySet;
+    }
+
+    /**
+     * Sets the value of the entrySet property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EntrySetType }
+     *     
+     */
+    public void setEntrySet(EntrySetType value) {
+        this.entrySet = value;
+    }
+
+    /**
+     * Gets the value of the entry property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EntryType }
+     *     
+     */
+    public EntryType getEntry() {
+        return entry;
+    }
+
+    /**
+     * Sets the value of the entry property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EntryType }
+     *     
+     */
+    public void setEntry(EntryType value) {
+        this.entry = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/embl/XrefType.java b/src/jalview/xml/binding/embl/XrefType.java
new file mode 100644 (file)
index 0000000..9608b79
--- /dev/null
@@ -0,0 +1,121 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Database cross-reference.
+ * 
+ * <p>Java class for XrefType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="XrefType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="db" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="secondaryId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "XrefType")
+public class XrefType {
+
+    @XmlAttribute(name = "db", required = true)
+    protected String db;
+    @XmlAttribute(name = "id", required = true)
+    protected String id;
+    @XmlAttribute(name = "secondaryId")
+    protected String secondaryId;
+
+    /**
+     * Gets the value of the db property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDb() {
+        return db;
+    }
+
+    /**
+     * Sets the value of the db property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDb(String value) {
+        this.db = value;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the secondaryId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSecondaryId() {
+        return secondaryId;
+    }
+
+    /**
+     * Sets the value of the secondaryId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSecondaryId(String value) {
+        this.secondaryId = value;
+    }
+
+}