JAL-2110 ensure "UniProtKB/Swiss-Prot" dbrefs canonicalised to UNIPROT
[jalview.git] / src / jalview / datamodel / xdb / embl / EmblEntry.java
index 3207411..eb49711 100644 (file)
@@ -62,21 +62,25 @@ public class EmblEntry
 
   String sequenceVersion;
 
+  String dataClass;
+
   String moleculeType;
 
   String topology;
 
   String sequenceLength;
 
-  String taxDivision;
+  String taxonomicDivision;
+
+  String description;
 
-  String desc;
+  String firstPublicDate;
 
-  String rCreated;
+  String firstPublicRelease;
 
-  String rLastUpdated;
+  String lastUpdatedDate;
 
-  String lastUpdated;
+  String lastUpdatedRelease;
 
   Vector<String> keywords;
 
@@ -121,23 +125,6 @@ public class EmblEntry
   }
 
   /**
-   * @return the desc
-   */
-  public String getDesc()
-  {
-    return desc;
-  }
-
-  /**
-   * @param desc
-   *          the desc to set
-   */
-  public void setDesc(String desc)
-  {
-    this.desc = desc;
-  }
-
-  /**
    * @return the features
    */
   public Vector<EmblFeature> getFeatures()
@@ -172,57 +159,6 @@ public class EmblEntry
   }
 
   /**
-   * @return the lastUpdated
-   */
-  public String getLastUpdated()
-  {
-    return lastUpdated;
-  }
-
-  /**
-   * @param lastUpdated
-   *          the lastUpdated to set
-   */
-  public void setLastUpdated(String lastUpdated)
-  {
-    this.lastUpdated = lastUpdated;
-  }
-
-  /**
-   * @return the releaseCreated
-   */
-  public String getRCreated()
-  {
-    return rCreated;
-  }
-
-  /**
-   * @param releaseCreated
-   *          the releaseCreated to set
-   */
-  public void setRCreated(String releaseCreated)
-  {
-    this.rCreated = releaseCreated;
-  }
-
-  /**
-   * @return the releaseLastUpdated
-   */
-  public String getRLastUpdated()
-  {
-    return rLastUpdated;
-  }
-
-  /**
-   * @param releaseLastUpdated
-   *          the releaseLastUpdated to set
-   */
-  public void setRLastUpdated(String releaseLastUpdated)
-  {
-    this.rLastUpdated = releaseLastUpdated;
-  }
-
-  /**
    * @return the sequence
    */
   public EmblSequence getSequence()
@@ -240,40 +176,6 @@ public class EmblEntry
   }
 
   /**
-   * @return the taxDivision
-   */
-  public String getTaxDivision()
-  {
-    return taxDivision;
-  }
-
-  /**
-   * @param taxDivision
-   *          the taxDivision to set
-   */
-  public void setTaxDivision(String taxDivision)
-  {
-    this.taxDivision = taxDivision;
-  }
-
-  /**
-   * @return the entry version
-   */
-  public String getEntryVersion()
-  {
-    return entryVersion;
-  }
-
-  /**
-   * @param version
-   *          the version to set
-   */
-  public void setEntryVersion(String version)
-  {
-    this.entryVersion = version;
-  }
-
-  /**
    * Recover annotated sequences from EMBL file
    * 
    * @param sourceDb
@@ -285,7 +187,7 @@ public class EmblEntry
   {
     SequenceI dna = new Sequence(sourceDb + "|" + accession,
             sequence.getSequence());
-    dna.setDescription(desc);
+    dna.setDescription(description);
     DBRefEntry retrievedref = new DBRefEntry(sourceDb,
             getSequenceVersion(), accession);
     dna.addDBRef(retrievedref);
@@ -298,6 +200,7 @@ public class EmblEntry
     {
       for (DBRefEntry dbref : dbRefs)
       {
+        dbref.setSource(DBRefUtils.getCanonicalName(dbref.getSource()));
         dna.addDBRef(dbref);
       }
     }
@@ -310,6 +213,10 @@ public class EmblEntry
         {
           for (DBRefEntry dbref : feature.dbRefs)
           {
+            /*
+             * convert UniProtKB/Swiss-Prot to UNIPROT
+             */
+            dbref.setSource(DBRefUtils.getCanonicalName(dbref.getSource()));
             dna.addDBRef(dbref);
           }
         }
@@ -510,20 +417,20 @@ public class EmblEntry
         SequenceFeature sf = makeCdsFeature(exon, xint, prname, prid, vals,
                 codonStart);
         sf.setType(feature.getName()); // "CDS"
+        sf.setEnaLocation(feature.getLocation());
         sf.setFeatureGroup(sourceDb);
         dna.addSequenceFeature(sf);
       }
     }
 
     /*
-     * add dbRefs to sequence, and mappings for Uniprot xrefs
+     * add mappings for Uniprot xrefs
      */
     if (feature.dbRefs != null)
     {
       boolean mappingUsed = false;
       for (DBRefEntry ref : feature.dbRefs)
       {
-        ref.setSource(DBRefUtils.getCanonicalName(ref.getSource()));
         if (ref.getSource().equals(DBRefSource.UNIPROT))
         {
           String proteinSeqName = DBRefSource.UNIPROT + "|"
@@ -579,7 +486,6 @@ public class EmblEntry
             }
           }
         }
-        dna.addDBRef(ref);
       }
       if (noProteinDbref && product != null)
       {
@@ -779,6 +685,26 @@ public class EmblEntry
     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;
@@ -799,33 +725,73 @@ public class EmblEntry
     this.topology = topology;
   }
 
-  public String getSequenceLength()
+  public String getTaxonomicDivision()
   {
-    return sequenceLength;
+    return taxonomicDivision;
   }
 
-  public void setSequenceLength(String sequenceLength)
+  public void setTaxonomicDivision(String taxonomicDivision)
   {
-    this.sequenceLength = sequenceLength;
+    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 getrCreated()
+  public String getLastUpdatedRelease()
   {
-    return rCreated;
+    return lastUpdatedRelease;
   }
 
-  public void setrCreated(String rCreated)
+  public void setLastUpdatedRelease(String lastUpdatedRelease)
   {
-    this.rCreated = rCreated;
+    this.lastUpdatedRelease = lastUpdatedRelease;
   }
 
-  public String getrLastUpdated()
+  public String getDataClass()
   {
-    return rLastUpdated;
+    return dataClass;
   }
 
-  public void setrLastUpdated(String rLastUpdated)
+  public void setDataClass(String dataClass)
   {
-    this.rLastUpdated = rLastUpdated;
+    this.dataClass = dataClass;
   }
 }