Merge branch 'develop' into features/JAL-2110_crossRefDuplications
[jalview.git] / src / jalview / datamodel / xdb / embl / EmblEntry.java
index 9a07c36..b750973 100644 (file)
@@ -202,6 +202,7 @@ public class EmblEntry
     {
       for (DBRefEntry dbref : dbRefs)
       {
+        dbref.setSource(DBRefUtils.getCanonicalName(dbref.getSource()));
         dna.addDBRef(dbref);
       }
     }
@@ -214,6 +215,10 @@ public class EmblEntry
         {
           for (DBRefEntry dbref : feature.dbRefs)
           {
+            /*
+             * convert UniProtKB/Swiss-Prot to UNIPROT
+             */
+            dbref.setSource(DBRefUtils.getCanonicalName(dbref.getSource()));
             dna.addDBRef(dbref);
           }
         }
@@ -421,14 +426,13 @@ public class EmblEntry
     }
 
     /*
-     * 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 + "|"
@@ -484,7 +488,6 @@ public class EmblEntry
             }
           }
         }
-        dna.addDBRef(ref);
       }
       if (noProteinDbref && product != null)
       {