From 9769c798c95dff2006438438706a3e715755cd57 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 19 May 2017 11:48:11 +0100 Subject: [PATCH] JAL-2544 only include features in selected columns for sort --- src/jalview/analysis/AlignmentSorter.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index 681d3b7..f228350 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -771,6 +771,18 @@ public class AlignmentSorter { SequenceFeature sf = it.next(); + /* + * double-check feature overlaps columns (JAL-2544) + * (could avoid this with a findPositions(fromCol, toCol) method) + * findIndex returns base 1 column values, startCol/endCol are base 0 + */ + if (seqs[i].findIndex(sf.getBegin()) > endCol + 1 + || seqs[i].findIndex(sf.getEnd()) < startCol + 1) + { + it.remove(); + continue; + } + String featureGroup = sf.getFeatureGroup(); if (groups != null && featureGroup != null && !groups.contains(featureGroup)) -- 1.7.10.2