JAL-3806 use the covers() test for each selected sequence and the complementary align...
authorJim Procter <j.procter@dundee.ac.uk>
Thu, 3 Feb 2022 14:59:31 +0000 (14:59 +0000)
committerJim Procter <j.procter@dundee.ac.uk>
Thu, 3 Feb 2022 14:59:31 +0000 (14:59 +0000)
src/jalview/util/MappingUtils.java

index c992243..03a32c9 100644 (file)
@@ -36,6 +36,7 @@ import jalview.commands.EditCommand.Action;
 import jalview.commands.EditCommand.Edit;
 import jalview.commands.OrderCommand;
 import jalview.datamodel.AlignedCodonFrame;
+import jalview.datamodel.AlignedCodonFrame.SequenceToSequenceMapping;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentOrder;
 import jalview.datamodel.ColumnSelection;
@@ -367,11 +368,11 @@ public final class MappingUtils
       {
         int mappedStartResidue = 0;
         int mappedEndResidue = 0;
-
         for (AlignedCodonFrame acf : codonFrames)
         {
-          Mapping map = acf.getMappingBetween(seq, selected);
-          if (map != null)
+          for (SequenceToSequenceMapping map: acf.getMappings())
+          {
+          if (map.covers(selected) && map.covers(seq))
           {
             /*
              * Found a sequence mapping. Locate the start/end mapped residues.
@@ -407,7 +408,7 @@ public final class MappingUtils
             mappedGroup.addSequence(seq, false);
             break;
           }
-        }
+        }}
       }
     }
     mappedGroup.setStartRes(minStartCol < 0 ? 0 : minStartCol);