+
+ /*
+ * now select columns 0-9 and search for A.*H
+ * this should match in the second sequence (split as 3 matches)
+ * but not the first (as H is outside the selection)
+ */
+ SequenceGroup selection = new SequenceGroup();
+ selection.setStartRes(0);
+ selection.setEndRes(9);
+ al.getSequences().forEach(seq -> selection.addSequence(seq, false));
+ av.setSelectionGroup(selection);
+ f.findAll("A.*H", false, false, true);
+ searchResults = f.getSearchResults();
+ assertEquals(searchResults.getCount(), 1);
+ assertEquals(searchResults.getResults().size(), 3);
+ // match made of contiguous matches A, DE, H
+ match = searchResults.getResults().get(0);
+ assertSame(match.getSequence(), al.getSequenceAt(1));
+ assertEquals(match.getStart(), 1); // A
+ assertEquals(match.getEnd(), 1);
+ match = searchResults.getResults().get(1);
+ assertSame(match.getSequence(), al.getSequenceAt(1));
+ assertEquals(match.getStart(), 4); // D
+ assertEquals(match.getEnd(), 5); // E
+ match = searchResults.getResults().get(2);
+ assertSame(match.getSequence(), al.getSequenceAt(1));
+ assertEquals(match.getStart(), 7); // H (there is no G)
+ assertEquals(match.getEnd(), 7);