Merge branch 'features/JAL-2110_crossRefDuplications' into merge_JAL-2110
[jalview.git] / src / jalview / datamodel / xdb / embl / EmblEntry.java
index f8c0bbe..5409d5b 100644 (file)
@@ -198,10 +198,15 @@ public class EmblEntry
     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);
       }
     }
@@ -211,13 +216,6 @@ public class EmblEntry
     {
       for (EmblFeature feature : features)
       {
-        if (feature.dbRefs != null)
-        {
-          for (DBRefEntry dbref : feature.dbRefs)
-          {
-            dna.addDBRef(dbref);
-          }
-        }
         if (FeatureProperties.isCodingFeature(sourceDb, feature.getName()))
         {
           parseCodingFeature(feature, sourceDb, dna, peptides, matcher);
@@ -248,6 +246,8 @@ public class EmblEntry
    *          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)
@@ -428,6 +428,9 @@ public class EmblEntry
       boolean mappingUsed = false;
       for (DBRefEntry ref : feature.dbRefs)
       {
+        /*
+         * ensure UniProtKB/Swiss-Prot converted to UNIPROT
+         */
         ref.setSource(DBRefUtils.getCanonicalName(ref.getSource()));
         if (ref.getSource().equals(DBRefSource.UNIPROT))
         {