- continue;
- }
- mappedGroup.addSequence(seq, false);
- if (allGapped)
- {
- /*
- * sequence is mapped but includes no mapped residues
- */
- continue;
- }
- int mappedStartResidue = 0;
- int mappedEndResidue = 0;
- List<AlignedCodonFrame> mapping = Arrays.asList(acf);
- SearchResultsI sr = buildSearchResults(selected, startResiduePos,
- mapping);
- for (SearchResultMatchI m : sr.getResults())
- {
- mappedStartResidue = m.getStart();
- mappedEndResidue = m.getEnd();
- }
- sr = buildSearchResults(selected, endResiduePos, mapping);
- for (SearchResultMatchI m : sr.getResults())
- {
- mappedStartResidue = Math.min(mappedStartResidue, m.getStart());
- mappedEndResidue = Math.max(mappedEndResidue, m.getEnd());
- }
+ if (map.covers(selected) && map.covers(seq))
+ {
+ /*
+ * Found a sequence mapping. Locate the start/end mapped residues.
+ */
+ List<AlignedCodonFrame> mapping = Arrays
+ .asList(new AlignedCodonFrame[]
+ { acf });
+ // locate start
+ SearchResultsI sr = buildSearchResults(selected,
+ startResiduePos, mapping);
+ for (SearchResultMatchI m : sr.getResults())
+ {
+ mappedStartResidue = m.getStart();
+ mappedEndResidue = m.getEnd();
+ }
+ // locate end - allowing for adjustment of start range
+ sr = buildSearchResults(selected, endResiduePos, mapping);
+ for (SearchResultMatchI m : sr.getResults())
+ {
+ mappedStartResidue = Math.min(mappedStartResidue,
+ m.getStart());
+ mappedEndResidue = Math.max(mappedEndResidue, m.getEnd());
+ }