added aligned codon frames, and dataset reference ids for sequenceSet and sequences...
[jalview.git] / src / jalview / datamodel / Sequence.java
index 0e72690..257f88a 100755 (executable)
@@ -86,6 +86,11 @@ public class Sequence
 
   void parseId()
   {
+    if (name==null)
+    {
+      System.err.println("POSSIBLE IMPLEMENTATION ERROR: null sequence name passed to constructor.");
+      name = "";
+    }
     // Does sequence have the /start-end signiature?
     if (limitrx.search(name))
     {
@@ -760,8 +765,16 @@ public class Sequence
 
     for(i=0; i<iSize; i++)
     {
-      if(dbrefs[i].equals(entry))
+      if(dbrefs[i].equalRef(entry))
       {
+        if (entry.getMap()!=null)
+        {
+          if (dbrefs[i].getMap()==null)
+          {
+            // overwrite with 'superior' entry that contains a mapping.
+            dbrefs[i] = entry;
+          }
+        }
         return;
       }
     }