JAL-2154 don’t add any remaining xrefed sequences of the wrong molecule type to the...
authorJim Procter <jprocter@issues.jalview.org>
Fri, 26 Aug 2016 12:20:51 +0000 (13:20 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 26 Aug 2016 12:20:51 +0000 (13:20 +0100)
src/jalview/analysis/AlignmentUtils.java

index cc80384..e0ec22b 100644 (file)
@@ -2596,7 +2596,7 @@ public class AlignmentUtils
   {
     AlignmentI copy = new Alignment(new Alignment(seqs));
     copy.setDataset(dataset);
-
+    boolean isProtein = !copy.isNucleotide();
     SequenceIdMatcher matcher = new SequenceIdMatcher(seqs);
     if (xrefs != null)
     {
@@ -2607,7 +2607,8 @@ public class AlignmentUtils
         {
           for (DBRefEntry dbref : dbrefs)
           {
-            if (dbref.getMap() == null || dbref.getMap().getTo() == null)
+            if (dbref.getMap() == null || dbref.getMap().getTo() == null
+                    || dbref.getMap().getTo().isProtein() != isProtein)
             {
               continue;
             }