X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAlignmentSorter.java;h=e7733e9b065ac3c9ce062cf054999ffdc9a01b87;hb=60e252f7e0084336b0a85620842ce3db8f63e5b0;hp=681d3b75ee2f3996bf4200bf884e32eb24b1d125;hpb=c689b58a9aaa704f5e5160e44da5b84e8984d6a0;p=jalview.git diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index 681d3b7..e7733e9 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -771,8 +771,25 @@ 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; + } + + /* + * accept all features with null or empty group, otherwise + * check group is one of the currently visible groups + */ String featureGroup = sf.getFeatureGroup(); if (groups != null && featureGroup != null + && !"".equals(featureGroup) && !groups.contains(featureGroup)) { it.remove();