From 457deb581a5614633f1c4dd15fee5eeaea5c9758 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 2 Nov 2016 15:33:09 +0000 Subject: [PATCH] JAL-1738 JAL-345 fix for JAL-2302 only report Matches that are not contained by the previous match. --- src/jalview/analysis/Finder.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/jalview/analysis/Finder.java b/src/jalview/analysis/Finder.java index 086765c..ff03788 100644 --- a/src/jalview/analysis/Finder.java +++ b/src/jalview/analysis/Finder.java @@ -21,6 +21,7 @@ package jalview.analysis; import jalview.datamodel.AlignmentI; +import jalview.datamodel.SearchResultMatchI; import jalview.datamodel.SearchResults; import jalview.datamodel.SearchResultsI; import jalview.datamodel.Sequence; @@ -103,6 +104,7 @@ public class Finder selection = null; } } + SearchResultMatchI lastm = null; while (!found && (seqIndex < end)) { @@ -193,7 +195,6 @@ public class Finder } String noGaps = noGapsSB.toString(); - for (int r = resIndex; r < noGaps.length(); r++) { @@ -216,8 +217,13 @@ public class Finder - 1 + Integer.parseInt(spaces .elementAt(regex.matchedTo() - 1).toString())); - - searchResults.addResult(seq, sres, eres); + // only add result if not contained in previous result + if (lastm == null + || (lastm.getSequence() != seq || (!(lastm.getStart() <= sres && lastm + .getEnd() >= eres)))) + { + lastm = searchResults.addResult(seq, sres, eres); + } hasResults = true; if (!findAll) { -- 1.7.10.2