From: James Procter Date: Mon, 15 May 2023 13:54:24 +0000 (+0100) Subject: JAL-4182 patch - map selection group onto sequence positions - fixes failing test.. X-Git-Tag: Release_2_11_3_0~14^2~3^2^2~28 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=571d610157d2c8ae01464b20d6d9c1ea935705d6;p=jalview.git JAL-4182 patch - map selection group onto sequence positions - fixes failing test.. --- diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index 403991a..0fdabc8 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -1539,8 +1539,9 @@ public class AlignmentUtils int endRes = ann.annotations.length; if (selectionGroup != null) { - startRes = selectionGroup.getStartRes(); - endRes = selectionGroup.getEndRes(); + startRes = -1+Math.min(seq.getEnd(), Math.max(seq.getStart(),seq.findPosition(selectionGroup.getStartRes()))); + endRes = -1+Math.min(seq.getEnd(),seq.findPosition(selectionGroup.getEndRes())); + } copyAnn.restrict(startRes, endRes + 0);