From: Jim Procter Date: Thu, 3 Feb 2022 14:59:31 +0000 (+0000) Subject: JAL-3806 use the covers() test for each selected sequence and the complementary align... X-Git-Tag: Release_2_11_2_0~13^2~4^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=57b4d7111e3f745aa6f1ec40f518fe1a6073e8e3;p=jalview.git JAL-3806 use the covers() test for each selected sequence and the complementary alignment’s sequence as a filter for direct CDS-Protein mappings (ensures overlapping CDS coding for distinct proteins do not all get selected) --- diff --git a/src/jalview/util/MappingUtils.java b/src/jalview/util/MappingUtils.java index c992243..03a32c9 100644 --- a/src/jalview/util/MappingUtils.java +++ b/src/jalview/util/MappingUtils.java @@ -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);