From 571d610157d2c8ae01464b20d6d9c1ea935705d6 Mon Sep 17 00:00:00 2001 From: James Procter Date: Mon, 15 May 2023 14:54:24 +0100 Subject: [PATCH] JAL-4182 patch - map selection group onto sequence positions - fixes failing test.. --- src/jalview/analysis/AlignmentUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 1.7.10.2