From 57b4d7111e3f745aa6f1ec40f518fe1a6073e8e3 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 3 Feb 2022 14:59:31 +0000 Subject: [PATCH] =?utf8?q?JAL-3806=20use=20the=20covers()=20test=20for=20eac?= =?utf8?q?h=20selected=20sequence=20and=20the=20complementary=20alignment=E2?= =?utf8?q?=80=99s=20sequence=20as=20a=20filter=20for=20direct=20CDS-Protein=20?= =?utf8?q?mappings=20(ensures=20overlapping=20CDS=20coding=20for=20distinct=20?= =?utf8?q?proteins=20do=20not=20all=20get=20selected)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/util/MappingUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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); -- 1.7.10.2